cancel
Showing results for 
Search instead for 
Did you mean: 

Field Separator issue in delimited file

Former Member
0 Kudos

Hi,

I have developed a scenario( Proxy to File ). Iam using " | "symbol as a field separator. I am sending data from SAP system to legacy system as a " | "delimited text file.

some of the field values are having " | " symbol as a part of the value. ( Eg : |1234, demo|char ). And user wants only " | " symbol as a field seperator.

How do i overcome this problem ?

Thank you

Sathish.D

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi Sathish,

You have multiple options for that. You can replace the | char inside the fields with some other char, during mapping. You can also encode it with &something combination. Finally, you could also enclose the fields in quotes or so, so that the receiver knew that inside quotes, there is a field value that should not be broken by the | separator. Or use some escape character to emphasize that. It all depends on the receiver system's requirements and possibilities.

Regards,

Greg

Former Member
0 Kudos

Hi Greg,

Thank you for the useful information. As mentioned "use some escape character to emphasize that ".

How and where do i use escape character ?

Thank you

Sathish.D

former_member184681
Active Contributor
0 Kudos

Receiver FCC (in contrary to the sender one) doesn't have the capability to handle escape characters automatically, so unfortunately you would have to handle it manually in mapping.

Former Member
0 Kudos

HI Greg,

Is there any function to do this in mapping ?

Thank you

Sathish.D

Former Member
0 Kudos

Use replacestring function.

Former Member
0 Kudos

possiable by replaceString what was posted by earlier poster.

for ex:

for more info :http://wiki.sdn.sap.com/wiki/display/HOME/Message+Mapping++Replace+String

Former Member
0 Kudos

Hi Greg,

Thank you. It is very useful. is any function to find a particular symbol in a field.

I mean, if this symbol is there in a field then we can add quotes " " using cancat function. The symbol "|" should remian in that value.

Eg : if  invalue = 9876|9900 then outvalue "9876|9900"

Thnak you

Sathish.D

former_member184681
Active Contributor
0 Kudos

Dear Sathish,

You can use the following mapping:

Regards,

Greg

Former Member
0 Kudos

hi , mapping is corrct what was posted by Glowsaki but in first constant -1 replacing 0.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

This issue is resolved. in two ways we can acheive.

First : In SAP system:  search for the " | " symbol if found then add quotes("value") both sides to the  field value and pass to SAP XI/PI.

Second :  In XI/PI mapping : Use indexOf function to find symbol " | " in a field, If symbol is not there it reurns -1. check the condition not equal to -1 then use cancat function to add quotes.

Thank you for all the replies.

Sathish.D