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 error

Former Member
0 Likes
1,879

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

1 ACCEPTED SOLUTION
Read only

Former Member
1,093

Hi Raphael,

Check <b>MCH1</b> table whether <b>Batch</b> exist against that <b>material</b> or not .

Regards,

Balavardhan.K

5 REPLIES 5
Read only

Former Member
1,094

Hi Raphael,

Check <b>MCH1</b> table whether <b>Batch</b> exist against that <b>material</b> or not .

Regards,

Balavardhan.K

Read only

0 Likes
1,093

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

Read only

0 Likes
1,093

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

Read only

0 Likes
1,093

You right Raphael. The code writen is perfectly fine. The problem is in data maintained. It is the Functional persons issue!

Read only

0 Likes
1,093

Actually it was a problem with the material.

With another one it works perfectly.

Anyway, thanks for the help!