on 09-30-2013 10:27 AM
Hi Experts,
I need mapping help to generate index if value comes form source. we have 4 fields in item level of source and target side we have to pass the these filed values and sequence number.
below given the structures:
Source: Target:
Item Item
A1 Text
A2 Seq_No
A3
A4
my requirement is if A1 filed values comes from source we should pass to text and pass seq_no to constant-1, same as A2,A3 and A4 filed values also we should pass to text and seq_no for A2 is 2 and A3 is 3 and A4 is 4. suppose if A1 value is not coming from source we should pass seq_no for A2 is 1. if A1 and A3 filed values are not coming from source then we should pass seq_no for A2 and A3 are 1 and 2.
can you please help me how to achieve this. appreciate for your support.
Regards,
Sanjay.
Hi Sanjay,
Have you tried the statistic function index?
Check Stefan Grube's blog http://scn.sap.com/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-x...
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for prompt reply, in my case i just want to map single item to multiple items.
please find the below
Source: Target:
Item Item
A1 Text
A2 Seq_No
A3 Item
A4 Text
Seq_no
Item
Text
Seq_no
Item
Text
Seq_no
if i am using the index it should be increased when the items are multiple. i don't want to increase number. seq_no should be always 1,2,3,4. if the one filed value is not coming the seq_no should be 1,2,3.
Regards,
Sanjay.
Hi Sanjay,
you can try this mapping
1. Generate the target 4 ITEM's by duplicating the subtree as shown below 3 times.
Now create the each target item starting from first by mapping them to A1,A2,A3 and A4 respectively. I have shown the first ITEM mapping above. similarly you can map A2 to ITEM[1],
A3 to ITEM[2] and A4 to ITEM[3].
2. Now you can map the A* fields to Text one to one as shown below
Please repeat the same for A2,A3 and A4 to respective Text fields.
3.
First seq_no field as shown
and similarly others as shown
Regards
Anupam
Hi Sanjay,
I think the simplest solution is to create a UDFs or use Java mapping to handle the entire logic. If you use UDFs, they could look like that:
1. UDF for "Item" node:
if (inA1 != null) result.addValue(""); else result.addValue(ResultList.SUPPRESS);
if (inA2 != null) result.addValue(""); else result.addValue(ResultList.SUPPRESS);
if (inA3 != null) result.addValue(""); else result.addValue(ResultList.SUPPRESS);
if (inA4 != null) result.addValue(""); else result.addValue(ResultList.SUPPRESS);
2. UDF for "Text" field:
result.addValue(inA1);
result.addValue(inA2);
result.addValue(inA3);
result.addValue(inA4);
3. UDF for "Seq_No" field:
int counter = 1;
if (inA1 != null) { result.addValue(counter); counter++; } else result.addValue("");
if (inA2 != null) { result.addValue(counter); counter++; } else result.addValue("");
if (inA3 != null) { result.addValue(counter); counter++; } else result.addValue("");
if (inA4 != null) { result.addValue(counter); counter++; } else result.addValue("");
Regards,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.