Application Development 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: 

Post Goods Issue for Outbound delivery return

Former Member
0 Kudos

Hi, I'm trying to Post a Goods Issue for a returned outbound delivery but I cannot find a function module to do this, I tried using SD_DELIVERY_UPDATE_PICKING but its creating the material against the outbound delivery with status archived, which means it wasn't created.

I also tried using the MB_CREATE_GOODS_MOVEMENT, but this one is creating the material document but not updating the status and the document flow of the delivery.

Thanks,

Pablo

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Use WS_DELIVERY_UPDATE there is an exporting parameter to which u need 2 pass 'X'.

4 REPLIES 4

Former Member
0 Kudos

Hi Lopez,

Regards,

Sravanthi

Former Member
0 Kudos

Use WS_DELIVERY_UPDATE there is an exporting parameter to which u need 2 pass 'X'.

0 Kudos

Thanks for that vijetasap!

That solved my problem, WS_DELIVERY_UPDATE posted the goods issue by only setting field WABUC to "X" in structure VBKOK_WA.

As my outbound delivery is a RETURN document type, I have to change the document category to "M" in field VBKOK_WA-VBTYP_VL.

Thanks,

Pablo

heterocigoto
Participant
0 Kudos

According with the Standard code on LM66 it could be do it in this way:

You can call this subroutine from your code, passing your Ebeln number.

FORM post_delivery  USING lv_ebeln TYPE char10
CHANGING ch_error TYPE flag.

DATA: vbkok LIKE vbkok,
prot LIKE prott OCCURS 0 WITH HEADER LINE.
DATA: lin TYPE p.

vbkok-vbeln_vl = lv_ebeln.
vbkok-wabuc = 'X'.

CLEAR prot.
REFRESH prot.


CALL FUNCTION 'HU_PACKING_REFRESH'.

CALL FUNCTION 'LE_DELIVERY_REFRESH_BUFFER' "v_n_841001
EXPORTING
if_vbeln = lv_ebeln
EXCEPTIONS
no_key_specified = 1
OTHERS = 2. "^_n_841001

*.......Post delivery,update document flow....................
CALL FUNCTION 'WS_DELIVERY_UPDATE_2'
EXPORTING
vbkok_wa = vbkok
delivery = lv_ebeln
commit = 'X'
TABLES
prot = prot
EXCEPTIONS
error_message = 99.

IF sy-subrc <> 0.

MESSAGE s000(zmm) WITH 'Something went wrong!' DISPLAY LIKE 'E'.
ch_error = 'X'.

ENDIF.

ENDFORM.