on 07-16-2009 2:21 PM
Hi Experts,
Have a requirement such that depending on a single field in the input structure ( Say Dummy 1) I need to populate multiple segments in the output structure.
Suppose If Dummy 1 is 1 and i need to populate a segment (1...99).
can you anyone please show me some idea on this.
Thanks,
Prem
Hi Prem,
If the population is based in some other field, I mean is the number of times depend on other field, the best option is use "UseOneUsMany" function.(and maybe you want to format your output with different contexts)
I other cases, the best option is use a UDF to replicate the field the times You want.
Regards
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
am mapping dummy to a segment E1MAKTM-MAKTX.
Dummy is a field which will contain the text this text needs to be split for every 4 character and populate it into multiple E1MAKTM.
This is the requirement.
If the input is
Thanks for answering my posts
the outpu should be
Than
ks fo
rans
weri
....
Hi,
This is possible via UDF, see mapping below:
for the node E1MAKTM, use this mapping:
sourceNode --> UDF --> equalsS --> not --> ifWithoutElse --> removeContext --> E1MAKTM
constant: --> / /
sourceNode --> UDF --> /
for the node MAKTX, use this mapping:
sourceNode --> UDF --> equalsS --> not --> ifWithoutElse --> removeContext --> splitByValue:eachValue --> E1MAKTM
constant: --> / /
sourceNode --> UDF --> /
here is the UDF, type is CONTEXT
Argument: anInput
int cnt = 0;
StringBuffer sb = new StringBuffer();
char temp[] = new char[anInput[0].length()];
for(int a=0;a<anInput[0].length();a++){
temp[a]=anInput[0].charAt(a);}
for(int a=0;a<temp.length;a++){
if(temp[a]==' ')
sb = sb.append(temp[a]);
else
{sb = sb.append(temp[a]);cnt++;}
if(cnt%4==0){result.addValue(sb.toString());sb = new StringBuffer();}}
result.addValue(sb.toString());
The constant in this code is a space.
sorry for the unoptimized code, but this is working...
hope this helps,
Edited by: Mark Dihiansan on Jul 17, 2009 7:22 PM
Hi Experts,
Have a requirement such that depending on a single field in the input structure ( Say Dummy 1) I need to populate multiple segments in the output structure.
Suppose If Dummy 1 is 1 and i need to populate a segment (1...99).
can you anyone please show me some idea on this.
Thanks,
Prem
Hi you can use Node funtions.
Dummy >> UseOneAsMany.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It could be ABAP mapping or using node functions like useAsMany in graphic mapping... It depends on the message required. Could you please specify it?
Regards,
Radek
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 | |
10 | |
7 | |
6 | |
6 | |
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.