cancel
Showing results for 
Search instead for 
Did you mean: 

Content conversion in receiver file adapter

Former Member
0 Kudos

Hi,

I have R/3-XI-File scenario.The output file should look like (suppose there are 3 columns in file,column1(10),column2(3),Column3(3))

"ABC ","XYZ","PQR"

"ABCDEFGHIJ","XYZ","PQR"

the data for each column is enclosed within quotation marks and comma is the field separator.If the value of field is less then the length of field then white space should be there within quotation marks.

Can this be achieved using content conversion?

Thanks,

Rekha

Accepted Solutions (1)

Accepted Solutions (1)

agasthuri_doss
Active Contributor
0 Kudos

Hi,

This will help you

http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm

I am reachable at- agasthuri@gmail.com, If you want i will send some document related to it.

Regards

Agasthuri Doss

Answers (4)

Answers (4)

Shabarish_Nair
Active Contributor
0 Kudos

use this code ...

int len_original = a.length() ;

int len_required = Integer.parseInt(b);

StringBuffer sBuf= new StringBuffer(a);

while (sBuf.length() < len_required)

{

sBuf.insert(len_original,' ');

}

String input = "\"" + sBuf + "\"";

return(input);

for the two inputs, first give the field and in the second input give a constant with the length say 10 or 12 for example which is the original req. for the field.

agasthuri_doss
Active Contributor
0 Kudos

Hi Rekha & Ram,

I have send the Document, I hope it is usefull.

Regards

Agasthuri Doss

moorthy
Active Contributor
0 Kudos

HI,

As there is not much control in the Reciever side file content conversion, it is prefer to format your data in the mapping. And then send this data to communication channel.

So logic of incorporating spaces, and quotation marks etc, you can do in the mapping. If you are using message mapping, try to do with java user defined functions.

Then just in the reciever channel you can put just delimiter so that it is easy.,

Regards,

Moorthy

Former Member
0 Kudos

Hi Agasthuri Doss Baladandapani

Can you Pls as well send me the DOcs ?

my ID mlrshee@gmail.com

Thanks,

Ram

former_member206604
Active Contributor
0 Kudos

Hi,

During mapping write a generic UDF that will check the length of the data passed in and encloses it with " double quotes and whitespaces. And while doing the content conversion its simple and normal content conversion.

OR

In the UDF just add the white space.

In the content conversion set <b>"</b> as begin separator and end separator. The field separator would be <b>",</b>.

Regards,

Prakash

Former Member
0 Kudos

Hey Prakash,

Can you please give those UDF codes, I'm really interested in this topic.

Thankz n Advance.,

S