2010 Dec 08 6:51 AM
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.
2010 Dec 08 6:53 AM
Hi
What does the return table gets filled with for the BAPI??? That is required to analyse the problem.
Vishwa.
2010 Dec 08 7:02 AM
It contains one row data.
The error message is "Unit of measure BSM is not convertible to stockkeeping unit ST"
What should ı do?
2010 Dec 08 7:33 AM
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.
2010 Dec 08 7:36 AM
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
2010 Dec 08 7:39 AM
What is the name of the function module. How to find it. SOrry, Im new to ABAP:(
2010 Dec 08 7:45 AM
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.
2010 Dec 08 7:48 AM
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
2010 Dec 08 7:58 AM
Paste your dump here!!
You are surely passing something wrong!!!
Also are you doing this commit work twice?
2010 Dec 08 8:07 AM
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.
2010 Dec 08 8:14 AM
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.
2010 Dec 08 8:37 AM
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