‎2007 Jan 30 4:32 PM
Hi everyone,
I am using a BAPI_GOODSMVT_CREATE and I got the following error in RETURN[]:
"Batch 85000007 RN02 3000 0000002024 does not exist"
The code is below:
CLEAR ITAB_ITEM_BAPI.
Itens
MOVE V_MATERIAL TO ITAB_ITEM_BAPI-material. "85000007
MOVE V_WERKS TO ITAB_ITEM_BAPI-plant. "RN02
MOVE V_DEP TO ITAB_ITEM_BAPI-stge_loc. "3000
MOVE CN_TIPO_MOV TO ITAB_ITEM_BAPI-move_type. "261
MOVE V_PESO TO ITAB_ITEM_BAPI-entry_qnt.
MOVE P_AUFNR TO ITAB_ITEM_BAPI-orderid.
MOVE V_LOTE TO itab_item_bapi-batch. "0000002024
Translate itab_item_bapi-entry_uom to the logon language
PERFORM BUSCA_UNIDADE_MEDIDA USING 'TN'
CHANGING itab_item_bapi-entry_uom.
APPEND ITAB_ITEM_BAPI.
CONSTANTS: cl_gm_code TYPE bapi2017_gm_code VALUE '03'.
Header
t_goodsmvt_header-pstng_date = sy-datum.
t_goodsmvt_header-doc_date = sy-datum.
t_goodsmvt_header-pr_uname = sy-uname.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = t_goodsmvt_header
goodsmvt_code = cl_gm_code
IMPORTING
materialdocument = vl_doc_material
matdocumentyear = vl_doc_ano
TABLES
goodsmvt_item = itab_item_bapi
return = t_return.
This is error is happening just for one material. Most of materials I tried it worked fine!
Did anyone have the same problem or know how to fix it?
Thanks in advance,
Raphael
‎2007 Jan 31 2:49 PM
Hi Raphael,
Check <b>MCH1</b> table whether <b>Batch</b> exist against that <b>material</b> or not .
Regards,
Balavardhan.K
‎2007 Jan 31 2:49 PM
Hi Raphael,
Check <b>MCH1</b> table whether <b>Batch</b> exist against that <b>material</b> or not .
Regards,
Balavardhan.K
‎2007 Jan 31 4:43 PM
Hi K,
It sounds strange, because I checked MCH1 and was there.
So I asked the consultant for another material to test. I start to think there is nothing wrong with the way I'm using the BAPI.
Thanks anyway,
Raphael
‎2007 Feb 01 5:45 AM
Hi Raphael,
Check <b>MCHB</b> table , pass <b>Material, Plant, Storage Location and Batch.</b> and see whether entry is there or not.
Regards,
Balavardhan.K
‎2007 Feb 01 5:48 AM
You right Raphael. The code writen is perfectly fine. The problem is in data maintained. It is the Functional persons issue!
‎2007 Feb 01 1:18 PM
Actually it was a problem with the material.
With another one it works perfectly.
Anyway, thanks for the help!