cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

EWM : Post GR for Inbound delivery for Production order

chiragmistry21
Explorer
0 Likes
1,954

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.

Accepted Solutions (0)

Answers (4)

Answers (4)

yaping_wang2
Active Participant
0 Likes

SAP standard PPF can be differentiated from Production order GR and other GR. Production Order GR default is mapped to IRM document type. PPF can set by document type level.

former_member564522
Active Participant
0 Likes

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 .

0 Likes

why not use the standard PPF "/SCWM/PDI_02_GR_POST"? why custom code?

MohdRKhan
Active Contributor
0 Likes

Dear Chirag

It is not easy to tell by seeing code. Could analyse debug while processing with the help of abap. if possible so please post the screen shot and step.

Regards