cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with cocatenate text - XI.

Former Member
0 Kudos

Hello,

I made a RFC function which exports a table to XI. That table has one column and many rows. Every field in table has type char lenght 50. My task is concatenate this fields, becouse outsource aplications expects one long string. I can't do it in ERP becouse that string is to long. So I ask is there any possibility to concatenate this fields in XI?? If it possible please explain me how I can do it.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

As table will contain the multiple rows under one column it means the one field with multiple occurance. Here you can't use the Concat API from standard function.

You need the UDF with belo code

Source table Column ( A )---> TestUDF ---> Target field

In UDf take cache parameter as == Queue

and copy paste below code

//write your code here

String Constants = new String("");

try{

for(int i = 0; i<=1000;i++)

Constants = Constants.concat(A<i>);

} catch (ArrayIndexOutOfBoundsException e) {}

result.addValue(Constants);

Thanks

Swarup

Answers (4)

Answers (4)

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi,

I recommendo you create a UDF because is more easy to mantain, by the other way you have to use many CONCAT and is a mess. in UDF just send a queue of each field (change field context) and all.

you will have a UDF whit many parameter.

im not sure, bucause i have many time with develope in java, but i think if yoiu send a queue of node <node> you could access to each field, so the UDF only would have one parameter.

please confirm my doubt.

for example:

<MT_XXX>

....<node>

........<f1/>

........<f2/>

........<f3/>

........<f4/>

....</node>

</MT_XXX>

hope it helps

Edited by: Rodrigo Pertierra on Mar 3, 2008 9:25 AM

Former Member
0 Kudos

Hi

as per your requirement you have mauliple records in a single filed.

if u will use the standard concat function then it will map only the first value and ignore all other values.

so in that case u can make uswe of UDF.

UDF:

string a= new string("");

for(int i=0;i<a.length;i++)

{

a=a+concat(a);

}

result. addValue(a);

the parameter a in the UDF is ur source field(u can also use any other name also)

and u will use the UDF in the mapping in the following way

source->UDF>target

Thanks

Rinku

Former Member
0 Kudos

Have a look at the Blog from Sarvaya

Message mapping simplified

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2171] [original link is broken] [original link is broken] [original link is broken];

If you are new to Message mapping

Reward points if useful

Regards

Abhishek

prateek
Active Contributor
0 Kudos

In message mapping, use standard funcion Concat. U have to use many concat tabs.

Regards,

Prateek