03-26-2009 4:23 AM
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
03-26-2009 4:33 AM
Use WS_DELIVERY_UPDATE there is an exporting parameter to which u need 2 pass 'X'.
03-26-2009 4:28 AM
03-26-2009 4:33 AM
Use WS_DELIVERY_UPDATE there is an exporting parameter to which u need 2 pass 'X'.
03-26-2009 4:50 AM
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
01-10-2023 8:16 PM
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.