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: 

BAPI_SALESORDER_CREATEFROMDAT2 and VBKD-BSTKD

Former Member
0 Kudos

Hello everyone,

I'm using the BAPI BAPI_SALESORDER_CREATEFROMDAT2 to create a sales order but there is something I'm not sure to understand. Is the VBKD table modified into the BAPI with the insertion of a line related to the created sales order? (So far, my researches told me that it is indeed fed in the BAPI)

If so, what is the part influencing the field BSTKD in the table? Is that one of the parameters that I am sending or is it generated by the BAPI itself? I'm not sure to find out what makes it change.

Thank you in advance for your answers.

1 ACCEPTED SOLUTION

former_member182040
Active Contributor
0 Kudos

pass parameter like :

ORDER_HEADER_IN-purch_no_c = itab-BSTKD.
     

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

        EXPORTING

       ORDER_HEADER_IN               = ORDER_HEADER_IN

IMPORTING

       SALESDOCUMENT                 = SALESDOCUMENT

       TABLES

       RETURN                                 = RETURN

       ORDER_ITEMS_IN                  = ORDER_ITEMS_IN

       ORDER_PARTNERS               = ORDER_PARTNERS

       ORDER_SCHEDULES_IN       = ORDER_SCHEDULES_IN.

5 REPLIES 5

Former Member
0 Kudos

Hi Sylvain,

To be honest, I have very little experience with BAPIs.  However, I believe the BSTKD is the customer's P. O. number and it should be present in the data fed into the BAPI.  I think this corresponds to the PURCH_NO_C in the ORDER_HEADER_IN structure.  There is also a PURCH_NO_C field in the ORDER_ITEMS_IN structure as well.  I hope this helps.

former_member182040
Active Contributor
0 Kudos

pass parameter like :

ORDER_HEADER_IN-purch_no_c = itab-BSTKD.
     

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

        EXPORTING

       ORDER_HEADER_IN               = ORDER_HEADER_IN

IMPORTING

       SALESDOCUMENT                 = SALESDOCUMENT

       TABLES

       RETURN                                 = RETURN

       ORDER_ITEMS_IN                  = ORDER_ITEMS_IN

       ORDER_PARTNERS               = ORDER_PARTNERS

       ORDER_SCHEDULES_IN       = ORDER_SCHEDULES_IN.

0 Kudos

Thank you Krupa and Jamie for your answers. They are very helpful. I hope you don't mind a complementary question though. Something I should have asked with the initial question...

If I decide to not feed ORDER_HEADER_IN-purch_no_c, is there only the BSTKD field in table VBKD that is affected or will I mess up something else elsewhere?

In other words, is the ORDER_HEADER_IN-purch_no_c used to feed data elsewhere?

0 Kudos

only affected BSTKD

0 Kudos

Thank you very much for the info!