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

How to post goods issues using WS_DELIVERY_UPDATE_2

Former Member
0 Likes
11,075

I will appreciate if any one could help me in this matter. I am automating the process of updating deliveries , confirming orders and posting good issues. I am using the fm WS_DELIVERY_UPDATE_2 successfuly to do the first two task, but it wont post the good issues. Can any one help. Thanks a lot.

Teo

1 ACCEPTED SOLUTION
Read only

vyende
Active Participant
5,619

I used FM CSO_P_DLVRY_GOODS_ISSUE_CREATE instead to specifically PGI.

5 REPLIES 5
Read only

vyende
Active Participant
5,620

I used FM CSO_P_DLVRY_GOODS_ISSUE_CREATE instead to specifically PGI.

Read only

Former Member
5,619

Hi,

use the FM WS_DELIVERY_UPDATE to post the goods issue..

Check this code.

PARAMETERS: p_vbeln LIKE likp-vbeln.

DATA: vbkok_wa TYPE vbkok.

vbkok_wa-vbeln_vl = p_vbeln.

vbkok_wa-wabuc = 'X'.

DATA: v_error.

CALL FUNCTION 'WS_DELIVERY_UPDATE'

EXPORTING

vbkok_wa = vbkok_wa

delivery = t_created-document_numb

IMPORTING

ef_error_in_goods_issue_0 = v_error.

COMMIT WORK.

Thanks,

Naren

Read only

petra_just
Active Participant
0 Likes
5,619

It was not working for either, then I added vbkok_wa-wabuc = 'X'. and it has posted the Goods issue.

thank you for the sample coding.

Read only

0 Likes
5,619

Hi I had similar requirement but the actual goods issue date was not posted and its blank.

please help to resolve the issue

Read only

0 Likes
5,619

I've used the below code for Actual GI Date. You can use it:

L_VBKOK-VBTYP_VL = 'J'.
L_VBKOK-VBELN = L_VBKOK-VBELN_VL = LF_VBELN. "DELIVERY NUMBER
L_VBKOK-WADAT_IST = WADAT. "Actual Goods Movement Date Imported by USER

WA_VERKO-OBJECT = '01'.
WA_VERKO-OBJKEY = LF_VBELN.

APPEND: WA_VERKO TO L_VERKO.

REFRESH I_LIPS.

SELECT * FROM LIPS INTO TABLE I_LIPS WHERE VBELN = LF_VBELN. "DELIVERY NUMBER

CLEAR I_VBPOK.

LOOP AT I_LIPS INTO WA_LIPS.
WA_VBPOK-VBELN_VL = WA_LIPS-VBELN."Delivery
WA_VBPOK-POSNR_VL = WA_LIPS-POSNR."Delivery Item
WA_VBPOK-POSNN = WA_LIPS-POSNR."Delivery Item
WA_VBPOK-VBELN = WA_LIPS-VBELN."Pick Order
WA_VBPOK-VBTYP_N = 'Q'.
WA_VBPOK-PIKMG = WA_LIPS-LFIMG.
WA_VBPOK-MEINS = WA_LIPS-MEINS.
WA_VBPOK-CHARG = WA_LIPS-CHARG.
WA_VBPOK-MATNR = WA_LIPS-MATNR.
WA_VBPOK-WERKS = WA_LIPS-WERKS.
APPEND WA_VBPOK TO I_VBPOK.
ENDLOOP.

CALL FUNCTION 'WS_DELIVERY_UPDATE_2'
EXPORTING
VBKOK_WA = L_VBKOK
SYNCHRON = ''
NO_MESSAGES_UPDATE_1 = ' '
COMMIT = 'X'
DELIVERY = LF_VBELN "DELIVERY NUMBER
UPDATE_PICKING = 'X'
NICHT_SPERREN_1 = 'X'
TABLES
VBPOK_TAB = I_VBPOK
VERKO_TAB = L_VERKO
PROT = L_PROT.