Kishore Thutaram
"SAP solution architect with a strong problem-solving mindset, sharing practical SAP S/4HANA and ABAP insights from real-world projects."
https://fiowelt.comApply additional Sales deal number when there are multiple Sales deal condition records maintained
Steps:
Steps : Create a new Pricing routine
Go to VOFM Transaction
Select Requirements from Menu
Create a Pricing routine ex: 901
Code inside the routine:
-- Get the VBAP data to check whether manual sales deal is entered or not
-- Activate the sales deal manual condition only when sales deal manual entered
--Sales Order
ASSIGN ('(SAPMV45A)VBAP') TO .
IF IS ASSIGNED.
IF -zz1_salesdeal_mnl_sdi IS INITIAL.
lv_subrc = 4.
ENDIF.
IF IS ASSIGNED AND -zz1_salesdeal_mnl_sdi IS NOT INITIAL.
komp-knuma_ag = -zz1_salesdeal_mnl_sdi.
ENDIF.
ELSE.
*--Invoice
ASSIGN ('(SAPMV60A)VBRP') TO .
IF IS NOT ASSIGNED.
ASSIGN ('(SAPLV60A)VBRP') TO . "Flow from Fiori
ENDIF.
IF IS ASSIGNED AND -zz1_salesdeal_mnl_bdi IS INITIAL.
lv_subrc = 4.
ENDIF.
IF IS ASSIGNED AND -zz1_salesdeal_mnl_bdi IS NOT INITIAL.
komp-knuma_ag = -zz1_salesdeal_mnl_bdi.
ENDIF.
ENDIF.
sy-subrc = lv_subrc.
"SAP solution architect with a strong problem-solving mindset, sharing practical SAP S/4HANA and ABAP insights from real-world projects."
https://fiowelt.com