Skip to Content
0
Former Member
May 03, 2012 at 01:24 PM

No order items exist in order

341 Views

Hi Experts

I am doing goods issue MB1B with reference to the Maintanenece ORDER.

By using BAPI_ALM_ORDER_GET_DETAIL, getting the order details data and using BAPI_GOODSMVT_CREATE to post the material document.

Using the below code, and getting the error 'No order items exist in order'. Please correct me where i am making error.

Thanks in advance.

wa_goodsmvt_header-pstng_date = sy-datum.

wa_goodsmvt_header-doc_date = sy-datum.

wa_goodsmvt_header-ref_doc_no = wa_aufnr.

wa_goodsmvt_code-gm_code = '03'. "Goods receipt for purchase Order
it_goodsmvt_item-stge_loc = wt_table-sloc1.
it_goodsmvt_item-plant = wa_header-plant.
it_goodsmvt_item-move_type = '261'.
it_goodsmvt_item-entry_qnt = wt_table-qty1.
it_goodsmvt_item-mvt_ind = 'F'.
it_goodsmvt_item-orderid = wa_aufnr.
it_goodsmvt_item-reserv_no = wa_item-reserv_no.
it_goodsmvt_item-res_item = wa_item-res_item.
* it_goodsmvt_item-order_itno = wa_item-order_item_number.
it_goodsmvt_item-material = wt_table-mat.
APPEND it_goodsmvt_item.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = wa_goodsmvt_header
goodsmvt_code = wa_goodsmvt_code
IMPORTING
materialdocument = wa_bapi2017_gm_head
TABLES
goodsmvt_item = it_goodsmvt_item
return = it_return.

Regards

Rajaram