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: 

Generate log after executing LSMW

sameer_mehta
Participant
0 Kudos

Hi,

I am using LSMW for creating new customers from the refrence customers. My problem is that I want to generate an file which will show me the customer number generated and its reference customer number. How can I do this plz help.

Thanks

1 ACCEPTED SOLUTION

JL23
Active Contributor
0 Kudos

it depends on your import method (LSMW step 1) if you can get it directly from LSWM as a log or not.

E.g. for recordings and batch inputs, the new number will not be known in LSMW. processing the batch input can be done from SM35, this is not really part of LSMW, just an embedded functionality.

if you use IDOC method to create new customers, then you have to have the new customer number already in the conversion step, as you cannot create customers with IDOC without having the customer number in the IDOC.

Because of this you have to include a function module NUMBER_GET_NEXT to determine an internal number already in the conversion step.

At that moment you know old an new number and can just add a write statement to display the releation ship in a log

2 REPLIES 2

ThomasZloch
Active Contributor
0 Kudos

Internal or external numbering for customer master data?

External: the relation is already known during "convert data" step, you can add a few lines of code to write that information in a list or into a file.

Internal: The new number is only known at the end of all processing. You could fill the reference number in a separate field of the customer master data, then just pull a SE16 list for the relevant table (likely KNA1 or KNB1) and fields once everything is done.

Thomas

JL23
Active Contributor
0 Kudos

it depends on your import method (LSMW step 1) if you can get it directly from LSWM as a log or not.

E.g. for recordings and batch inputs, the new number will not be known in LSMW. processing the batch input can be done from SM35, this is not really part of LSMW, just an embedded functionality.

if you use IDOC method to create new customers, then you have to have the new customer number already in the conversion step, as you cannot create customers with IDOC without having the customer number in the IDOC.

Because of this you have to include a function module NUMBER_GET_NEXT to determine an internal number already in the conversion step.

At that moment you know old an new number and can just add a write statement to display the releation ship in a log