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: 

how to pass business header data through BAPI while creating sales Order

krishna_k19
Contributor
0 Kudos

Dear All,

    I'm creating sales order through -- /AFS/BAPI_SALESORD_CREATEFDATA -- BAPI , but i'm not able find the field business header data. Actually while creating manually i'm able to enter the data but through BAPI not able to find through which field i've to pass the data. I tried to pass the data through "ORDER_HEADER_IN" table but its not appearing..

Please find the attachment.

kindly help me..

Regards,

Krishna

10 REPLIES 10

Former Member
0 Kudos

Hi Krishna,

Use BAPI 'BAPI_SALESORDER_CREATEFROMDAT1' for creation of sales order where u can pass all header values for creation of SO. For more details check in SE37 for the BAPI FM.

Regards,

Amol P

0 Kudos

Hi Amol ,

        that BAPI contains Sales header & item data, but actually what i require is in VA01 screen Business data / Texts here i want to pass the data. for these pls guide the path..

Rgds,

Krishna

Abhijit74
Active Contributor
0 Kudos

Hello,

Lots of threads available for this . Please search before posting.

Thanks,

Abhijit

0 Kudos

Dear Abhijit,

        i didn't find any thread for this bapi-/AFS/BAPI_SALESORD_CREATEFDATA , through this bapi we can pass the data byusing the "ORDER_HEADER_IN" this table only , here i'm passing the data its not appearing.

can you having any related to this post pls share the links..

Regards,

Krishna

Former Member
0 Kudos

Hello Krishna, the Business data you are looking for is in ORDER_ITEMS_OUT table. Check it.

Abhijit74
Active Contributor
0 Kudos

Hello Krishna,

I'm sorry.. I have not see the AFS part otherwise you should have  BAPI_SALESORDER_CREATEFROMDAT2.

Thanks,

Abhijit

0 Kudos

Hi Sumanth,

       like that table(ORDER_ITEMS_OUT) is not present in that bapi..

Rgds,

krishna

Former Member
0 Kudos

Hello Krishna,

I am not sure I understood you problem, but when using /AFS/BAPI_SALESORD_CREATEFDATA you should;

  • pass header data by structure order_header_in: remember to put an "X" in the corresponding field of the structure order_header_inx for any input you decide to put in the order_header_in
  • dont't forget the business_object
  • append the order_partners table to put the sold-to-party and other partners (from KNVP db table)
  • append the order_items_in and corresponding order_items_inx form any item you need to order
  • you may need the order_schedules_in and corresponding order_schedules_inx and the conditions within order_conditions_in table.

As far as you put this data the bapi works fine.

Let us know if this helps solve your problem! 

Former Member
0 Kudos

hi krishna,

i saw your dicussion's for '/AFS/BAPI_SALESORD_CREATEFDATA',

facing probelm for passing data to bapi,

can u help as this needs to be done in very short span of time.

Thanks & Regards,

Sudheer.M

0 Kudos

Hi Sudheer,

 

            TEXT-TEXT_ID = '0001'. " Header Text.
*          TEXT-ITM_NUMBER = L_CNTR.
          TEXT-LANGU = 'EN'.
          TEXT-TEXT_LINE = WA_DATA1-TEXT_LINE."'BAPISDTEXT'.
          APPEND TEXT.

   CALL FUNCTION '/AFS/BAPI_SALESORD_CREATEFDATA'
          EXPORTING
*           SALESDOCUMENTIN               =
            ORDER_HEADER_IN               = V_VA01_HEADER
*            ORDER_HEADER_INX              = ORDER_HEADER_INX
         IMPORTING
           SALESDOCUMENT                 = SALESDOCUMENT
          TABLES
           RETURN                        = IT_RETURN2
           ORDER_ITEMS_IN                = IT_VA01_ITEMS
           ORDER_ITEMS_INX               = ORDER_ITEMS_INX
           ORDER_SCHEDULES_IN            = IT_VA01_SCHDS
*           ORDER_SCHEDULES_INX           =
            ORDER_PARTNERS                = IT_VA01_PARTN
           ORDER_CONDITIONS_IN           = COND
*           ORDER_CFGS_REF                =
*           ORDER_CFGS_INST               =
*           ORDER_CFGS_PART_OF            =
*           ORDER_CFGS_VALUE              =
*           ORDER_CFGS_BLOB               =
*           ORDER_CFGS_VK                 =
*           ORDER_CFGS_REFINST            =
           ORDER_CCARD                   = IT_BAPICCARD[]
           ORDER_TEXT                    = TEXT
*           ORDER_KEYS                    =
           EXTENSIONIN                   = BAPIPAREX
*           PARTNERADDRESSES              = BAPIADDR1

Pass the order text as a header then you will get the data there.

Thanks & regards,

Krishna


                  .