‎2008 Jun 19 8:54 PM
Hi Friends,
We need to create a delivery with reference to a sales order (Inbound and outbound) , But the picking Qty also needs to be updated in the delivery at the time of creation. Is ther any function module to do this (I am trying to use RV_DELIVER_CREATE but is not working) or can we upadte the picking qty during the delivery save is user exit, if so then what fields do we need to update.
Please suggest me.
Thanks
Sunny.
‎2008 Jun 19 9:09 PM
Hi
Generally, after creating delivery only picking packing activity takes place. U can create delivery and after that u can update the pick quantity. U can either use a bdc also for doing this.
Venkat.
‎2008 Jun 19 8:56 PM
Hey, check this example:
REPORT ZOUT_DELIVPICK.
tables:VBFA, LIKP, LIPS.
DATA : WA_VBKOK LIKE VBKOK.
parameters vbeln like VBFA-vbeln.
*select-options: posnr for VBFA-POSNv.
DATA : I_VBPOK LIKE VBPOK OCCURS 0 WITH HEADER LINE.
DATA : I_PROT LIKE PROTT OCCURS 0 WITH HEADER LINE.
data:begin of it_items occurs 0,
posnr like vbfa-posnv,
PIKMG like VBPOK-PIKMG,
end of it_items.
START-OF-SELECTION.
it_items-posnr = 000010.
it_items-PIKMG = '1.000'.
append it_items.
it_items-posnr = 000020.
it_items-PIKMG = '2.000'.
append it_items.
it_items-posnr = 000040.
it_items-PIKMG = '3.000'.
append it_items.
loop at it_items.
WA_VBKOK-VBELN_VL = vbeln.
SELECT SINGLE * FROM LIKP WHERE VBELN = VBELN.
MOVE-CORRESPONDING LIKP TO WA_VBKOK.
SELECT SINGLE * FROM VBFA WHERE VBELV = vbeln.
IF SY-SUBRC = 0.
WA_VBKOK-VBELN = VBFA-VBELN. " Sales and distribution document
ENDIF.
Fill the item level
I_VBPOK-VBELN_VL = vbeln.
I_VBPOK-POSNR_VL = it_items-posnr.
SELECT SINGLE * FROM LIPS WHERE VBELN = vbeln AND
POSNR = I_VBPOK-POSNR_VL.
SELECT SINGLE * FROM VBFA WHERE VBELV = I_VBPOK-VBELN_VL AND
POSNV = I_VBPOK-POSNR_VL.
I_VBPOK-vbtyp_n = 'Q'.
I_VBPOK-meins = 'EA'.
I_VBPOK-VRKME = 'EA'.
I_VBPOK-taqui = 'X'.
I_VBPOK-orpos = 0.
MOVE-CORRESPONDING LIPS TO I_VBPOK.
IF SY-SUBRC = 0.
I_VBPOK-VBELN = VBFA-VBELn. " Sales and distribution document
I_VBPOK-POSNN = VBFA-POSNn. " Item of an SD document
I_VBPOK-VBTYP_N = VBFA-VBTYP_N. " Document category
ENDIF.
I_VBPOK-PIKMG = it_items-PIKMG.
I_VBPOK-LFIMG = it_items-PIKMG.
I_VBPOK-LGMNG = it_items-PIKMG.
APPEND I_VBPOK.
endloop.
CALL FUNCTION 'SD_DELIVERY_UPDATE_PICKING'
EXPORTING
VBKOK_WA = WA_VBKOK
SYNCHRON = 'X'
NO_MESSAGES_UPDATE = SPACE
nicht_sperren = 'X'
AUFRUFER_T = 'X'
IF_ERROR_MESSAGES_SEND = ' '
TABLES
VBPOK_TAB = I_VBPOK
PROT = I_PROT.
if sy-subrc = 0.
COMMIT WORK.
WRITE:/ 'success'.
else.
write:/ 'not success'.
‎2008 Jun 19 9:09 PM
Hi
Generally, after creating delivery only picking packing activity takes place. U can create delivery and after that u can update the pick quantity. U can either use a bdc also for doing this.
Venkat.
‎2008 Jun 20 8:23 PM
Thanks for the reponse
I need to update the picking Quanity value at the time of delivery creation, Is this possible to write using the user exit ?
If possible what are the fields in need to update for this.
Thanks
Sunny.
‎2009 Jul 31 3:56 PM