on 08-26-2010 10:13 AM
Hi Gurus,
I am currently mapping E1EDPT1 and E1EDPT2 segments, as we know the nesting of these segments are as follows:
-IDOC
-->E1EDP01
-
>E1EDPT1
-
>E1EDPt2
my source structure is:
-Recordset
-->Header (1..1)
-->HeaderText (1..unbounded)
-->ItemDetail (1..unbounded)
-->ItemDetailText (0..unbounded)
the mapping I did is
ItemDetail --> SplitByValue(ValueChange) --> E1EDP01
create E1EDPT1 only if ItemDetailText node exists so:
ItemDetailText (exists) --> IfWithoutElse --> E1EDPT1 (where value of "then" == ItemDetail --> removeContexts -->mapWithDefault)
ItemDetailText --> SplitByValue(ValueChange) --> E1EDPT2
The problem is that if I have 4 Recordsets then I have 4 IDocs, but the E1EDPT1 is being generated only on the 1st occurence of the IDoc, on the 2nd, 3rd, and 4th occurence it doesn't get generated.
Output below:
IDOC
-E1EDK***
-E1EDP01
---E1EDPT1
-
E1EDPT2
-
E1EDPT2
-E1EDP01
-
No E1EDPT1 and 2 generated
the source has 2 ItemDetail and ItemDetailText nodes.
The desired output is that for every ONE E1EDP01 generated there should be ONE E1EDPT1 segment only having ANY number of E1EDPT2 below it.
Is this possible using standard functions only in PI 7.1?
I have seen this blog [url] http://www.riyaz.net/blog/xipi-convert-flat-file-to-deeply-nested-xml-structures-using-only-graphica... [url]
but I wanted to verify first from our forum if my requirement is not achievable using standard functions only and therefore will follow the blog...
my scenario by the way is FCC (File) to IDoc
Hoping for your kind response
Thanks
Hello HJ Dlec,
ItemDetailText (exists) --> IfWithoutElse --> E1EDPT1 (where value of "then" == ItemDetail --> removeContexts -->mapWithDefault)
Why are you doing "mapWithDefault" here? After the "IfWithoutElse" I would do "removeContexts"--> "SplitByValue".
Is your source a hierarchical or a flat structure?
Yes, you can definitely achieve this with graphical Mapping!
Best regards,
Peter
PS: I think you could even do it easier:
ItemDetailText --> E1EDPT1
will create E1EDPT1 as often as there is ItemDetailText
Constant (Empty) --> E1EDPT2
ItemDetailText --> TDLINE
Then you should get an E1EDPT1 per ItemDetailText with a corresponding E1EDPT2
and then you fill the TDLINE
Edited by: Peter Wallner on Aug 26, 2010 4:36 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter,
Thanks for your answer, but I tried it and output is still not correct.
The E1EDPT1 & E1EDPT2 segments are produced only on the first occurence of the IDoc (1st occurence of E1EDP01 segment)
my desired output is:
Souce = 4 Item Detail each having "1" Item Detail Text for each
Recordset
-
Header
-
HeaderText
-
ItemDetail
-
ItemDetailText
-
ItemDetail
-
ItemDetailText
Recordset
-
Header
-
HeaderText
-
ItemDetail
-
ItemDetailText
-
ItemDetail
-
ItemDetailText
-
ItemDetail
-
ItemDetailText
-
ItemDetail
-
ItemDetailText
Output =
IDoc
-
E1EDP01
-
E1EDPT1
-
E1EDPT2
-
E1EDP01
-
E1EDPT1
-
E1EDPT2
IDoc
-
E1EDP01
-
E1EDPT1
-
E1EDPT2
-
E1EDP01
-
E1EDPT1
-
E1EDPT2
-
E1EDP01
-
E1EDPT1
-
E1EDPT2
-
E1EDP01
-
E1EDPT1
-
E1EDPT2
-
E1EDP01
-
E1EDPT1
-
E1EDPT2
-
E1EDP01
-
E1EDPT1
-
E1EDPT2
P.S. my question is on the Item Level only, The Header level desired output is OK
right now the current output is
IDoc
-
E1EDP01
-
E1EDPT1
-
E1EDPT2
-
E1EDPT1
-
E1EDPT2
-
E1EDP01
-
No E1EDPT1 segment
IDoc
-
E1EDP01
-
No E1EDPT1 segment
as you can see my 1st recordset has 2 item detail & item text, 2nd recordset has 4 item detail & item text
but in output the 1st occurence of the IDoc AND 1st occurrence of E1EDP01 this is where the 2 item texts are produced, which should not be the case because cardinality of E1EDP01 - E1EDPT1 - E1EDPT2 = 1:1
On the second occurence of the IDoc there is totally no E1EDPT1 produced
Hello HJ Dlec,
I set up your scenario here and tried around.
So I am mapping:
Recordset --> IDOC
That causes one iDoc per Recordset (IDoc is 0....unbounded)
ItemDetail --> E1EDP01
That causes one E1EDP01 per ItemDetail
Queue of ItemDetail:
ItemDetail
ItemDetail
CONTEXT CHANGE
ItemDetail
ItemDetail
ItemDetail
ItemDetail
ItemDetailText --> SplitByValue --> E1EDPT1
That causes one E1EDPT1 per ItemDetailText
Queue of ItemDetailText
ItemDetailText
ItemDetailText
CONTEXT CHANGE
ItemDetailText
ItemDetailText
ItemDetailText
ItemDetailText
Constant --> E1EDPT2
ItemDetailText --> SplitByValue -->TDLINE
That causes each text put into the TDLINEs
Queue of ItemDetailText:
ItemDetailText
ItemDetailText
CONTEXT CHANGE
ItemDetailText
ItemDetailText
ItemDetailText
ItemDetailText
Please try again!
Best regards,
Peter
PS: Is Header, HeaderText, ItemDetail, ItemDetailText really one one level, no sublevels here?
Hi Peter,
Thanks again for the effort in helping me out here.
Btw, Header, HeaderText, ItemDetail, ItemDetailText are not on one level only.
my Source structure is Fixed Field Length & using FCC:
Header (1..1)
HeaderText (1..n)
ItemDetail (1..n)
ItemDetailText (0..1)
so for example: (**pls disregard the spaces below, for illustration purposes only, structure is fixed field length)
ItemDetail-KEYFIELD -field1 -field2 -field3 field4 -NewLine
ItemDetailText-KEYFIELD -field1 -field2 -field3 -field4 -field5 -NewLine
ItemDetail-KEYFIELD -field1 -field2 -field3 field4 -NewLine
ItemDetailText-field3 is what I need to map to E1EDPT2-TDLINE
Hello HJ Dlec,
Oh, I see. It is a text file and you use the content conversion of the file adapter. But the conversion to XML works right?
By "on the same level" I meant are there sublevels in the structure?
Please look at:
http://public.fotki.com/pezibaer420/pi-hj-dlec/text-test-mapping-struc.html
and look on the left you see the structure, I hope you can read it. Everything is below "RecordSet" on the same level and "RecordSet" is unbounded.
Does your structure look like that? If yes, then my answer from before should work!
Beste regards,
Peter
Hi Gurus,
I am also facing little bit similar problem for text segment. I am using one of the user exit for passing the text segment data. But the standard program is not sending this segment (E1EDPT1 & E1EDPT2) to my user exit. i mean is there any configuration setting which we need to do to pass text segment in IDOC type (ORDER05). Here i am using an extension IDOC which has the basic type as ORDER05.
Please help.
Thanks.
Sourabh Batwara
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HJ Dlec
.
.....iis being generated only on the 1st occurence of the IDoc, on the 2nd, 3rd, and 4th occurence it doesn't get generated.
I have a question How to populate the IDOC ?.
Did you change the ocurrence to accept multiple IDOCs .
Check /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
and the another is are HeaderText ,ItemDetail, ItemDetail Text on the same level?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.