2011 Dec 05 9:35 AM
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
2011 Dec 05 9:38 AM
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.
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.
2011 Dec 05 9:38 AM
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.
2011 Dec 05 9:57 AM
Question solved.
I forgot to add the plant to the movement item for the goods receipt.
This does the job.
Regards,
M.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |