2009 May 04 10:58 AM
we have done a lsmw for xk15 condition maintainance.
we are using Program Name RV14BTCI.
we need to update the scales also in this.
we have one source structure defined.
we have the flat file like
KSCHL KOTABNR vkorg KDGRP KUNNR KONDM BONUS KBETR DATAB DATBI KSTBM KBETR1
ZMS1 780 IN01 10 7652309209 05 06 100 20090501 20090501 10 100.
Right now we are having flat file like the above all in a single line.
if we want to update the multiple scale line items for one entry how to do this.
do we need to change the file format? please suggest the solution
2009 May 04 1:27 PM
you need to create 2 strcture
1 is main data you have to some mandatory fields
2 is scale data.
strcture1 : MAIN DATA
Fileds:
IDENT
KSCHL
strcture2 : SCALE DATA
Fileds:
IDENT
KSCHL KOTABNR vkorg KDGRP KUNNR KONDM BONUS KBETR DATAB DATBI KSTBM KBETR1
in lsmw treat like ABAP program
here IDENT is key filed your main data IDENT is 10, and your SCALE data you have to pass Multiple IDENT like
10---> ZMS1 780 IN01 10 7652309209 05 06 100 20090501 20090501 10 100.
10---> ZMS2 780 IN01 10 7652309209 05 06 100 20090501 20090501 10 100.
10---> ZMS3 780 IN01 10 7652309209 05 06 100 20090501 20090501 10 100.
20---> ZMS4 780 IN01 10 7652309209 05 06 100 20090501 20090501 10 100.
20---> ZMS5 780 IN01 10 7652309209 05 06 100 20090501 20090501 10 100.
2009 May 05 4:59 AM
Hi Ramesh,
To upload hierarchical data with Header and Line items there are two ways:
1. Single Source File:
In this case you need to add a field at the very begining of each row as an identifier for the record. For ex: You can have "H" as an identifier for Header data & "I" as an identifier for item data.
So the source file would be like this
H <Field1> <field2> ....
I <FIELD1> <FIELD2> ....
I <FIELD1> <FIELD2>
-
-
H <F1> <F2>
I <F1> <F2>
I <F1> <F2>
---
In this case you need to define your source structure in LSMW as Item Node under the Header Node and both of them having first field as an identifier.
While assigning source file to target structure assign same source file to both header node and item node.
2. Two Source Files: One for Header & One for Item
In this case first file will contain the header data and second file will contain the item data for header records. The first field of item file should contain the key field of header file so as to associate records with its parent record.
Ex:
Header file
1000 text1 text2
2000 text1 text2 .
Then the corresponding item file will be
1000 10 itemtext1 itemtext2
1000 20 itemtext1 itemtext2
1000 30 itemtext1 itemtext2
1000 40 itemtext1 itemtext2
2000 10 itemtext1 itemtext2
2000 20 itemtext1 itemtext2
2000 30 itemtext1 itemtext2
Now while defining the source str in LSMW you will define two nodes at the same level for Header and Item.
While assigning source file to target structure assign header source file to header node and item source file to Item node.
Thanks,
Abhishek