Application Development 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: 

I am using BAPI BAPI_GOODSMVT_CREATE for posting of goods issue using movement type 261. I am getting following error = Order 801135 does not exist

Former Member
0 Kudos

I am using BAPI  BAPI_GOODSMVT_CREATE for posting of goods issue using movement type 261. I am getting following error = Order 801135 does not exist.

  t_gmcode-gm_code    = '03'.

   t_gmhead-pstng_date = sy-datum.

   t_gmhead-doc_date   = sy-datum.

   APPEND t_gmhead.

   LOOP AT t_final INTO w_final.

     t_item-item_text  = w_final-header_txt.

     t_item-move_type  = w_final-move_type.

*    t_item-mvt_ind    = 'F'.                                      "    F : Goods movement for production order

     t_item-plant      = w_final-plant.

     t_item-stge_loc   = w_final-stge_loc.

     CONCATENATE '00000000' w_final-material INTO g_mat.

     CONDENSE g_mat.

     t_item-material   = g_mat.

***Function block for material number conversion

*   CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'

*     EXPORTING

*       input         = t_item-material                              " 000000002804010005

*    IMPORTING

*      output        =  t_item-material                              " 2804010005

*             .

     g_erfmg = w_final-entry_qnt.

     SHIFT g_erfmg LEFT  DELETING LEADING '0'.

     t_item-entry_qnt  = g_erfmg.

*    t_item-entry_qnt  = w_final-entry_qnt.

*    t_item-entry_uom  = w_final-entry_uom.

***Conversion exit for commercial (3-char) measurement unit OUTPUT

    CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'

     EXPORTING

       input                = w_final-entry_uom

*     LANGUAGE             = SY-LANGU

    IMPORTING

      output                = t_item-entry_uom

             .

*    t_item-entry_uom  = g_erfmg.

     t_item-batch      = w_final-batch .

     t_item-orderid    = w_final-orderid.

     APPEND t_item.

     CLEAR : g_mat , w_final , g_erfmg , t_item.

   ENDLOOP.

SORT t_item BY material.

LOOP AT t_item.

   WRITE:/ t_item-item_text,

           t_item-material,

           t_item-plant,

           t_item-stge_loc,

           t_item-move_type,

           t_item-entry_qnt,

           t_item-entry_uom,

           t_item-batch,

           t_item-orderid.

ENDLOOP.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

   EXPORTING

     goodsmvt_header             = t_gmhead

     goodsmvt_code               = t_gmcode

*   TESTRUN                     = ' '

  IMPORTING

     goodsmvt_headret            = t_mthead

*    materialdocument            =  g_mat_doc

*    matdocumentyear             =  g_doc_yr

   TABLES

     goodsmvt_item               = t_item[]

*    goodsmvt_serialnumber       = t_gmsn

     return                      = t_errmsg[]

           .

1 ACCEPTED SOLUTION

JL23
Active Contributor
0 Kudos

Does it exist like you have entered it or does it as well need leading zeros?

5 REPLIES 5

JL23
Active Contributor
0 Kudos

Does it exist like you have entered it or does it as well need leading zeros?

Former Member
0 Kudos

Hi Juergen L

the order no 801135 is already exist.


Former Member
0 Kudos

i am uploading below file having 5 line items for same order 801135. from here i am getting the material number.

Hdr Textmvt typePlantSto LocMaterialQtyUnEBatchOrder No
Prod Issue DEV2615110PH0128040100050.2MTDOM-C801135
Prod Issue DEV2615110PH0128040100050.4MTDOM-C801135
Prod Issue DEV2615110PH0128040100050.55MTDOM-C801135
Prod Issue DEV2615110PH0128040100060.66MTDOM-C801135
Prod Issue DEV2615110PH0128040100060.67MTDOM-C801135

JL23
Active Contributor
0 Kudos

My order numbers have leading zeros.

Just use SE16N for table AUFK and check yours.

Don't forget to press CTRL+F12 and put a check mark in the box for "Display without conversion exit"

Former Member
0 Kudos

Hi Juergan L,

Thank you so much for your support.

Now its working fine.