cancel
Showing results for 
Search instead for 
Did you mean: 

File Content Conversion i.e Flat file 2 Flat file

Former Member
0 Kudos

Hi guys,

I am new 2 SAP XI

and i am trying 2 do "Flat File To Flat File".

Input File contains following data:

Name:varun

Surname:rajaraman

Address:B-2

Employee no:8204

i.e Each Data is in separate Row.

Output File Should contain the following data:

I am varun rajaraman staying at B-2 bearing employee no. 8204.

(name,surname) (address) (Employee No.)

i.e data should be in a single row.

So, i have a problem of reading the data from input file i.e data from each row and transfering it into output file along with which i need 2 insert "i am " ,"staying at", etc.

pls tell me the procedure in detail.

Thanks and regards

santhosh rajaraman

Accepted Solutions (1)

Accepted Solutions (1)

nisarkhan_n
Active Contributor
0 Kudos

File adapter sender FCC Parameter

f1.fieldNames = Name,Surname,Address,Employee no

f1.fieldSeparator= 'nl'

on the mapping side

Use conact function to conact "I am" to field Name and so on for other.....

to make the complete statement....

now on the reciver side jsut check wether youcan give space as fieldSeaprator (mot sure on this) if not you can write the UDF which will cobmine all the field values and pass the value to only 1 field as output which will contain whole string

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Check this links for file content convertion.

File content conversion sites

/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1

/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2

/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion

/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file

/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter

/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1

/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2

/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30

/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file

/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter

/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns

/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem

/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter

/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion

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

Regards,

Phani

Reward Points if Helpful

Former Member
0 Kudos

Hi sarvesh,

I have done the things u told me too,but it is showing me java.lang.exception i.e

it is telling that u need ur check ur nameA.fieldSeparator or nameA.fieldFixedLenghts.

So,instead of ITEM.endSeparator='nl' as u told me to do i chanded it 2

ITEM.fieldSeparator='nl' but it is showing an error :

"com.sap.aii.utilxi.misc.api.BaseRuntimeException

thrown during application mapping

com/sap/xi/tf/_san_flat_mm_: RuntimeException in

Message-Mapping transformatio~",

during monitoring of processed xml messages (using transaction code sxmb_moni ).

Thanks,

Santhosh Rajaraman

nisarkhan_n
Active Contributor
0 Kudos

Sarvesh.....

on the sender FCC details it is mandt to define the FieldSeparator in your case it is 'nl' if you dnt menion the end separator it takes line break as default.

check your message mapping program is it fine, reactivate it and also in the IM reselect it manually and activate...if you still have the problem

check this link

Former Member
0 Kudos

Hi Santhosh,

What you need to do is:

1. you have to create the same data type for source and target both, coz you can not map multiple source fields to only one target field.

2. Now use File adapter and select the <b>SENDER</b> radio button and select the option for File Content Conversion (FCC) and enter the details as shown below:

ITEM.endSeparator = 'nl'

ITEM.fieldNames = Name,Surname,Address,EmployeeNo

So by doing this it will pick your source file.

3. Now again use File adapter and select the <b>RECEIVER</b> radio button and select the option for File Content Conversion (FCC) and enter the details as shown below:

RecordSet Structure: ITEM,*

ITEM.fieldNames = Name,Surname,Address,EmployeeNo

ITEM.fieldSeparator = ,

by using this you will get the output file in one line.

Now in your mapping Use <b>Concat</b> function. So while mapping just take one constant and write "I am" in that, Now concat Name with this constant and map it to the target node. Do it with other nodes as per your need.

Regards,

Sarvesh

Former Member
0 Kudos

Hi

use the FCC from seding side of the file adapter

f1.fieldNames = Name,Surname,Address,Employee no

f1.fieldSeparator= 'nl'

also use the f1.endSeparator

Thanks

sudhir sharma