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: 

Creating Sales order Using 'BAPI_SALESORDER_CREATEFROMDAT2'

Former Member
0 Kudos

Dear ABAPers,

I want to create the Sales order Using the BAPI 'BAPI_SALESORDER_CREATEFROMDAT2'.

Sales order is Repair order.When i create the First line item of the Sales order it internally generates

the Second line item.In configuration Functional Consultant Designed in such a way that it should generate

the Sub item for the First line item.

When i create the Sales order using the Transaction code VA01 it generates the Second line item i.e

sub item for the First line item.Can anyone explain me how to do this using BAPI.

Thanks & Regards,

Ashok.

5 REPLIES 5

Former Member
0 Kudos

Hi,

The BAPI will use the same configuration as VA01 so you should just pass the one line item and the sub items will be automatically generated.

Darren

0 Kudos

Hi Darren,

Thank you very much for your reply.

I can able to create the Main line item and Sub line item using bapi.But i am missing some fields and link between the main line item and sub line item.

Here i give you what all are the Fields i am missing in the Second line item while i am creating the Sales order through BAPI.

What i did is that i created one Sales order in the Transaction VA01 and I created another Sales order Using BAPI.I compared both the Sales order in VBAP Table.I found some fields are missing in the Sales order which is created via BAPI.

The Fields are

VKGRU is missing

POSNV is 10000 in Sales order which is created using VA01 and 10100 in the Sales order Which is created using BAPI.

STLNR is missing

KMPMG is missing

ANZSN is missing

UEPVW is missing

If you need any more information feel free to revert back to me.

Thanks & Regards,

Ashok.

0 Kudos

Dear ABAPers,

My Question is not answered

Thanks & Regards,

Ashok.

Former Member
0 Kudos

Hi,

You have configurable item. You must enter the configuration data in the ORDER_CFGS_REF, ORDER_CFGS_INST, ORDER_CFGS_PART_OF and ORDER_CFGS_VALUE tables.

Check out for OSS note 93091 as well.

Regds,

Rudra

naveen_inuganti2
Active Contributor
0 Kudos

Hi...

What ever Darren told is correct. This BAPI can supply license and service materials if you provide configured materials.

http://www.sap-img.com/abap/bapi-salesorder-createfromdat2.htm

Thanks,

Naveen.I