Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 24, 2017 at 01:50 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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