Application Development and Automation 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: 
Read only

Urgent! BAPI_GOODSMVT_CREATE does not create doument flow

Former Member
0 Likes
1,731

Hello,

I am creating a material document in reference to an inbound delivery using BAPI_GOODSMVT_CREATE. The material document is posted successfully. The GR Slip is also issued. But no document flow is created between the material document --> and Inbound delivery. Below is the code :

gt_bapigm_head-pstng_date = sy-datum.

gt_bapigm_head-pr_uname = sy-uname.

gt_bapigm_head-ver_gr_gi_slip = '1'.

gt_bapigm_head-ver_gr_gi_slipx = 'X'.

gt_bapigm_code-gm_code = '01'.

LOOP AT ptab.

gt_bapigm_item-move_type = '101'.

gt_bapigm_item-mvt_ind = 'B'.

gt_bapigm_item-deliv_numb_to_search = ptab-vbeln. "Inbound delivery

gt_bapigm_item-deliv_item_to_search = ptab-posnr. "Inbound delivery line item

gt_bapigm_item-entry_qnt = ptab-lfimg.

gt_bapigm_item-entry_uom = ptab-vrkme.

APPEND gt_bapigm_item.

CLEAR gt_bapigm_item.

ENDLOOP.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

goodsmvt_header = gt_bapigm_head

goodsmvt_code = gt_bapigm_code

  • TESTRUN = ' '

IMPORTING

goodsmvt_headret = gt_bapigm_headret

materialdocument = gt_materialdocument

matdocumentyear = gt_matdocumentyear

TABLES

goodsmvt_item = gt_bapigm_item

  • GOODSMVT_SERIALNUMBER =

return = gt_bapigm_ret

Please let me know if there is a parameter that I have missed out, or the next steps required to get the document flow. Thank you in advance.

Divya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,595

Hi,

MIGO transaction is used for creating Material Document. It uses MB_CREATE_GOODS_MOVEMENT and MB_POST_GOODS_MOVEMENT to create the material document internally.

You can check whether the document flow is being taken care by MIGO transaction or not?

regards,

Gaurav

Hello,

I am creating a material document in reference to an inbound delivery using BAPI_GOODSMVT_CREATE. The material document is posted successfully. The GR Slip is also issued. But no document flow is created between the material document --> and Inbound delivery. Below is the code :

gt_bapigm_head-pstng_date = sy-datum.

gt_bapigm_head-pr_uname = sy-uname.

gt_bapigm_head-ver_gr_gi_slip = '1'.

gt_bapigm_head-ver_gr_gi_slipx = 'X'.

gt_bapigm_code-gm_code = '01'.

LOOP AT ptab.

gt_bapigm_item-move_type = '101'.

gt_bapigm_item-mvt_ind = 'B'.

gt_bapigm_item-deliv_numb_to_search = ptab-vbeln. "Inbound delivery

gt_bapigm_item-deliv_item_to_search = ptab-posnr. "Inbound delivery line item

gt_bapigm_item-entry_qnt = ptab-lfimg.

gt_bapigm_item-entry_uom = ptab-vrkme.

APPEND gt_bapigm_item.

CLEAR gt_bapigm_item.

ENDLOOP.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

goodsmvt_header = gt_bapigm_head

goodsmvt_code = gt_bapigm_code

  • TESTRUN = ' '

IMPORTING

goodsmvt_headret = gt_bapigm_headret

materialdocument = gt_materialdocument

matdocumentyear = gt_matdocumentyear

TABLES

goodsmvt_item = gt_bapigm_item

  • GOODSMVT_SERIALNUMBER =

return = gt_bapigm_ret

Please let me know if there is a parameter that I have missed out, or the next steps required to get the document flow. Thank you in advance.

Divya

11 REPLIES 11
Read only

Former Member
0 Likes
1,595

I found that BAPI_GOODSMVT_CREATE does not have the functionality to create the document flow. Does anyone have an idea of how this functionality can be accomplished?

Read only

Former Member
0 Likes
1,595

Hi,

Try with this FM:QMLR_CREATE_DOCUMENT_FLOW.

Hope it works,

Thanks,

Sandeep.

Read only

0 Likes
1,595

This doesn't work.

Read only

0 Likes
1,595

Hi,

If you are currently using the SAP system then please goto SE37 and give DOCUMENTFLOW* and press F4.

It will show you the list of FM's related to document flow.Please check the one which is most appropriate for your scenario.

Hope it is useful,

Thanks,

Sandeep.

Read only

Former Member
0 Likes
1,596

Hi,

MIGO transaction is used for creating Material Document. It uses MB_CREATE_GOODS_MOVEMENT and MB_POST_GOODS_MOVEMENT to create the material document internally.

You can check whether the document flow is being taken care by MIGO transaction or not?

regards,

Gaurav

Read only

0 Likes
1,595

Yes, through MIGO the posting is correct. But, I am trying to develop this for a RF transaction. Do you know the parameters required for MB_CREATE_GOODS_MOVEMENT to reference it to an inbound delivery.

Read only

0 Likes
1,595

I got it. Thanks for all your replies.

Read only

0 Likes
1,595

Hi,

Please see this code. This may help.

DATA: UR_OK(1),

RS_OK(1),

BL_OK(1),

QI_OK(1).

LOOP AT I_REVIEW_LOTS.

CLEAR: UR_OK, RS_OK, BL_OK, QI_OK.

  • Build Unrestricted Stk Goods Movement/Posting transactions

IF UR_TCODE <> SPACE

AND I_REVIEW_LOTS-CLABS > 0.

CLEAR: I_IMKPF, I_IMSEG, I_EMSEG, I_EMKPF.

REFRESH: I_IMSEG, I_EMSEG.

HLD_TCODE = UR_TCODE.

HLD_BWART = UR_BWART.

I_IMKPF-BLDAT = SY-DATUM.

I_IMKPF-BUDAT = SY-DATUM.

I_IMSEG-BWART = UR_BWART.

I_IMSEG-MATNR = I_REVIEW_LOTS-MATNR.

I_IMSEG-WERKS = I_REVIEW_LOTS-WERKS.

I_IMSEG-LGORT = I_REVIEW_LOTS-LGORT.

I_IMSEG-CHARG = I_REVIEW_LOTS-CHARG.

I_IMSEG-ERFMG = I_REVIEW_LOTS-CLABS.

I_IMSEG-ERFME = I_REVIEW_LOTS-MEINS.

I_IMSEG-SGTXT = 'ZMMINVP012-AUTO SDL UNRESTRICTED STK XFER'.

I_IMSEG-UMMAT = I_REVIEW_LOTS-MATNR.

I_IMSEG-UMWRK = I_REVIEW_LOTS-WERKS.

I_IMSEG-UMLGO = I_REVIEW_LOTS-SDLOC.

I_IMSEG-UMCHA = I_REVIEW_LOTS-CHARG.

APPEND I_IMSEG.

CALL FUNCTION 'MB_CREATE_GOODS_MOVEMENT'

EXPORTING

IMKPF = I_IMKPF

XALLP = 'X'

XALLR = 'X'

CTCOD = UR_TCODE

IMPORTING

EMKPF = I_EMKPF

TABLES

EMSEG = I_EMSEG

IMSEG = I_IMSEG

EXCEPTIONS

OTHERS = 1.

HLD_SYSUBRC = SY-SUBRC.

Read only

0 Likes
1,595

Thanks. I am doing something similar, except passing Inb.Delivery and Item number as :

i_imseg-vlief_avis = ptab-vbeln.

i_imseg-vbelp_avis = ptab-posnr.

Thanks you. This query is now resolved.

Read only

0 Likes
1,595

I thought it was solved, but unfortunately the MB_* fm created the material document, but still did not create the document flow. Is there another Function module that needs to be called after the MB_POST* . Help will be appreciated.

Read only

Former Member
0 Likes
1,595

Not resolved