cancel
Showing results for 
Search instead for 
Did you mean: 

File Content Conversion Issue

Former Member
0 Kudos

Hi All,

I have the text File from my Source System and i need to use FCC for that.

i have the file in the following format

NameDesgLocContactEMP No

Suman,SE, delhi#231234#999

Raman,SSE,bombay#21321#888

The meaning of the above file is First 3 fields are separated by comma and the next two fields are separated by #.

How can i handle this in FCC

Regards

Suman

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member181985
Active Contributor
0 Kudos

Hi Suman,

This scenario might not be possible with FCC.

Better do a java mapping. write your own logic within the java code according to the requirement.

Thanks,

Gujjeti

Former Member
0 Kudos

Hi !

I suggest the same as Anirudh Vyas. Here is a link for handling special characters in XI

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

Regards,

Matias.

Former Member
0 Kudos

Hi Suman,

Here is one solution:

NameDesgLocContactEMP No

Suman,SE, delhi#231234#999

Raman,SSE,bombay#21321#888

For comma separated data, read all of them and read it in XI.

It will be in 3 tags in your case.

Suman tag1

SE tag2

delhi#231234#999 tag3

Now, you have to use 2 stage mapping.

In the first

tag1,2,3 will be mapped to tag1,2,3,4,5.

For tags 3,4,5 you have to write UDFs to strip the data to get the desired value, depending upon the # position in source tag3.

In this way you can get data the way you want.

In next mapping, you can map to the target format.

PS: You may run into the issue of '#' special char in XML error which you have to take care.

Regards,

AV.

Former Member
0 Kudos

Hi Anirudh,

Can u please explain more with some steps that what i need to do

Like steps in FCC....

Like Steps to do in Mapping, how many mapping, Wat UDF to use

Regards

Suman

Former Member
0 Kudos

Hi Suman,

as Anirudh explained:

in your sender File channel, activate FCC by specifying it in the message protocol of the communication channel.

then under content conversion parameters, in document name, put your message type name entered in integration repository.

in document namespace, the namespace used in the scenario, in recordset name, the name of the recordset tag of your message type, in recordset structure enter something like "RECORD,*" (no double quotes). In the Name/Value table, enter the following rows:

Name = RECORD.fieldNames

Value = Name, Desg,Loc, Contact, Emp_No

Name = RECORD.endSeparator

Value = 'nl'

Name = RECORD.fieldSeparator

Value = ','

Name = RECORD.processFieldNames

Value = fromConfiguration

based on this example:

NameDesgLocContactEMP No

Suman,SE, delhi#231234#999

Raman,SSE,bombay#21321#888

Once it is converted to XML, you will need to split those fields where the values include the "#".

It will be in 3 tags in your case.

Suman tag1

SE tag2

delhi#231234#999 tag3

Now, you have to use 2 stage mapping.

In the first

tag1,2,3 will be mapped to tag1,2,3,4,5.

For tags 3,4,5 you have to write UDFs to strip the data to get the desired value, depending upon the # position in source tag3.

example of UDFs....I suggest to write 3 udfs or one with a variable input parameter, if you write 3 udfs, each of them should receive as input the the 3rd field, that is, the one with the content: "delhi#231234#999" and each of them should output a different portion of that input value...

example..

String getFirstValue(string[] a)

return a.split("#")[0];

String getSecondValue(string[] a)

return a.split("#")[1];

String getThirdValue(string[] a)

return a.split("#")[2];

In this way you can get data the way you want.

then map the output of "getFirstValue" UDF to the target 3rd tag

then map the output of "getSecondValue" UDF to the target 4th tag..and so on

In next mapping, you can map to the target format.

PS: You may run into the issue of '#' special char in XML error which you have to take care.

Regards,

Matias.

agasthuri_doss
Active Contributor
0 Kudos

Hi,

>The meaning of the above file is First 3 fields are separated by comma and the next two fields are separated by #.

To my knowledge this is not possible, Ask the Sender Business System to make it uniform delimiter.

Regards

Agasthuri Doss

Former Member
0 Kudos

Hi Doss,

i too said like that only to sender application

But will wait for some other experts views

Regards

Suman

Former Member
0 Kudos

Hi,

Any others Comments on this thread

Regards

Suman