Application Development and Automation 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: 
Read only

LSMW using BAPI for Purchase Contracts

Former Member
0 Likes
1,121

Hi experts,

I have to create an LSMW using a BAPI for Purchase Documents (BUS2014)!

I have found the BAPI, have identified that it will most likely fulfill my requirement but I am stuck at how I should define my input file.

I have the headers, the line items, scale values for conditions and also split cost centers.

Should I define different files for these? If so, what should I use as the key for the scale values for example? Each contract can contain various materials, each material can contain multiple scale values...

Does anyone have an example of this?

Any help is highly appreciated!

Thanks!

Fernanda

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
851

Hi,

Use separate files for each structure. Use any key as a link between different structures.

We faced such scenarios in many of our objects. For example, for Inspection plan below sequence of fields we used as link:

Header: PLNNR

Material data: PLNNR (since material data is at header level, only PLNNR is key field)

Item: PLNNR, VORNR (VORNR is the line item number to identify unique key)

Item text: PLNNR, VORNR (VORNR is the line item number to identify unique key)

Similarly in your case decide which fields you would like to make as key. Some  times we use a key field just to match this sequence and never use for upload. And also the same sequence has to be maintained in source structures. And in your data file the file has to start with above fields followed by other fields.

Its a bit tricky. But I tried to simplify as much as possible.

Please let me know in case of any questions.

Regards,

Revanth

2 REPLIES 2
Read only

Former Member
Read only

Former Member
0 Likes
852

Hi,

Use separate files for each structure. Use any key as a link between different structures.

We faced such scenarios in many of our objects. For example, for Inspection plan below sequence of fields we used as link:

Header: PLNNR

Material data: PLNNR (since material data is at header level, only PLNNR is key field)

Item: PLNNR, VORNR (VORNR is the line item number to identify unique key)

Item text: PLNNR, VORNR (VORNR is the line item number to identify unique key)

Similarly in your case decide which fields you would like to make as key. Some  times we use a key field just to match this sequence and never use for upload. And also the same sequence has to be maintained in source structures. And in your data file the file has to start with above fields followed by other fields.

Its a bit tricky. But I tried to simplify as much as possible.

Please let me know in case of any questions.

Regards,

Revanth