on 08-26-2011 7:33 AM
Hi everyone,
I need a mapping logic for the following scenario.
For the same order no with same material no, the quantity should be summed and only one idoc should be created.
For the same order no with different material no, no need to sum the quantity and only one idoc should be created.
For example:
Source Structure:
Ord No Mat No QTY
12 1 2
13 1 3
13 2 1
12 2 4
15 1 5
14 3 7
12 1 6
Target Structure:
Ord No Mat No QTY
12 1 8
12 2 4
13 1 3
13 2 1
14 3 7
15 1 5
Thanks in Advance
Try the graphical mapping as shown below using concat with a space as delimite and UDF to split the value again by space.
1. Idoc node
(RootContext)
OrdNo
|concat[ ] -> sort[asending] -> SplitByValue -> collapseContexts -> Idoc
MatNo case sensitive [ValueChange]
(RootContext)
2. OrdNo
OrdNo(RC)
|concat[ ] -> sort[asending] ->SplitByValue->collapseContexts->SplitByVale-> UDF to fetch ordno -> OrdNo
MatNo(RC) case sensitive [ValueChange] [eachValue] (return var1.split(" ")[0];)
3. MatNo
OrdNo(RC)
|concat[ ] -> sort[asending] -> SplitByValue ->collapseContexts->SplitByVale-> UDF to fetch ordno -> MatNo
MatNo(RC) case sensitive [ValueChange] [eachValue] (return var1.split(" ")[1];)
4. Qty
[asending,case sensitive]
-- sortByKey -----> formatByExample -> sum ->Qty
OrdNo(RC) | | ^
|concat[ ] -> | Qty(RC) |
MatNo(RC) | |
--sort[asending]-> SplitByValue
case sensitive [ValueChange]
Regards,
Sunil Chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's working fine. Thank u so much for quick and best resolution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can achieve the same as suggested by sunil .. You might have to "Split By values" after all the steps .. just before mapping the source node to the targer..
Also, I think for the IDOC node.. you might have to change the contexts for the two Source node , Ord No and Mat no..
I have achieved the same functionality .. by following the approach..
Best Regards,
XA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
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.