on 08-23-2010 6:15 PM
Hi Folks,
I have got source xml with couple of Vendors, Vendors has got promotions on different products with different dates. If I sort date field, product quantity is not sorting. How Can I sort both fields at the same time, if I sort Promotion date field in ascending order, the product quanitity has to sort respectively?
Any one can help in this please , any links are examples etc..
Kind Regards
Thanks in advance.
San
Hi. ASandhya
You can se standar function SortByKey
Promotion date.............
product quanitity..........SortByKey.....Target.
/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13
http://help.sap.com/saphelp_nw04/helpdata/en/2c/2d8c4024d26e1de10000000a1550b0/frameset.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Folks,
I have tried with this function SortbyKey, it always throuing exception. That's the reason I came to you guys. Please have a look following mapping
ZY2K_DATE ----> Remove Context -->
Sortbykey -----> Condition etc.,
ZA02_QTY -----> Remove Context -->
if I try to see display queue on Sortbykey I am getting ' Exception'
Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Queues have different lengths in function sortByKey] in class com.sap.aii.mappingtool.flib7.NodeFunctions method sortByKey[[Ljava.lang.String;@5be18f1d, [Ljava.lang.String;@357ae80b, SortComparator.CASE_SENSITIVE, SortOrder.ASCENDING, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@1818459b,
Source
<ROOT>
...<OUTPUT> - - - - 0..unbound
.......<Group_LIN> - - - 0..unbound
..........<Group_ZA> - - - 0..unbound
..............<D02_ZA> - - - 0..unbound
..................<ZA01>QD</ZA01>
..................<ZA02>35.0</ZA02>
..................<ZA03>CT</ZA03>
..................<Z_Y2K_DATE>20100723</Z_Y2K_DATE>
..............</D02_ZA>
...........</Group_ZA>
........</Group_Lin>
....</OUTPUT>
Target
ProductDemandInfluencingEventNotification 0..unbound
...ProductDemandInfluencingEvent 1..1
.......Item 1..unbound
..........OrderForecastTimeSeries 0..1
..............Item 1..unbound
.................ValidityPeriod 1..1
......................StartDateTime 0..1
......................EndDateTime 0..1
.................Quantity 1..1
the above D02_ZA tag sometimes comes more than one QD with different dates. Same dates has to go under one tag with respective quantities!! This is the situation, can any solve this please?
The target tag "ProductDemandInfluencingEventNotification" will generate based on number of promotions on particular date. Ex: if one vendor has 'n' number products promotions on 3 different dates, 3 "ProductDemandinfluenceevennotifications" has to generate, that three promotion dates and quantities has to respectively.
That ZA02 (Qty) value has to go Quantity target field.
Kind Regards
San
Problem resolved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandhya,
Assuming quantity field is repeating with every node DO2_ZA, mapping can be applied as follows:
ZY2K_DATE -
>
DO2_ZA(Context to next higher level) --> useOneAsMany -
> sortByKey -
> Target
DO2_ZA -
> ZY2K_QTY----
>
-Supriya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandhya,
If the queue lengths are different, then you have to use useOneAsMany function first before using sortByKey.
Using useOneAsMany, make both the queue lengths equal and then apply output of this to sortByKey as input.
-Supriya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to use SortByKey function.. just search on SDN becaus I guess there is some blog which explain how to use this..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
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.