on 04-26-2013 2:29 PM
Hi,
Here is my scenario. This is my input file.
I- header and J - are items. My requirement in target side is
I will have to group the items as below as separate messages:
I'm able to split the messages but not able to group with the related items
IYD01DOLL0000110000660000001557357820H
J201110192011101928USD ABCD 9999AFVR000007686000000000000000000000000
J0000000000000000 8000 000000180000000000000000000000000 IND
J0000000000000000 9000 000007488000000000000000000000000 GMM
IYD01DOLL0000110000660000001557357820H
J201110192011101928USD ABCD 99AA3709000012804000000000000000000000000
J0000000000000000 8000 000011480000000000000000000000000 CHDIND
J0000000000000000 8000 000000060000000000000000000000000 CHDIND
J0000000000000000 9000 000000100000000000000000000000000 CHDIND
IYD01DOLL0000110000660000001557357820H
J201110192011101928USD ABCD 99AA3709000012804000000000000000000000000
J0000000000000000 8000 000011480000000000000000000000000 CHDIND
J0000000000000000 9000 000000060000000000000000000000000 CHDIND
J0000000000000000 8000 000000100000000000000000000000000 CHDIND
J0000000000000000 9000 000000100000000000000000000000000 CHDIND
Thanks.
Hi Pothana,
I have also faced the similar requirement. For this case we have to read source line by line and within the mapping we can use udfs to group and split. So you have to generate a separate target message for every Header. If this is the case
After FCC at sender side, ur source would be like
<Data>IYD01DOLL0000110000660000001557357820H</Data>
<Data>J201110192011101928USD ABCD 9999AFVR000007686000000000000000000000000</Data>
<Data>J0000000000000000 8000 000000180000000000000000000000000 IND</Data>
<Data>J0000000000000000 9000 000007488000000000000000000000000 GMM</Data>
Since you have generate multiple messages, change the occurrences of the target message in the signature tab.
UDF to extract header values
UDF to extract the items and maintain the context
The above udf will group the items with respect to header, then use substring functions to extract the values from the row and map to suitable target elements.
Regards,
Malini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pothana,
If I have correctly understood your requirement, you can use the CopyValue function in Graphical Mapping to achieve what you are looking for.
Following is a link to refer about Copyvalue:
http://help.sap.com/saphelp_nw04/helpdata/en/26/d22366565be0449d7b3cc26b1bab10/content.htm
As for grouping the items together, you can use the SortbyKey function using one key element to sort all other elements in the message:
Refer more about SortbyKey:
http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
Thanks & Regards,
Tejas Bisen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pothana,
Please clear the key values for the grouping. Just like Sep Gong said, if "ABCD","8000","9000" are the key values and could keep the sequence like "ABCD" is the first item line, then read all the file in FCC and split the items based on every "ABCD" or some other key values. for the header line. just use useOneAsMany function.
Regards,
K. Song
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I see some values such as "ABCD","8000","9000" in the Items.
They are fixed values? If yes, i think you can split the items based on this field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pothana,
this type of scenario i have also face,
what you can do is just read the whole file row by row using fcc and the using UDF you need to create the target message,
in udf you read all row in an array a[] and do like that
for(int i= 0; i<var1.length;i++)
{
if(a[i].substring(0,1).equals("I")) // read first character l
{
result.addValue(a[i]); // add header
i++;
while(a[i].substring(0,1).equals("J"))
{
result.addValue(a[i]);
i++;
}
result.addValue(ResultList.CC);
i--; ///because i increase more
}
check below blog that may also help
Regards
Gagan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
8 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.