Skip to Content
0

Need SPT to block Customer/s from adding Delivery notes,

Apr 24, 2017 at 01:29 PM

34

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
DIEGO LOTHER Apr 24, 2017 at 01:50 PM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0

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

1