Kishore Thutaram
SAP Solution Architect | 16+ Years' Experience in SAP | Sharing Practical SAP Knowledge | Engineering Graduate with Expertise in SAP Architecture
https://fiowelt.comSteps: User Exit Include -> MV45AFZZ
Form routine – MOVE_FIELD_TO_VBKD
Implement the code below
"Read Item level shipto first, if no entry then look at header shipto
DATA(ls_xvbpa) = VALUE #( xvbpa[ posnr = vbkd-posnr parvw = 'WE' ] OPTIONAL ).
IF ls_xvbpa-kunnr IS INITIAL.
ls_xvbpa = VALUE #( xvbpa[ posnr = '000000' parvw = 'WE' ] OPTIONAL ).
ENDIF.
*--* Fetch Price List Type of the Ship-To from master Data
IF ls_xvbpa-kunnr IS NOT INITIAL.
SELECT SINGLE pricelisttype FROM i_customersalesarea INTO @DATA(lv_pricelist)
WHERE customer = @ls_xvbpa-kunnr
AND salesorganization = @vbak-vkorg
AND distributionchannel = @vbak-vtweg
AND division = @vbak-spart.
IF sy-subrc EQ 0 AND lv_pricelist IS NOT INITIAL.
*--* Update ShipTo's Price List type into sales order
vbkd-pltyp = lv_pricelist.
ENDIF.
ENDIF.
SAP Solution Architect | 16+ Years' Experience in SAP | Sharing Practical SAP Knowledge | Engineering Graduate with Expertise in SAP Architecture
https://fiowelt.com