Dear Experts
Due to some reason i cannot use Inactive options in Customer MD, But i need to block selected customers from adding Delivery notes via SPT
Could any one help me with the SPT code
Regards
Hi Shahan,
With hard code you can do something like this:
IF @object_type = '15' AND @transaction_type IN ('A', 'U') BEGIN IF (SELECT COUNT(*) FROM ODLN WHERE CardCode IN ('CardCode 1', 'CardCode 2') AND DocEntry = @list_of_cols_val_tab_del) > 0 BEGIN SET @error = -1 SET @error_message = 'It is not allowed delivery notes for this customer' END END
In this case replace the CardCode 1 and 2 with valid card codes and add more if it is necessary.
But I suggest you to create an udf field on Business Partner Master data table (OCRD) to identify what customer is not allowed to delivery notes, and check this user field in your transaction.
Hope it helps.
Kind Regards,
Diego Lother
Dear Lother
Thanks for the Support.
I need to know is it possible to block when an user select employee code or name in Delivery Note, instead of Entering all data and then blocking at the time of Adding. this will be more helpfull
Regards
Hi Shahan,
There is no default way to achieve this, but you can develop a custom for your company with the SDK provided by SAP, but remember for this you need familiarized with development process or have a developer to do this for you.
Hope it helps.
Kind Regards,
Diego Lother