Skip to Content
0
Former Member
Oct 26, 2012 at 10:21 AM

How to create customers in LSMW with IDoc, multiple segments/files

463 Views

Hi,

I need to create new customers with LSMW IDoc from text file(s). I'm using standart DEBMAS (DEBMAS07, DEBM). Tricky part starts where one customer can have multiple company codes (info in child segment/2nd file).

At the moment (judging from we19) I'm stuck after place where customer is created using parent segment and first child segment, then next customer (same) creation is started with next company code (child segment data), but the parent data are not filled any more.

Maybe I have formed input files wrong, or what I'm doing wrong? My guess is I should somehow tell the program to use parent segment data for each segment, but how?

Used data:

Source Fields

CUSTOMER structure for customers

DUMMY C(010) linking field

KTOKD N(004) Number or something

NAME1 C(020) Could be name

SORT1 C(010) Sort?

CITY1 C(015) City

COUNTRY C(003) Country code

CUSTOMER_KNB1 Part of customer data

DUMMY C(010) linking field

BUKRS C(004) Company Code

AKONT C(010) Reconciliation acct

My input files look like this:

Parent segment data file

DUMMY KTOKD Name1 SORT1 CITY1 COUNTRY

1 0004 Name1 Search t test Riga LV

2 0004 Name2 Search t test Riga LV

Child segment file

DUMMY BUKRS AKONT

1 LV77 231000

1 MARA 230000

1 MARC 230000

2 MARA 230000

2 MARC 230000

P.S. It is something close to problem described in http://scn.sap.com/thread/2067417#10767533 but I didn't get it there, I'm a bit new to SAP.