cancel
Showing results for 
Search instead for 
Did you mean: 

Send "Error" if a User Changes Payment Term While Adding SO

larryenet
Participant
0 Kudos

Hello SAP Gurus,

Is there a way to edit SP Transaction Notification to make it give an "Error" if a user selects either "AMEX" or "VISA-6556" from the drop-down menu for Payment Terms when adding a Sales Order?

Thank you for your help.

Kind regards,

Larry T.

Accepted Solutions (1)

Accepted Solutions (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Please try this:

IF @object_type IN ('17') AND @transaction_type  IN( 'A','U')

Begin

if exist (SELECT t0.docentry FROM ORDR T0 INNER JOIN OCTG T1 ON T0.GroupNum = T1.GroupNum

WHERE T1.PymntGroup IN ('AMEX', 'VISA - 6556') AND T0.DocEntry = @list_of_cols_val_tab_del)

Begin

   SET @error = -5000

  SET @error_message = N'Amex and VIsa can not be chosen'

end

END

larryenet
Participant
0 Kudos

Thank you very much!!

Answers (1)

Answers (1)

frank_wang6
Active Contributor
0 Kudos

Yes, u can do that with SP_TN

and i give u another suggestion, you can change the Term name to Z_AMEX, so it will be at the end of the list.

larryenet
Participant
0 Kudos

Hi Frank,

Thank you for your input, but I'm not quite sure how to setup the SP for this one.

We don't want to change the Term names.

Can you or maybe someone help me with SP?

frank_wang6
Active Contributor
0 Kudos

IF @object_type IN ('17') AND @transaction_type = 'A'

Begin

if exist (SELECT t0.docentry FROM ORDR T0 INNER JOIN OCTG T1 ON T0.GroupNum = T1.GroupNum

WHERE T1.PymntGroup IN ('AMEX', 'VISA - 6656') AND T0.DocEntry = @list_of_cols_val_tab_del)

Begin

   SET @error = -5000

  SET @error_message = N'Amex and VIsa can not be chosen'

end

END

larryenet
Participant
0 Kudos

Thank you very much!!