cancel
Showing results for 
Search instead for 
Did you mean: 

LSMW to create customer in multiple sales area

Former Member
0 Kudos

Hi,

I want to create customer in different sales area with one file using lsmw. I have created a lsmw to create

customer in one sales are.

Structure of my file

CC1 - SO1-GD

CC2 - SO2-GD

Is there a way to create these 2 lines for one customer ?

Accepted Solutions (0)

Answers (1)

Answers (1)

JL23
Active Contributor
0 Kudos

you did not really tell much: "I have created a lsmw"  - this is as good as saying I build a house, it is not clear whether it is a block house, a bungalow  or a skyscraper.

LSMW has 4 different import methods, and the most logical would be IDOC or batch input as these are flexible SAP given import methods. Which one did you use?


Further it is not clear whether the customer already exists and only needs to be extended, or if the customer has to be created with the first record and extended to another sales org with the second record.


It is as well not clear if one line in your source has all info or if GD is one line, CC another and SO again another line.


Former Member
0 Kudos

Hi Jürgen , thanks for your reply.

1- I have used batch input

2-the customer has to be created with the first line and extended with the other lines.

3-  The structure of my file is :

1st line : company codedata 1 , Sales area data 1 , customerA 's old number , general dataA,

2nd line : company codedata2, Sales orga 2, customerA 's old number , general dataA

3rd line : company codedata3, Sales orga 3, customerA 's old number , general dataA

4th line : company codedata 1 , Sales area data 1 , customerB 's old number , general dataB,

5th line : company codedata2, Sales orga 2, customerB 's old number , general dataB

....

The customer old number can help for the extension ?

JL23
Active Contributor
0 Kudos

You need to get the general data fields to the left.

You either do this already in the source file and then define your fields in step 3 of LSMW in the new sequence of the source file.

Or, you keep the source as is, but define the fields in step 3 of LSMW  in the sequence of GD - CC - SO . You make sure that the column header of the source file is identical to the field names in your step 3.  In step 7 specify files you need to remove the flag for "Field order matches source file definition". SAP will then use the names to find the fields when you execute step 9 Read data.

this re-order of information will help you avoid too much ABAP.

Still you need a small ABAP command in step 5 field mapping.

You need to replace the default command "transfer_record" with "on_change_transfer_record".

I have an example in my blog

This command takes care that the General data is only written when the GD  in source changes, which means after the 3rd line.