cancel
Showing results for 
Search instead for 
Did you mean: 

SAP HANA- OPOR transaction notification

former_member627791
Participant
0 Kudos

Dear team,

We created transaction notification for sales and purchase documents - the same one with changing only the tables and object types- and when we execute the OPOR one in SAP HANA we are not getting any errors but in SBO the transaction notification just won't work. (We checked again making sure we are on the same DB in both HANA and SBO).

This is the transaction notification:

IF :object_type = '22' and :transaction_type ='A' then--in ('A','U') THEN

DECLARE TESTST nvarchar(30);

SELECT COUNT(*) INTO CNT

FROM OPOR T0

WHERE T0."DocEntry"=:list_of_cols_val_tab_del

AND (IFNULL(T0."U_XIS_DocType",'')='' OR IFNULL(T0."U_XIS_Company",'')='' OR IFNULL(T0."U_XIS_SalesChannel",'')='')

AND T0."DataSource"='I'

AND T0."U_XIS_TradeInDoc"='N'

AND IFNULL(T0."U_XIS_DocType",'')!='Internal';

SELECT IFNULL(T0."U_XIS_DocType",'I') INTO TESTST

FROM OPOR T0

WHERE T0."DocEntry"=:list_of_cols_val_tab_del

AND (IFNULL(T0."U_XIS_DocType",'')='' OR IFNULL(T0."U_XIS_Company",'')='' OR IFNULL(T0."U_XIS_SalesChannel",'')='') ;

AND T0."DataSource"='I'

AND T0."U_XIS_TradeInDoc"='N' --לא טרייד אין

AND IFNULL(T0."U_XIS_DocType",'')!='Internal';

IF cnt > 0 THEN

error := 120;

error_message :=1;--TESTST; --N'יש למלא שדות חובה: חברה, תחום ותת תחום';

END IF;

END IF;

Now, even if we try the most simply transaction notification on OPOR it won't work in SBO:

IF :object_type = '22' and :transaction_type ='A'

then error := 120; error_message :=1;


Any ideas why?

Thank you,

Or Cohen

Accepted Solutions (0)

Answers (1)

Answers (1)

mgregur
Active Contributor
0 Kudos

Hi,

I suggest that you first try this simple option you mention, but complete it (you're missing END IF):

IF :object_type = '22' and :transaction_type ='A'
then error := 120; error_message :=1;
END IF;

If this doesn't work you need to go to SAP Support with this issue, as that would mean your SBO_SP_TransactionNotification is not working correctly.

If that works, try this code:

IF :object_type = '22' and :transaction_type ='A' then
	DECLARE TESTST nvarchar(30);
	SELECT COUNT(*) INTO CNT
	FROM OPOR T0
	WHERE T0."DocEntry"=:list_of_cols_val_tab_del
	AND (IFNULL(T0."U_XIS_DocType",'')='' OR IFNULL(T0."U_XIS_Company",'')='' OR IFNULL(T0."U_XIS_SalesChannel",'')='')
	AND T0."DataSource"='I'
	AND T0."U_XIS_TradeInDoc"='N'
	AND IFNULL(T0."U_XIS_DocType",'')!='Internal';


	SELECT IFNULL(T0."U_XIS_DocType",'I') INTO TESTST
	FROM OPOR T0
	WHERE T0."DocEntry"=:list_of_cols_val_tab_del
	AND (IFNULL(T0."U_XIS_DocType",'')='' OR IFNULL(T0."U_XIS_Company",'')='' OR IFNULL(T0."U_XIS_SalesChannel",'')='') ;
	AND T0."DataSource"='I'
	AND T0."U_XIS_TradeInDoc"='N' --לא טרייד אין
	AND IFNULL(T0."U_XIS_DocType",'')!='Internal';


	IF :CNT > 0 THEN
	error := 120;
	error_message := :TESTST;
	END IF;
END IF;

You had two errors, one was forgetting that HANA is case sensitive (you select into CNT but call variable cnt) and second was missing : when calling a variable (IF cnt instead of IF :CNT).

BR,

Matija