cancel
Showing results for 
Search instead for 
Did you mean: 

EWM : Post GR for Inbound delivery for Production order

chiragmistry21
Explorer
0 Kudos

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.

View Entire Topic
former_member564522
Active Participant
0 Kudos

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 .