05-02-2012 2:38 PM
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.
05-03-2012 6:40 AM
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.
05-02-2012 6:47 PM
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.
05-03-2012 6:40 AM
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.
05-03-2012 12:33 PM
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?
05-03-2012 1:01 PM
05-03-2012 1:07 PM