on 05-09-2007 9:53 AM
Hi,
I'm using message mapping for mapping IDoc ORDERS05 to flat file.
This is the source structure :
ORDERS05 1..1
---- IDOC 1..1
---- E1EDKT1 0..99
---- TDID 0..1
---- TSSPRAS_ISO
---- E1EDKT2 0..9999999
---- TDLINE 0..1
and this is the target structure :
TCD 1..1
---- TCT 1..unbounded
---- TDID
---- TDSPRAS
---- TDLINE
Can anybody help me about how to do the mapping for having 1 TCT element for each
E1EDKT2 element with parent (E1EDKT1) having field TDID equals to the constant "ZALO" ?
For exemple:
<ORDERS05>
<IDOC>
<E1EDKT1>
<TDID>ZALO</TDID>
<TSSPRAS_ISO>tdspras1</TSSPRAS_ISO>
<E1EDKT2>
<TDLINE>tdline11</TDLINE>
</E1EDKT2>
<E1EDKT2>
<TDLINE>tdline12</TDLINE>
</E1EDKT2>
</E1EDKT1>
<E1EDKT1>
<TDID>unused</TDID>
<TSSPRAS_ISO>tdspras2</TSSPRAS_ISO>
<E1EDKT2>
<TDLINE>tdline2</TDLINE>
</E1EDKT2>
</E1EDKT1>
<E1EDKT1>
<TDID>ZALO</TDID>
<TSSPRAS_ISO>tdspras3</TSSPRAS_ISO>
<E1EDKT2>
<TDLINE>tdline3</TDLINE>
</E1EDKT2>
</E1EDKT1>
</IDOC>
</ORDERS05>
must result in :
<?xml version="1.0" encoding="UTF-8"?>
<TCD>
<TCT>
<TDID>ZALO</TDID>
<TDSPRAS>tdspras1</TDSPRAS>
<TDLINE>tdline11</TDLINE>
</TCT>
<TCT>
<TDID>ZALO</TDID>
<TDSPRAS>tdspras1</TDSPRAS>
<TDLINE>tdline12</TDLINE>
</TCT>
<TCT>
<TDID>ZALO</TDID>
<TDSPRAS>tdspras3</TDSPRAS>
<TDLINE>tdline3</TDLINE>
</TCT>
</TCD>
Thanks in advance,
Laurence
1. Map <E1EDKT2> directly to <TCT>.
2. Map <TDLINE> direclty to <TDLINE>.
3. For mapping <TDID>, use useOneAsMany std function.
This function takes 3 input. The first input will be TDID, the next 2 inputs are E1EDKT2.
4. For mapping <TSSPRAS_ISO>, use useOneAsMany std function.
This function takes 3 input. The first input will be <TSSPRAS_ISO>, the next 2 inputs are E1EDKT2
Regards,
Jai Shankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
when implementing your solution, I get only 2 of the 3 expected TCT elements :
<TCT>
<TDID>ZALO</TDID>
<TDSPRAS>tdspras1</TDSPRAS>
<TDLINE>tdline11</TDLINE>
</TCT>
<TCT>
<TDID>ZALO</TDID>
<TDSPRAS>tdspras1</TDSPRAS>
<TDLINE>tdline12</TDLINE>
</TCT>
The filter on "ZALO" TDID works fine, but only the first E1EDKT2 element of each E1EDKT1 is take into account.
Do I have to change some context?
Laurence
Hi,
When implementing your solution, I get only 1 TCT per E1EDKT01 (and no more loop on E1EDKT02) and filter on "ZALO" TDID is not working.
<TCT>
<TDID>ZALO</TDID>
<TDSPRAS>tdspras1</TDSPRAS>
<TDLINE>tdline11</TDLINE>
</TCT>
<TCT>
<TDID>unused</TDID>
<TDSPRAS>tdspras2</TDSPRAS>
<TDLINE>tdline2</TDLINE>
</TCT>
<TCT>
<TDID>ZALO</TDID>
<TDSPRAS>tdspras3</TDSPRAS>
<TDLINE>tdline3</TDLINE>
</TCT>
I have changed context of TDID to ORDERS05, and context of E1EDKT2 to ORDERS05 too. Aren't thoses contexts correct?
Laurence
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.