on 11-21-2009 12:03 PM
HI all,
I am doing File to IDOC scenario where I am having issue wiht mapping :
Flat File
Row -0Unbound
FieldA1..1
FieldB1..1
IDOC
--
--Segment
---Field1
---Field2
-
Segment1
-
Field11
FieldA is Order number.. IDOCs will generate up on order numbers change... FieldB is discount... If Discount is avaliable in any of the order number then I need to Pass YES orelse NO... Segment is a header segment where I need to pass whether discount is YES or NO... Suppose there are 5 rows of same order with discount in 4 row then I need to pass YES if discount doesnt avaliable in all 5 rows then NO..
Row
--FieldA<123>
--FieldB<>
</Row>
Row
--FieldA<123>
--FieldB<>
</Row>
Row
--FieldA<123>
--FieldB<10>
</Row>
Row
--FieldA<222>
--FieldB<>
</Row>
Row
--FieldA<222>
--FieldB<>
</Row>
IDOC
--
--Segment
---Field1<123>
---Field2<YES>
-
Segment1
-
Field11
</IDOC>
IDOC
--
--Segment
---Field1<222>
---Field2<NO>
-
Segment1
-
Field11
</IDOC>
Any inputs how to get value on header level? I tried but I am able to get only first value..not drilling down to each value depending on order number?
Thanks
Rajeev.
Hi,
Map Like bellow.
FieldB-------------------------FormatByExample--sort---collapsecontext--length--greater(constant(0))--Splitbyvalue(Each)---@
FieldA--SplitByValue(ValueChange)--
@---if---then(constant(YES))--else(constant(NO))--Field2.
Sort:
Type of comparision: lexicographical(case insensitive)
Order: descenting
Regards,
Prakasu.M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prakasu,
Its working but there is one issue:
If one fo the discount value is 99.00 then I need to pass NO.. How can I achieve this? I used the UDF but it is taking only the highest value which is 99.00 but even if it is 99.00 I need to pass NO..
Suppose if first row discount is 99.00 and second row its 2,00 then I need to pass YES as it has 2,00 in the second row..
Row
--FieldA<123>
--FieldB
</Row>
Row
--FieldA<123>
--FieldB<99>
</Row>
Row
--FieldA<123>
--FieldB<>
</Row>
Row
--FieldA<222>
--FieldB<8>
</Row>
Row
--FieldA<222>
--FieldB
</Row>
IDOC
--
--Segment
---Field1<123>
---Field2<NO>
-
Segment1
-
Field11
</IDOC>
IDOC
--
--Segment
---Field1<222>
---Field2<YES>
-
Segment1
-
Field11
</IDOC>
First row value is 99 and Null it has to give NO as if discount has 99 then it should pass NO.. in the second order first row is 8 and second row is null.. it should give YES but it is giving NO becuase if is taking only the last value in the Context change..
Any inputs how to achieve this?
Thanks
Rajeev.
Edited by: rajeev raj on Nov 23, 2009 2:52 PM
Hi
Please give the occurrences of the IDOC fields too and then we can make suggestions...
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajeev,
Row
--FieldA<123>
--FieldB
</Row>
Row
--FieldA<123>
--FieldB
</Row>
Row
--FieldA<123>
--FieldB<10>
</Row>
Row
--FieldA<222>
--FieldB
</Row>
Row
--FieldA<222>
--FieldB
</Row>
IDOC
--
--Segment
---Field1<123>
---Field2<YES>
----Segment1
-----Field11
</IDOC>
IDOC
--
--Segment
---Field1<222>
---Field2<NO>
----Segment1
-----Field11
</IDOC>
I think u can achieve this by using a UDF with category as ALL Values of a context.
In first for loop take all the Rows as an array and then compare the Field A values with all the remaining row values and then find out the odd ones then compare all the combination of FieldValueA and FieldValueB when ever there is change then pass YES value to IDOC segment and respective fieldA value..
Regards:
Amar Srinivas Eli
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Use sort function. First sort field A then sort B field depending on A.
Write a simple UDF where UDF will check whether for particular value of A field if it is having B field then pass Yes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.