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
1,308

Hi gurus,

I have a problem. I m using the BAPI_GOODSMVT_CREATE bapi but it is not working. What may be the problem?

call function 'BAPI_GOODSMVT_CREATE'

exporting

goodsmvt_header = gs_goodsmvt_header

goodsmvt_code = gs_goodsmvt_code

importing

goodsmvt_headret = gs_goodsmvt_headret

tables

goodsmvt_item = gt_goodsmvt_item

return = gt_return.

clear : lv_hata.

loop at gt_return into gv_return.

if gv_return-type eq 'E'.

lv_hata = 'X'.

endif.

endloop.

if lv_hata is initial.

call function 'BAPI_TRANSACTION_COMMIT'

exporting

wait = 'X'

importing

return = bapi_return2.

endif.

My codes like this. Thanks in advance.

11 REPLIES 11
Read only

Former Member
0 Likes
1,226

Hi

What does the return table gets filled with for the BAPI??? That is required to analyse the problem.

Vishwa.

Read only

0 Likes
1,226

It contains one row data.

The error message is "Unit of measure BSM is not convertible to stockkeeping unit ST"

What should ı do?

Read only

0 Likes
1,226

Now, ıt doenst contain any row but a short dump occurs.

UNEXPEXTED COMMIT WORK. I m using a bapi. I have to use commit work. thanks in advance.

Read only

Former Member
0 Likes
1,226

There is a conversion routine ( Function Module) for UOM field, which is avaliable in the domain of the the field (Ex. MEINS), i.e BMS is stored as ST in the database.

Use these conversion routine ( Function Module) before updating it or assinging it .

Regards

Bhanu

Read only

0 Likes
1,226

What is the name of the function module. How to find it. SOrry, Im new to ABAP:(

Read only

0 Likes
1,226

There should be conversion routines available for your fields.

I am not sure what are you using , i used the below F.M and code to convert the UOM to SAP format.

hi,

first convert the quantity in the same unit ( like in you case BMS to ST ) by using FM : MD_CONVERT_MATERIAL_UNIT

CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'

EXPORTING

i_matnr = matnr

i_in_me = entry_uom (BMS)

i_out_me = out_uom

i_menge = quantity

IMPORTING

E_MENGE = fp_l_v_quant

EXCEPTIONS

ERROR_IN_APPLICATION = 1

ERROR = 2

OTHERS = 3.

IF sy-subrc 0.

give error message here

ENDIF.

Read only

0 Likes
1,226

Firstly, thanks for your very helpful answer. Now I got that error. I mean my return table is empty. However, I get short dump.

İt says you cannot use BAPI_TRANSACTION_COMMIT it is unexpected. What may be the problem?

Edited by: OSMANBIYIK on Dec 8, 2010 8:50 AM

Read only

0 Likes
1,226

Paste your dump here!!

You are surely passing something wrong!!!

Also are you doing this commit work twice?

Read only

0 Likes
1,226

UNEXPECTED COMMIT WORK

THERE SHOULD BE NO COMMIT WORK in order processing before

fm CO_ZV_ORDER_POST was executeed, since this might lead to inconsitencies!!

MESSAGE ID C2 type lv_msg_type number 295.

No ım not commiting work twice.

Read only

0 Likes
1,226

Problem here is that you might be using F.M CO_ZV_ORDER_POST somewhere which has exporting para commit_flag now,

when you process your BAPI before this commit work is called.

Read only

0 Likes
1,226

I tried this- I mean ı m not using that fm still nothing

any further ideas?

regards

Edited by: OSMANBIYIK on Dec 8, 2010 9:41 AM