on 09-01-2021 8:26 PM
Hi,
We are trying to automate some process in EWM and need to post GR for Inbound delivery for Production order. We have used following methods in the sequence but we are not able to post GR. We are also not receiving any error. If you can assist in what we may be missing here. Thanks!
/scwm/cl_goods_movement=>/scwm/if_gm_dlv~cleanup( ).
DATA(lv_gmcat) = CONV /scdl/dl_doccat( 'GR' ).
DATA(lt_dlv) = VALUE /scwm/dlv_docid_item_tab(
( docid = ls_docid-docid
doccat = ls_docid-doccat ) ).
/scwm/cl_goods_movement=>/scwm/if_gm_dlv~post_dlv(
EXPORTING
it_dlv = lt_dlv
iv_gmcat = lv_gmcat
* iv_post_part =
iv_keep_data = abap_true
IMPORTING
eo_message = DATA(lo_message) ).
IF lo_message IS BOUND.
DATA(lt_message) = lo_message->get_messages( ).
IF line_exists( lt_message[ msgty = 'S' ] ).
CLEAR lt_message.
FREE lo_message.
/scwm/cl_goods_movement=>/scwm/if_gm_dlv~save_gm(
IMPORTING
eo_message = lo_message ).
IF lo_message IS BOUND.
lt_message = lo_message->get_messages( ).
ENDIF. " IF lo_message IS BOUND
COMMIT WORK.
ENDIF. " IF line_exists( lt_message[ msgty = 'S' ] )
ENDIF. " IF lo_message IS BOUND
CATCH cx_root INTO DATA(lo_root).
ENDTRY.
For EWM use the standard PPF for the GR. if you need some custom logic as like only for prouduction order , implement a custom start sequence and implement the badi in it .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.