cancel
Showing results for 
Search instead for 
Did you mean: 

Dear SAP Community i need a validation for restricted an warehouse for same SAP users

KULBEERSINGH
Explorer
0 Kudos
199

Dear SAP Community i need a validation for restricted an warehouse for my same SAP b1 users please provide me stored procedures for the same..

View Entire Topic
ManishPant
Participant

Hi,

Please try this.

 

Note: This validation will not allow the warehouse code to be the 'manager' but will allow 'MANAGER'.

IF :object_type = n'64' AND (:transaction_type = n'A' OR :transaction_type = n'U') 
THEN 
		DECLARE VAR20_COUNT INT := 0;

		SELECT COUNT(H20."WhsCode") INTO VAR20_COUNT FROM OWHS H20 WHERE H20."WhsCode"=:list_of_cols_val_tab_del AND H20."WhsCode" IN (SELECT "USER_CODE" FROM OUSR);
		
		IF :VAR20_COUNT > 0
		THEN
				error := -99001;
				error_message := 'Warehouse Code must not be same as SBO Username';
		END IF;
		VAR20_COUNT := 0;
END IF;

Thanks.

Manish

KULBEERSINGH
Explorer
Thanks its Working