cancel
Showing results for 
Search instead for 
Did you mean: 

Validation to block cancellation of AR invoice for specific users

Swathy
Explorer
0 Kudos

Hi,

I want to block few users from cancelling AR invoice document. I have tried the following Transaction Notification on HANA database.

 

If ((:transaction_type='L') and :object_type = '13')  THEN 
SELECT
  COUNT(*) INTO temp_var_0
FROM
(
SELECT A."DocEntry"
FROM INV1 A
INNER JOIN OINV B ON A."DocEntry"=B."DocEntry"
LEFT OUTER JOIN OUSR C ON B."UserSign" = C."USERID"
WHERE C."U_NAME" NOT IN ('cwi01','cwi03','cwi04') AND 
A."DocEntry" =:list_of_cols_val_tab_del
 
)R;
 
IF :temp_var_0>0 THEN 
OutPut1:=1;
error_no:=503;
error_text:='Cancellation is not allowed';
END IF;
END IF;
 

It is not working.

Could you please help on this.

Accepted Solutions (0)

Answers (0)