2008 Mar 11 5:24 PM
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
2008 Mar 12 12:31 PM
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
2008 Mar 12 11:39 AM
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?
2008 Mar 12 11:53 AM
Hi,
Try with this FM:QMLR_CREATE_DOCUMENT_FLOW.
Hope it works,
Thanks,
Sandeep.
2008 Mar 12 12:17 PM
2008 Mar 12 12:24 PM
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.
2008 Mar 12 12:31 PM
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
2008 Mar 12 12:36 PM
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.
2008 Mar 12 12:56 PM
2008 Mar 12 1:02 PM
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.
2008 Mar 12 1:06 PM
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.
2008 Mar 12 4:54 PM
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.
2008 Mar 12 4:55 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |