on 08-04-2008 4:49 PM
Hi i am not being able to perform this mapping, the scenario is like this:
i need to create one LINE in the output for each E1PLOGI in the input when FLAG3 = 'S'
also as i don't understand completely the context theory i cant figure out in witch context to set the fields
My context is set like this
FLAG3 -> context = E1PLOGI
My logic is createif( FLAG3 = 'S' ) -> LINE
My xml test file have:
one E1PLOGI node without E1P0000
one E1PLOGI with E1P0000 node where FLAG3 = 'N'
one E1PLOGI completely OK
The result is that not even one LINE its created.
If only put one line ok it works ok, but if one line doesnt have an E1P0000 node or if FLAG3='S' then the next OK input lines it wont come out.
plase heeelp!
IN STRUCTURE
<Z_HRMD_A>
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
<CREDAT>20080731</CREDAT>
</EDI_DC40>
<E1PLOGI SEGMENT="1">
<E1PITYP SEGMENT="1">
<E1P0000 SEGMENT="1">
<FLAG3>S</FLAG3>
</E1P0000>
</E1PITYP>
</E1PLOGI>
</IDOC>
</Z_HRMD_A>
Z_HRMD_A 1..1
IDOC 1..1
EDI_DC40 1..1
CREDAT 0..1
E1PLOGI 1..UNBOUNDED
E1PITYP 0..UNBOUNDED
E1P0000 0..UNBOUNDED
FLAG3 0..1
OUT STRUCTURE
<FILE_X>
<LINE>
<FIELD_1>
<FIELD_2>
<FIELD_3>
<FIELD_4>
</LINE>
</FILE_X>
FILE_X 1..1
LINE 0..UNBOUNDED
FIELD_X 0..1
Edited by: Mariano Billinghurst on Aug 4, 2008 6:05 PM
Edited by: Mariano Billinghurst on Aug 4, 2008 6:12 PM
I did a java mapping to solve this problem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Createif will not generate node if its occurrence is mandator.
Try using mapwithdefault which is a node function.
Or try using exists function that will also create a node but with values true or false.
regards,
ujjwal kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try
FLAG3 -> context = E1PLOGI
createif( FLAG3 = 'S' ) -> removeContext -->LINE
Thanks,
Beena.
Edited by: Beena Thekdi on Aug 4, 2008 6:54 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here it is the mapping and the display of the queues in each step.
Mi test xml has
1-one E1EPILOGI without EP0000
2-one E1EPILOGI OK
3-one E1EPILOGI with FLAG3 = N
4-one E1EPILOGI OK
http://img297.imageshack.us/img297/3615/mappingandqueueswi0.jpg
beena with your solution it was creating two lines , one with 1 and one with 3.
Kumar i think with your solution i am much closer, but still doesnt work ok. Could you explain me why at the end of the queres everything says "supress"?
Regards.
Mariano.
Finally it works, here it is the link with the working mapping and the queues, still dont understand the queues.. jeje
http://img212.imageshack.us/img212/289/mappingandqueuesokaw4.jpg
regards
mariano,
The point is that within E1EPILOGI, you can have several E1PITYP tags, and within that you can have several E1P0000 tags. Hence, for it to properly work, you need to create an UDF that will go throug the entire FLAG3 context and check whether, for that E1EPILOGI tag, there is any FLAG3 = S.
By doing it like you're doing now, it'll create one tag in the target message for each FLAG3 = S, but I thought it was supposed to be created for each E1EPILOGI which contains FLAG3 = S.
Regards,
Henrique.
User | Count |
---|---|
96 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.