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

No order items exist in order

Former Member
0 Likes
1,919

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


1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,179

Check following thread Rich Heilman expalin very well

http://scn.sap.com/thread/123453

Check the following WIKI document :

http://wiki.sdn.sap.com/wiki/display/ABAP/Sample+code+BAPI_GOODSMVT_CREATE

4 REPLIES 4
Read only

former_member189779
Active Contributor
0 Likes
1,179

Make sure your material number has leading zeros.

Also read the FM documentation:

For 2 GM_Code 02: Goods receipt for production order

It is very well explained.

Read only

Former Member
0 Likes
1,180

Check following thread Rich Heilman expalin very well

http://scn.sap.com/thread/123453

Check the following WIKI document :

http://wiki.sdn.sap.com/wiki/display/ABAP/Sample+code+BAPI_GOODSMVT_CREATE

Read only

0 Likes
1,179

The program is written as in the link and the mandatory parameters maintained correctly. Still it throws the same error, as well as i am using "261" movement type in the BAPI, can you give some sample code for this.

Read only

0 Likes
1,179

Can anyone abaper help me on this issue, i am fed up with this problem.

Expecting your kind reply.

*...Position/en lesen
   PERFORM position_read TABLES xpos_tab USING subrc xrfrsh.
   IF NOT subrc IS INITIAL.
     MESSAGE e006 WITH caufv-aufnr RAISING not_found_any.
   ENDIF.

The above code returns sy-msgno = 006 and CHECK global_error = false becomes true

and the corresponding document is not posted. PERFORM mb_post_goods_movement failed in the bapi BAPI_GOODSMVT_CREATE.

Please advise me.