‎2009 Nov 17 3:42 PM
Hi Experts,
I have a problem with the use of this BAPI: BAPI_GOODSMVT_CREATE
The problem is that i have this code sample in the report.
LOOP AT tg_posicion INTO sl_posicion.
.
.
.
LOOP AT tl_lotes INTO sl_lotes.
sg_goodsmvt_header-pstng_date = sg_cabecera-budat.
sg_goodsmvt_header-doc_date = sg_cabecera-bedat.
sg_goodsmvt_header-header_txt = sg_cabecera-bktxt.
begin cba 14012009
sg_goodsmvt_header-ver_gr_gi_slip = '1'.
sg_goodsmvt_header-ver_gr_gi_slipx = 'X'.
end cba 14012009
sg_goodsmvt_code-gm_code = '01'.
REFRESH gt_goodsmvt_item.
CLEAR gs_goodsmvt_item.
gs_goodsmvt_item-material = sl_posicion-matnr.
gs_goodsmvt_item-plant = sl_posicion-werks.
gs_goodsmvt_item-stge_loc = sl_posicion-lgort.
gs_goodsmvt_item-batch = sl_lotes-lote.
gs_goodsmvt_item-move_type = '101'.
gs_goodsmvt_item-vendor = sg_cabecera-lifnr.
gs_goodsmvt_item-entry_qnt = sl_posicion-conv.
gs_goodsmvt_item-entry_uom_iso = vl_isocode.
gs_goodsmvt_item-po_number = sg_cabecera-ebeln.
gs_goodsmvt_item-po_item = sl_posicion-ebelp.
gs_goodsmvt_item-mvt_ind = 'B'.
APPEND gs_goodsmvt_item TO gt_goodsmvt_item.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = sg_goodsmvt_header
goodsmvt_code = sg_goodsmvt_code
IMPORTING
goodsmvt_headret = gs_goodsmvt_headret
materialdocument = gs_materialdocument
matdocumentyear = gs_matdocumentyear
TABLES
goodsmvt_item = gt_goodsmvt_item
return = gt_return.
So far, so good.
The problem is that when i loop at the table tg_position when i want to process the second position, in the ME23N, this item, appears in the purchase order historial but in the first position.
I already debugg the program and in the parameter:
gs_goodsmvt_item-po_item = sl_posicion-ebelp.
when process the second position, it goes with a '00020'.
Does any one know why is this happening?
Please let me know if any one knows...
Thanks in advance,
Regards
Juan Quezada Calderon
ABAP Consultant
‎2009 Nov 17 4:06 PM
Hi,
Try with this..
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
exporting
input = gs_goodsmvt_item-po_item
importing
output = gs_goodsmvt_item-po_item.
Now you call your : CALL FUNCTION 'BAPI_GOODSMVT_CREATE'.
finally call this:
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
.
If it not surve your purpose revert back to me.
Anil.
Edited by: Anil Kumar Reddy on Nov 17, 2009 5:06 PM
‎2009 Nov 17 4:06 PM
Hi,
Try with this..
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
exporting
input = gs_goodsmvt_item-po_item
importing
output = gs_goodsmvt_item-po_item.
Now you call your : CALL FUNCTION 'BAPI_GOODSMVT_CREATE'.
finally call this:
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
.
If it not surve your purpose revert back to me.
Anil.
Edited by: Anil Kumar Reddy on Nov 17, 2009 5:06 PM
‎2009 Nov 18 2:33 PM
Dear Anil,
i did what you recommend me in the previous post, but the same problem still persist.
Please let me know if you know what could it be...
I still try to figure it out.
Thanks in advance.
Juan Quezada
‎2009 Nov 18 2:39 PM
‎2009 Nov 19 2:04 PM
The problem is that when i loop at the table tg_position when i want to process the second position, in the ME23N, this item, appears in the purchase order historial but in the first position.
I already debugg the program and in the parameter:
gs_goodsmvt_item-po_item = sl_posicion-ebelp.
when process the second position, it goes with a '00020'.
Does any one know why is this happening?
Please let me know if any one knows...