Creating Business Partners

06/04/2022 smart village SAP

Users given the right to create Business partners can be compelled to enter all the required information by using these queries in the SP_TransactionNotification.

Follow the path to post the query:

Login to Microsoft SQL Server Management Studio

Expand Databases.

  1. Expand Your Database in this case (SVTL2022).
  2. Expand Programmability.
  3. Expand Stored Procedures.
  4. Scroll down to dbo.SBO_SP_TransactionNotification.
  5. Right Click on dbo.SBO_SP_TransactionNotification
  1. Click Modify
  2. Paste Query in the section indicated above “Insert your query here”
  3. Click Execute

—-Blocking Creating Business Partners without Mobile Number

IF @object_type = ‘2’ and @transaction_type  IN (‘A’,’U’)

BEGIN

IF  exists (

SELECT  T0.CardCode FROM OCRD T0  WHERE

T0.CardCode = @list_of_cols_val_tab_del and  T0.[Cellular] is null

)

BEGIN

set @error = 1

Set @error_message = ‘On the General TAB Please Enter the Business Partner Mobile Number on the Mobile Phone Field!!’

END

END

—-Blocking Creating Business Patners Without Email  

IF @object_type = ‘2’ and @transaction_type IN (‘A’,’U’)

BEGIN

IF  exists (

SELECT  T0.CardCode FROM OCRD T0  WHERE

T0.CardCode = @list_of_cols_val_tab_del and T0.[E_Mail] IS NULL

)

BEGIN

set @error = 1

Set @error_message = ‘On the General TAB Please Enter the Business Partner Email Address on the Email Field!!’

END

END

 

—-Blocking Creating Business Patners Without Telephone Number  

IF @object_type = ‘2’ and @transaction_type IN (‘A’,’U’)

BEGIN

IF  exists (

SELECT  T0.CardCode FROM OCRD T0  WHERE

T0.CardCode = @list_of_cols_val_tab_del and T0.[Phone1] IS NULL

)

BEGIN

set @error = 1

Set @error_message = ‘On the General TAB Please Enter the Business Partner Telephone Number on the Tel1 & Tel2 Field!!’

END

END

—-Blocking Creating Business Patners Without Postal Address 

IF @object_type = ‘2’ and @transaction_type  IN (‘A’,’U’)

BEGIN

IF  exists (

SELECT  T0.CardCode FROM OCRD T0  INNER JOIN CRD1 T1 ON T0.[CardCode] = T1.[CardCode]  WHERE

T0.CardCode = @list_of_cols_val_tab_del and T1.[Street] IS NULL

)

BEGIN

set @error = 1

Set @error_message = ‘On the Addresses TAB Please Enter the Business partner Postal Address on the Postal Address Field!!’

END

END

 

—-Blocking Creating Business Patners Without Location     

IF @object_type = ‘2’ and @transaction_type  IN (‘A’,’U’)

BEGIN

IF  exists (

SELECT  T0.CardCode FROM OCRD T0  INNER JOIN CRD1 T1 ON T0.[CardCode] = T1.[CardCode]  WHERE

T0.CardCode = @list_of_cols_val_tab_del and T1.[City] IS NULL

)

BEGIN

set @error = 1

Set @error_message = ‘On the Addresses TAB Please Enter the Business partner Location on the City Field!!’

END

END

—-Blocking Creating Business Patners Without Address ID  

IF @object_type = ‘2’ and @transaction_type IN (‘A’,’U’)

Begin

If Exists (Select T0.CardCode From OCRD T0

LEFT JOIN CRD1 T1 ON T0.[CardCode] = T1.[CardCode]

WHERE ISNULL(T1.[Address],”) = ” AND T0.CardCode = @list_of_cols_val_tab_del )

Begin

Set @error = 1

Set @error_message = ‘On the Addresses TAB Please Enter the Address ID As Address ID’

END

END

—Blocking Creating Business partner without contact person details   

IF @object_type = ‘2’ and @transaction_type IN (‘A’,’U’)

 

Begin

 

If exists ( Select T0.CardCode From OCRD T0

LEFT Join OCPR T1 On T0.[CardCode] = T1.[CardCode]

Where  ISNULL(T1.FirstName,”) = ” AND T0.CardCode = @list_of_cols_val_tab_del  )

Begin

 

Set @error = 1

Set @error_message = ‘ On the Contact Person TAB Please Enter the Contact Person Contact ID, First & Middle Names ‘

End

 

End

—-Block Business Partner Without Contact Person’s Email Address 

IF @object_type = ‘2’ and @transaction_type IN (‘A’,’U’)

Begin

If Exists (Select T0.CardCode From OCRD T0

LEFT JOIN OCPR T1 ON T0.[CardCode] = T1.[CardCode]

WHERE ISNULL(T1.E_MailL,”) = ” AND T0.CardCode = @list_of_cols_val_tab_del )

Begin

Set @error = 1

Set @error_message = ‘On Contact Person TAB Please Enter the Contact Person Email Address’

END

END

—Blocking Creating Business Partner Without Email Group    

IF @object_type = ‘2’ and @transaction_type IN (‘A’,’U’)

Begin

If Exists (Select T0.CardCode From OCRD T0

LEFT JOIN OCPR T1 ON T0.[CardCode] = T1.[CardCode]

WHERE T1.EmlGrpCode !=’Statements’ AND T0.CardCode = @list_of_cols_val_tab_del )

Begin

Set @error = 1

Set @error_message = ‘On the Contact Person TAB Please Select Statements on the E-mail Group Field’

END

END