Skip to Content
avatar image
Former Member

BAPI_SALESORDER_CREATEFROMDAT2

I have requirement that when purchase order is created. I have to automatically create sales order in ECC System. My problem is when i pass data to BAPI(BAPI_SALESORDER_CREATEFROMDAT2). The Output comes blank no error message. Please help me.

Thanks,

Arun

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 30, 2013 at 02:54 PM

    Check the RETURN table in the BAPI for any messages.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Sales Document type TA is fine. It is the output version of order type OR. The error related to partners might be due to you are not sending ship to information in the table ORDER_PARTNERS. Try passing Ship to along with Sold to as  same number as sold to ( Ship to  PARTN_ROLE  = 'WE' ).

  • Apr 30, 2013 at 03:20 PM

    Hi Arun,

          can you plz post your code............so that you get the solution..

    thanks and regards,

    narayan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      i passed data to order_header_inx and item, schedule. Also i did  order_header_in-doc_type= 'TA'. But now i am getting

      Error : Sales order was not changed

      Error : No customer master record exists for customer 0

      Thanks,

      Arun

  • Apr 30, 2013 at 02:12 PM

    Hi,

    Have you used BAPI_TRANSACTION_COMMIT after the BAPI_SALESORDER_CREATEFROMDAT2.

    Regards,

    Prakash.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      I searched the net and found some info about (BAPI_TRANSACTION_COMMIT)and applied it. But i am still getting blank.

      Is this how to use it.

          call function 'BAPI_TRANSACTION_COMMIT'
         exporting
           wait          = 'X'.

      Thanks,

      Arun

  • avatar image
    Former Member
    Apr 30, 2013 at 03:04 PM

    Hi,

    after the FM BAPI_SALESORDER_CREATEFROMDAT2

    you can submit this FM in this way:

          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.

    Regards

    Ivan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 02, 2013 at 09:32 AM

    HI All,

    Thanks for the support. Solved the issue.

    Thanks,

    Arun

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 02, 2013 at 09:46 AM

    Hi,

    Still you did not get nay solution then try to execute the BAPI manually(SE37) and check the return messages.

    Regards,

    Shaiksha Vali.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 02, 2013 at 10:39 AM

    Hello Arun,

    BAPI performs a functionality of a transaction or some part of functionality of transaction where data can be posted/created without user continuous interaction or without screens.

    I would suggest you if you are planning to use a BAPI, then understand the functionality:

    You may go through the documentation completely, identify the transaction which is used for same process and interpret the same by using it or provide inputs to it. You will have better and proper understanding of the functionality and will come to know mandatory fields, the different error messages you would get. In your case try using transaction VA01 and check it out.

    Also in BAPI's mostly for creation/change of data or some document, you need to pass flags such as 'X' or 'U' or 'I' for it to be executed completely in tables ending with X eg.order_header_inx[].

    Hope it is helpful in some way.

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded