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

How to add items to a sales order by BAPI

Hi to all .

I have created an order with BAPI_SALESORDER_CREATEFROMDAT2 , now i have to add some position to an existing open order .

How i have to proced ?

Wich bapi must i use ???

THANKS

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Feb 08, 2005 at 11:51 AM

    what about BAPI_SALESORDER_CHANGE... ?

    kr, achim

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Achim Hauck

      I have tryed to add the third position to an order , but

      it doesn't work .

      i have tried to fill the bapi structures like this :

      ORDER_ITEMS_IN3-ITM_NUMBER = '000300'.

      ORDER_ITEMS_IN3-MATERIAL = 'M000590000'.

      APPEND ORDER_ITEMS_IN3.

      ORDER_ITEM_INX-ITM_NUMBER = '000300'.

      ORDER_ITEM_INX-UPDATEFLAG = 'I'.

      APPEND ORDER_ITEM_INX.

      SCHEDULE_LINES-REQ_QTY = 1.

      SCHEDULE_LINES-SCHED_LINE = 1.

      SCHEDULE_LINES-ITM_NUMBER = '000300'.

      SCHEDULE_LINES-REQ_DATE = SY-DATUM.

      APPEND SCHEDULE_LINES.

      SCHEDULE_LINESX-ITM_NUMBER = '000300'.

      SCHEDULE_LINESX-SCHED_LINE = 1.

      SCHEDULE_LINESX-UPDATEFLAG = 'I'.

      APPEND SCHEDULE_LINESX.

      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

      EXPORTING

      SALESDOCUMENT = ORDER_NUMBER

      ORDER_HEADER_IN = ORDER_HEADER_IN

      ORDER_HEADER_INX = ORDER_HEADER_INX

      • SIMULATION =

      • BEHAVE_WHEN_ERROR = ' '

      • INT_NUMBER_ASSIGNMENT = ' '

      • LOGIC_SWITCH =

      TABLES

      RETURN = TAB_RETURN

      ORDER_ITEM_IN = ORDER_ITEMS_IN3

      ORDER_ITEM_INX = ORDER_ITEM_INX

      • PARTNERS =

      • PARTNERCHANGES =

      • PARTNERADDRESSES =

      • ORDER_CFGS_REF =

      • ORDER_CFGS_INST =

      • ORDER_CFGS_PART_OF =

      • ORDER_CFGS_VALUE =

      • ORDER_CFGS_BLOB =

      • ORDER_CFGS_VK =

      • ORDER_CFGS_REFINST =

      SCHEDULE_LINES = SCHEDULE_LINES

      SCHEDULE_LINESX = SCHEDULE_LINESX

      • ORDER_TEXT =

      • ORDER_KEYS =

      • CONDITIONS_IN =

      • CONDITIONS_INX =

      • EXTENSIONIN =

      .

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

      But in retunr message structures i have an error that say :

      ERROR IN SALES ITEM IN 300 . . .

  • author's profile photo Former Member
    Former Member
    Posted on Feb 09, 2005 at 02:00 PM

    I believe for every field in a structure that you put a value into, you need to put an 'X' into the corresponding field in the X structure. For example, you have structure ORDER_ITEMS_IN3 and the corresponding structure ORDER_ITEM_INX. Because you did:

     ORDER_ITEMS_IN3-MATERIAL = 'M000590000'.

    You need to do:

     ORDER_ITEMS_INX-MATERIAL = 'X'.

    The same applies to SCHEDULE_LINES. Because you did:

    SCHEDULE_LINES-REQ_DATE = SY-DATUM.

    You need to do:

    SCHEDULE_LINESX-REQ_DATE = 'X'.

    Brian

    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.