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: 

Uploading of PO Details using LSMW

Former Member
0 Kudos

Hi Experts,

I am trying to upload PO details in order to create PO using u2018LSMW with recording methodu2019.

Here are the following concerns

u2022 I want to create each PO with more than one line item. However, the object which I have created is creating a PO for each line item. Can you please let me know where exactly I need to keep the loop.

u2022 u2018LSMW with recording methodu2019 is the right option to do that or do we need to use u2018LSMW with IDOC methodu2019. Please suggest me.

Regards,

Murthy.

5 REPLIES 5

JL23
Active Contributor
0 Kudos

recording is only recommended to be used if no standard import method (standard batch / direct input, IDOC, BAPI) is given.

recordings are static, while many transactions have some dynamic situations.

However, recording can work too.

I guess you have a source file, and SAP creates a new PO for any record in the source file.

So you have to tell SAP when to write only records and when to execute the transaction.

Assuming you want one PO per vendor, then you should sort your source file already by vendor before you read it into SAP

Much better would be to have the header data in one source and the item data in a second source, as SAP can then determine automatically when to transfer transaction.

It would create a seperate PO for each record in the header table, while all corresponding records in the item table just become items to a PO.

if you have just one source file with on line that has info for header and item data, then you have to do some coding to tell SAP when a new PO is to be created. (e.g. when the vendor number changes)

Former Member
0 Kudos

Hi,

Yes, I have a source file, and SAP is creating a new PO for every record in source file. Can you please eleborate what does it mean 'You have to tell SAP When to write only records and when to execute the transaction.'

I have created the header data in one source system and the item data in a second source. However the recording is creating only one target structure and I am assigning the target structure to header source. What about Item data source.

I have only one source file which is having both header and item data with an indicator 'H' saying Header data and 'Blank' as Item data. Can you please tell me where should code exactly to tell SAP when a new PO is to be created.

Regards,

Murthy.

Former Member
0 Kudos

You have to choose LSMW with IDOC method or BAPI method and need to seperate your file into 2 file

1 Header data

2 item data

JL23
Active Contributor
0 Kudos

>

> I have created the header data in one source system and the item data in a second source. However the recording is creating only one target structure and I am assigning the target structure to header source. What about Item data source.

>

> I have only one source file which is having both header and item data with an indicator 'H' saying Header data and 'Blank' as Item data. Can you please tell me where should code exactly to tell SAP when a new PO is to be created.

> Regards,

> Murthy.

This preparation of the source is already pretty good.

Now you describe this source structure in LSMW:

choose step Maintain source structures in LSMW

Choose Create structure.

A dialog box appears.

Enter the name and description of the source structure (this shall become the header level)

Choose Continue.

The LSM Workbench: Source structures screen appears again. The structure you created is displayed.

create an additional structure now. When you create additional structures, a dialog box with query "Same level/subordinated" appears. choose subordinated for your item lines.

Next you define the fields for each structure.

follow this instruction:

http://help.sap.com/saphelp_nw70/helpdata/en/76/a05b78e8a411d1b400006094b944c8/content.htm

Keep an eye at the Identifying field content, because here you tell SAP how to know which line of your source file has header data and which one has item data. In other words: Here you enter the "H" that you find in the first field of your source that defines that this line is header data.

When SAP reads a line with a H it will add the record as header data, if it dont, then it is item data.

Former Member
0 Kudos

Hi,

It is better to use header and item file for this scenario. You can use Business object-BUS2012, Method-CREATEFROMDATA1, Message Type- PORDCR1 and Basic Type-PORDCR101.

Hope this answers yoyur question.