08-29-2013 4:11 PM
Hi,
I want to load multipl texts in XD01 with one ligne of my text file.
I created a LSMW in IDOC with Debmass - Debmass07.
I met a problem with two structures : E1KNA1H (with TDID) and E1KNA1L (with TDLINE). I need to create in maximum 4 texts (TDLINE) with 4 differents ID (TDID).
I created a counter for TDID which i executed 4 times :
structure E1KNA1H :
If counter = 1.
E1KNA1H-TDID = 'xxxx'.
ENDIF.
If counter = 2.
E1KNA1H-TDID = 'xxx1'.
ENDIF.
[...]
structure : E1KNA1L
If E1KNA1H-TDID = 'xxxx'.
E1KNA1L-TDLINE = MYTXTFILE-TDLINE.
ENDIF.
If E1KNA1H-TDID = 'xxx1'.
E1KNA1L-TDLINE = MYTXTFILE-TDLINE1.
ENDIF.
If E1KNA1H-TDID = 'xxx2'.
E1KNA1L-TDLINE = MYTXTFILE-TDLINE2.
ENDIF.
If E1KNA1H-TDID = 'xxx3'.
E1KNA1L-TDLINE = MYTXTFILE-TDLINE3.
ENDIF.
The problem was the two structure don't run in the same time so i always load the last text (TDLINE3) because my counter got 4 when the second structure start....
Any ideas ?
Ty.
08-29-2013 11:09 PM
I'm sure it is possible. I have similar challenges with my migrations.
But to give the right guidance I would need some more info, especially about your source file and its structure.
e..g if you have just one line in your source file and want make 4 from it
or if you have four lines in the source.
if you have multiple sources or just one.
I would already say that a counter is probably not needed at all.
Maybe you could add some screenshots
08-30-2013 9:40 AM
I think it is possible but for the moment i don't know how...
You can see my structure and my text file in attachment.
It's not an obligation to use counter but i have no idea to do without him.
You'r understand, i want to make 4 texts, in maximum, with one line of my textfile (so for one customer).
I have just one source.
08-30-2013 9:57 AM
remove any own coding from E1KNA1H, just do the mapping for the first occurance
then go to the __END_OF_RECORD__ of E1KNA1H and add this coding after the transfer record statement
E1KNA1H-TDID = 'xxx1'.
transfer_this_record 'E1KNA1H'.
E1KNA1L-TDLINE = MYTXTFILE-TDLINE1.
transfer_record.
E1KNA1H-TDID = 'xxx2'.
transfer_this_record 'E1KNA1H'.
E1KNA1L-TDLINE = MYTXTFILE-TDLINE2.
transfer_record.
E1KNA1H-TDID = 'xxx3'.
transfer_this_record 'E1KNA1H'.
E1KNA1L-TDLINE = MYTXTFILE-TDLINE3.
transfer_record.
this means you had just submitted a record for the first text header and a record for the first line.
after this you need to submit another text header with the second text ID follow by the line for the second text ID, then again the text header for next ID etc etc.
08-30-2013 10:25 AM
I don't understand what's you means by:
Jürgen L wrote:
[...]
this means you had just submitted a record for the first text header and a record for the first line.
after this you need to submit another text header with the second text ID follow by the line for the second text ID, then again the text header for next ID etc etc.
I'm sorry but i'm begginer in ABAP.
So if i understand i delete my coding in the mapping of TDID ? (Which is in structure f EKNA1H.
Thank you for you'r help.
08-30-2013 10:37 AM
per record in your source file SAP is going through the IDOC structure from beginning to the end.
Because of that E1KNA1H segment is only processed 1x per record in the source
so it is with E1KNA1L segment too.
so you can only do mapping for 1 text id and 1 line from your source record in the usual mapping process.
for any additional text id and text line you need to do coding.
you need to create new segments in the IDOC, a new segment for the header and for a item line.
This has to be in the right sequence of the IDOC structure otherwise your IDOC runs into a syntax error.
And this place to add this coding is after the original transfer_record step to the text line.
08-30-2013 10:57 AM