Skip to Content
author's profile photo Former Member
Former Member

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

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[]

.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Aug 22, 2016 at 12:01 PM

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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.