2005 Aug 18 2:01 PM
Hi All,
I have the records in the following pattern.
Key Record
REC_KEY1 CLASS1 CHAR1 CHAR_VALUE1
CHAR2 CHAR_VALUE2
CLASS2 CHAR3 CHAR_VALUE1
CHAR4 CHAR_VALUE4
REC_KEY2 CLASS3 CHAR1 CHAR_VALUE1
CLASS4 CHAR1 CHAR_VALUE1
REC_KEY3 SPACE SPACE
All these records are in a Single file. I have LSMW Structure as
KEY
--- CLASS |
___ CHAR
is there any way i can split the Above file and keep KEY VAlUE in Both the files and populate the LSMW Recorrs ? I know the way to use record identifier. Trying to use the way with Multiple fiels, One for Header with Key Value and 2nd with CLASS and CAHR Values. Please Help !!
Thanks In Advace
Kalso
2005 Aug 18 2:09 PM
Hello,
If I understood your requirement correctly this is the solution.
Follow these steps for processing multiple records in lsmw.
I presume that you have one header line and multiple line items in the file and has a unique identifier. Let us say you have two nodes in lsmw called VBAK and VBAP.
Normally lsmw process one line of the file at a time. When lsmw reads the header line, process the VBAK node and use the 'transfer_record' command (this must be already there). When the second record is processed and if the unique identifier is same as the header then write a command called 'skip_record' in the '__BEGIN_OF_RECORD__' session of VBAK. If you do like this we will have one header and multiple line items.
Thanks
Vinod
Hi All,
I have the records in the following pattern.
Key Record
REC_KEY1 CLASS1 CHAR1 CHAR_VALUE1
CHAR2 CHAR_VALUE2
CLASS2 CHAR3 CHAR_VALUE1
CHAR4 CHAR_VALUE4
REC_KEY2 CLASS3 CHAR1 CHAR_VALUE1
CLASS4 CHAR1 CHAR_VALUE1
REC_KEY3 SPACE SPACE
All these records are in a Single file. I have LSMW Structure as
KEY
--- CLASS |
___ CHAR
is there any way i can split the Above file and keep KEY VAlUE in Both the files and populate the LSMW Recorrs ? I know the way to use record identifier. Trying to use the way with Multiple fiels, One for Header with Key Value and 2nd with CLASS and CAHR Values. Please Help !!
Thanks In Advace
Kalso
2005 Aug 18 2:09 PM
Hello,
If I understood your requirement correctly this is the solution.
Follow these steps for processing multiple records in lsmw.
I presume that you have one header line and multiple line items in the file and has a unique identifier. Let us say you have two nodes in lsmw called VBAK and VBAP.
Normally lsmw process one line of the file at a time. When lsmw reads the header line, process the VBAK node and use the 'transfer_record' command (this must be already there). When the second record is processed and if the unique identifier is same as the header then write a command called 'skip_record' in the '__BEGIN_OF_RECORD__' session of VBAK. If you do like this we will have one header and multiple line items.
Thanks
Vinod
2005 Aug 18 2:26 PM
Thanks for Quick reply Vinod.
I have header record in One file and Item records in another file, with Key same ( Sales Order #) .
Do i have to still use identifier ? Do i have to write any code for this kind too ?
2005 Aug 18 2:42 PM
As far as I know you cannot have two source files at the same time. I think you need to merge both the files items after header, then use my logic.
Kindly assign points if the answers were helpful.
2005 Aug 18 3:50 PM
Hi!
You can define two files in 'specify files'. In next step 'assign files' you can assign file1 to header structure and file2 to positions structure(s).
With your common key a 'loop where' should work.
Regards,
Christian
2005 Aug 18 4:47 PM
Thanks Christian, You are right, the loop works automatically. I Figured out a way for the file structure. thanks for the help.
The first file is in the following format
KEY1 XXXX XXXXXXXXXX
KEY2 XXXX XXXXXXXXXXX
Second file
KEY1 CLASS1 CHAR1 CHAR_VALUE1
KEY1 CLASS2 CHAR2 CHAR_VALUE2
KEY2 CLASS3 CHAR1 CHAR_VALUE1
KEY2 CLASS2 CHAR2 CHAR_VALUE2
KEY3 CLASS3 CHAR1 CHAR_VALUE1
KEY4 CLASS2 CHAR2 CHAR_VALUE2
LSMW Looped Internally
2006 Dec 04 8:12 PM
What version of SAP you have used ? Its not allowing me to use multiple files in ECC 6.0. If there is any other setting to be done, please do let me know.
Thanks
Ramgopal
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |