‎2007 Oct 03 12:43 AM
hi all,
i need a function module to do a goods receipt for the PO using
movement type 161,
movement ind B,
goodsmvt code '01'.
i couldnt able to post using BAPI_GOODSMVT_CREATE as iam getting
'NO GOODS RECEIPT POSSIBLE FOR PO XXXXXXXX XXXXX'.
So is there any function module other than bapi to do a goodsmvt with my requirements.
Thanks in advance,
Prem.
‎2007 Oct 03 1:11 AM
Hi Prem,
You should use this BAPI only. there must be some wrong data you provided.
Just check with your functional and give the correct data and try.
Regards,
Atish
‎2007 Oct 03 1:24 AM
hi,
the code i use is,
loop at gt_final into gs_wa_final.
gt_item-move_type = '161'.
gt_item-entry_uom = gs_wa_final-meins.
gt_item-stge_loc = gs_wa_final-lgort.
gt_item-entry_qnt = gs_wa_final-menge.
gt_item-entry_uom_iso = gs_wa_final-meins.
gt_header-ref_doc_no = gs_wa_final-submi.
gt_item-base_uom = gs_wa_final-meins.
gt_header-doc_date = gv_last_date.
gt_header-pstng_date = sy-datum.
gt_item-ind_propose_quanx = 'X'.
gt_item-serialno_auto_numberassignment = 'X'.
gt_item-material = gs_wa_final-matnr.
gt_item-plant = gs_wa_final-werks.
gt_item-po_number = gs_wa_final-ebeln.
gt_item-po_item = gs_wa_final-ebelp.
gt_item-mvt_ind = 'B'.
append gt_item.
clear gt_item.
*call bapi goodsmvt create to do the gr
set update task local.
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gt_header
goodsmvt_code = gt_bapigm_code
importing
goodsmvt_headret = gs_headret
tables
goodsmvt_item = gt_item
goodsmvt_serialnumber = gt_serialno
return = gt_return.
call bapi_transaction_commit to commit if success
if gt_return-type <> 'E'.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
else.
call function 'BAPI_TRANSACTION_ROLLBACK'.
endif.
After executing iam getting an error mess in gt_return[]
'NO GOODS RECEIPT POSSIBLE FOR PO XXXXXXXXXX XXXXX'
i cant understand y the function module is returning this error message,
can any one help me in this issue,
Thanks in adavance,
Prem.
‎2007 Oct 03 1:34 AM
Hi Prem,
Are you able to create GR using normal transaction for the same data?
Regards,
Atish
‎2007 Oct 03 1:42 AM
‎2007 Oct 03 2:10 AM
check below link. It has sample progem for GR. Just compare and see what you might be missing.
http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm
Regards,
Atish