cancel
Showing results for 
Search instead for 
Did you mean: 

File content conversion with apostrophe (') as end separator

Former Member
0 Kudos

Hi,

I have a sender communication channel with file content conversion.

The file that we receive has field separator: '+', and the end separator is apostrophe (').

This is the example:

HDR+  0000277364+  +000000000000000+0           +0080393343  +          +20120919+0000320622      '

SF+0186313   +                              +                              +                              +                         +     +  +'

SP+0186313   +          +                              +                              +                         +     +  +'

ST+          +                              +                              +                              +                         +     +  +'

CA+          +                              +                              +                              +                         +     +  +'

DT+D03044413                  +0000+0000+0000001+1           +ZDM1RANN0DB064039'

LB+                        +               +'

ET+0000320622'

What is the correct setup of record.endSeparator?

Thanks

Fabio

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Fabio,

Its better to use ASCII apostrophe value(0X27) inplace of single quote to avoid ambiguity.

record.endSeparator = '0x27'

Refer this doc for file content conversion. I think this doc will be useful for you.

  

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

http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm

Best Regards,

Sagarika Mishra

Former Member
0 Kudos

Hi experts,

unfortunately is not working.

I've tried all your hints but the result is always:

  <ExpectedArrival>20120919</ExpectedArrival>
  <OrderNumber>0000320622 '</OrderNumber>   
  (where OrderNumber is the last field of my mapping).
  Any suggestions?
  Other parameters are:
   record.fieldSeparator= +
   Filetype and Transfer type must be set in a particular way?
r
(
Ryan-Crosby
Active Contributor
0 Kudos

Hi Fabio,

Something is setup incorrectly in your content conversion because I have verified with sample scenario that using '0x27' works in that PI will use the apostrophe character as an end separator.  Do you have a screenshot of your FCC setup?

Regards,

Ryan Crosby

Former Member
0 Kudos

Hi Ryan, thank you for answering.

This is screenshot of my fcc.

There are Header and ShipFrom segment in screenshot but the others are similar.

Obviously field names in fieldNames parameters are correct.

Best Regards

Fabio

Ryan-Crosby
Active Contributor
0 Kudos

Hi Fabio,

Everything in your FCC looks good which makes me wonder if you are having some sort of encoding troubles.  I believe if PI does not find the end separator that you designate it will use LF or CRLF by default which I think is what is happening in your case.  One way to verify would be to copy/paste that apostrophe character in your file into a hex editor and see if you get '0x27'.  If you do not see that value then that would explain why you are getting it as part of the value.

Regards,

Ryan Crosby

Former Member
0 Kudos

Hy Ryan, thanks for help.

Now I've solved in another way because it was an urgent matter, so I have removed apostrophe from the last field with a replaceString function in message mapping.

Also I think that there is some encoding problem in the source file, with notepad++ converting apostrophe to hex I see:

"000000000  27.

Thanks

Best Regards

Fabio

Answers (2)

Answers (2)

Ryan-Crosby
Active Contributor
0 Kudos

Hi Fabio,

To be safe because the normal convention is to indicate the character using apostrophe I would recommend trying '0x27'

Regards,

Ryan Crosby

baskar_gopalakrishnan2
Active Contributor
0 Kudos

record.endSeparator = ''' (single quote)