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

BAPI_GOODSMVT_CREATE

Former Member
0 Likes
2,637

Hi

I'm trying to execute the bapi BAPI_GOODSMVT_CREATE.

When i execute i get the following message:

-Enter a scope of list

-IMSEG-WAERS initial v., currency amount 639,9200 in AMOUNT_LC was transferred without a currency

So i probably have to fill the IMSEG-waers field. But i don't know how i integrate that in the bapi.

 
            "goodsmvt_header
            gv_header-pstng_date = sy-datum.

            "goodsmvt_code
            gv_code-gm_code = '03'.

            "goodsmvt_item
            gv_item-stge_loc = p_reloc.
            gv_item-costcenter = p_costc.
            gv_item-move_type = '202'.
            gv_item-material = gv_pp_material.

            "get quantity in stock keeping unit (ATK)
            "-> SKU of pp material
            SELECT SINGLE * INTO gv_mara
              FROM mara
              WHERE matnr = gv_pp_material.

            " get issued batch quantity
            SELECT SINGLE * INTO gv_mseg
              FROM mseg
              WHERE mblnr = gv_matdoc
                AND mjahr = gv_docyear
                AND zeile = '0001'.

            " get conversion numbers
            SELECT SINGLE * INTO gv_marm
            FROM marm
            WHERE matnr = gv_pp_material
              AND meinh = gv_mseg-erfme.

            "calculate quantity (converted)
            gv_item-entry_qnt = gv_mseg-erfmg * gv_marm-umrez / gv_marm-umren.
            gv_item-amount_lc = gv_mseg-dmbtr.
*                              = gv_mseg-waers.
            gv_item-entry_uom = gv_mara-meins.
            gv_item-no_more_gr = 'X'.
            APPEND gv_item TO gt_item.

            CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
              EXPORTING
                goodsmvt_header               = gv_header
                goodsmvt_code                 = gv_code
*              testrun                       = 'X'
*           GOODSMVT_REF_EWM              =
*         IMPORTING
*           GOODSMVT_HEADRET              =
*           MATERIALDOCUMENT              =
*           MATDOCUMENTYEAR               =
              TABLES
                goodsmvt_item                 = gt_item
*           GOODSMVT_SERIALNUMBER         =
                return                        = gt_return
*           GOODSMVT_SERV_PART_DATA       =
*           EXTENSIONIN                   =
                      .

Hopefully you can help me out. <removed by moderator>

Regards,

M.

Edited by: Thomas Zloch on Dec 5, 2011 11:13 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,320

you know what is the best part about this BADI!! this is called from MIGO as well

just keep your debugger inside this FM and create a GR with your data but from MIGO. and you can relate to all your fields.

2 REPLIES 2
Read only

Former Member
0 Likes
1,321

you know what is the best part about this BADI!! this is called from MIGO as well

just keep your debugger inside this FM and create a GR with your data but from MIGO. and you can relate to all your fields.

Read only

0 Likes
1,320

Question solved.

I forgot to add the plant to the movement item for the goods receipt.

This does the job.

Regards,

M.