10-11-2007 12:07 PM
Hi All,
I have a requirement to map the information from SO to Inbound Delivery based on the PO# available in inbound delivery. Following fields will have to be updated in the Inbound delivery to be created, before saving. (SAP standard program SAPMV50A transaction VL31n - Create inbound delivery)
Following check should be first performed:
IF LIKP-VBTYP = 7 and LIKP LFART = ZL, then (if the delivery is a delivery shipping notification)
For LIPS-VGBEL = EKKN-EBELN (to retrieve the Purchase order related to the delivery)
LIPS VGPOS = EKKN-EBELP
For the Purchase order find the related Sales order (header and items)
EKKN-VBELN = VBAK- VBELN = VBAP -VBELN
EKKN-VBELP = VBAK- POSNR = VBAP - POSNR
Copy following data from Sales order header to Delivery header
VBAK VKORG to LIKP VKORG Sales organization
VBAK - AUTLF to LIKP AUTLF - Complete delivery flag
VBAK VSBED to LIKP- VSBED - Shipping condition
Copy Ship to party and Sold-to-party from Sales order partners to Delivery header
For VBAK VBELN = VBPA VBELN and VBPA PARVW = WE
=> Copy VBPA PARTNER to LIKP KUNNR
For VBAK VBELN = VBPA VBELN and VBPA PARVW = AG
=> Copy VBPA PARTNER to LIKP KUNAG\
Copy Incoterms data from VBKD to Delivery header
For VBAK VBELN = VBKD VBELN
 Copy VBKD INCO1 to LIKP INCO1
 Copy VBKD INCO2 to LIKP INCO2
Please guide me in which method of this BADI LE_SHP_DELIVERY_PROC to be used. Also if possible, write simple code how to do it.
Thanks in advance.
Arundhathi
10-11-2007 2:00 PM
Hi Arundhathi,
Just go for this method : SAVE_DOCUMENT_PREPARE
In this method all strucutes available in chnaging parameters , u can validate and also change.Just play around it .
Regards,
Madhu
10-11-2007 2:00 PM
Hi Arundhathi,
Just go for this method : SAVE_DOCUMENT_PREPARE
In this method all strucutes available in chnaging parameters , u can validate and also change.Just play around it .
Regards,
Madhu
10-11-2007 2:07 PM
Hi Madhu,
Thank you for the response.
By setting the break-points, I had found that SAVE_DOCUMENT_PREPARE works for my requirement.
But in order to map the header fields, where do i get the VBAK fields?
Arundhathi