Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create Delivery

Former Member
0 Likes
643

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
585

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.

4 REPLIES 4
Read only

Former Member
0 Likes
585

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'.

Read only

Former Member
0 Likes
586

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.

Read only

0 Likes
585

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.

Read only

Former Member
0 Likes
585

yes..