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 M7 036

rohit_dutta2
Explorer
0 Likes
5,237

BAPI_GOODSMV M7 T_CREATE Error M7 036

Hi, I didn´t found any solution with this problem, even with search function and in google ;).

I am using BAPI BAPI_GOODSMVT_CREATE for posting GR on PO and I always get the error: can´t post GR for purchasing order 5012134.

If I execute the BAPI with transaction SE37 it works. And if I GR with MB01 it also works but in program it doesn't.

Here is the code:

data:

L_HEAD LIKE BAPI2017_GM_HEAD_01,

L_CODE LIKE BAPI2017_GM_CODE,

L_TESTRUN LIKE BAPI2017_GM_GEN-TESTRUN,

L_MBLNR TYPE BAPI2017_GM_HEAD_RET-MAT_DOC,

L_MJAHR TYPE BAPI2017_GM_HEAD_RET-DOC_YEAR,

LT_ITEM TYPE TABLE OF BAPI2017_GM_ITEM_CREATE,

wa_item like line of LT_ITEM,

LT_RETURN TYPE TABLE OF BAPIRET2.

L_HEAD-PSTNG_DATE = sy-datum.

L_HEAD-DOC_DATE = sy-datum.

L_CODE-GM_CODE = '01'.

loop at itab.

wa_item-material = itab-matnr.

wa_item-plant = itab-werks.

wa_item-stge_loc = itab-lgort.

wa_item-move_type = '101'.

wa_item-po_number = itab-ebeln.

wa_item-po_item = itab-posnr.

wa_ITEM-MVT_IND = 'B'.

wa_ITEM-ENTRY_QNT = itab-MENGE.

append wa_item to lt_item.

endloop.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

GOODSMVT_HEADER = L_HEAD

GOODSMVT_CODE = L_CODE

TABLES

GOODSMVT_ITEM = LT_ITEM

RETURN = LT_RETURN.

.

1 ACCEPTED SOLUTION
Read only

rohit_dutta2
Explorer
0 Likes
3,107

Hello,

Thanks for all your help and sorry for the wrong information. Initially, I might have made some mistake, that is why FM and report were behaving differently.

Now, The FM and report both are giving the same error message( M7-036). This error message is coming because "GR-Bsd IV"(indicator of GR based invoice verification) checked box is checked.

Thanks,

Rohit

6 REPLIES 6
Read only

Sandra_Rossi
Active Contributor
3,107

If it works with SE37, but not in your program, provided that you run them in the exact same context, don't you think you can find the issue by yourself by carefully comparing the parameters received by BAPI_GOODSMVT_CREATE via the debugger in both cases?

Read only

rohit_dutta2
Explorer
3,107

Hello Sandra,

I am passing exactly same content in both the cases. and i have debugged, there one structure is not filling (i.e xebefu). I will try one more time from my side.

i just want to add one more information, program and function module both are working fine in development system, and TR successfully moved to quality. So, in quality system i am facing this issue. do you think, this is something relate to configuration ?

Thanks,

Rohit

Read only

Sandra_Rossi
Active Contributor
0 Likes
3,107

So, in fact, I understand that in the quality system, if you test via SE37 with the same parameters as those in your program, you'd also get the M7036 error. It would also happen with transaction code MB01, so ask the functional guys to investigate why there is this error.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,107

From where come the input data, usually when the process is correct with SE37 and not in a program, you got a wrong formatting of data (SE37 test screen will convert input data from external format to correct internal format, when your program will execute a simple move, not always converting data) could you check in debug mode?

Read only

Lakshmipathi
SAP Champion
SAP Champion
0 Likes
3,107

Have a look at OSS note 2736630

Read only

rohit_dutta2
Explorer
0 Likes
3,108

Hello,

Thanks for all your help and sorry for the wrong information. Initially, I might have made some mistake, that is why FM and report were behaving differently.

Now, The FM and report both are giving the same error message( M7-036). This error message is coming because "GR-Bsd IV"(indicator of GR based invoice verification) checked box is checked.

Thanks,

Rohit