cancel
Showing results for 
Search instead for 
Did you mean: 

Regd. Preserving white spaces while reading a file from FTP

Former Member
0 Kudos

Hi all,

I am reading a file line by line as mentionded in the

[Blog|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2174] [original link is broken] [original link is broken] [original link is broken];

i have selected the option "preserve white space" while creating the DT,even then i am getting only one white space for many white spaces present in the file.

I want to read the file as it is with exact number of white spaces as i need to split the contents based on the fixed field count.

Regards,

Anika

Edited by: Anika Gulati on Mar 6, 2009 8:40 AM

Edited by: Anika Gulati on Mar 6, 2009 8:42 AM

Accepted Solutions (1)

Accepted Solutions (1)

JoelTrinidade
Active Contributor
0 Kudos

Hi Anika,

Your requirement is difficult to achieve in graphical mapping but relatively easier with XSLT mapping. If you still persist to go with graphical mapping then i guess use

NameA.fieldContentFormatting = nothing. See if it helps.

also try xml.fixedLengthTooShortHandling --- ignore , if the above doesnt work.

regards

joel

Answers (3)

Answers (3)

JoelTrinidade
Active Contributor
0 Kudos

Hi Anika,

Just an after thought ...

The file adapter does preserve the spaces.

Say your segment has field1,field2,field3,field4

where

field1 length = 3,

field2 length = 4,

field3 length = 3,

field4 length = 5 (spaces)

try,

xml.fieldFixedLengths --- 3,4,3,5

xml.endSeparator --- 'nl'

Regards

joel

Shabarish_Nair
Active Contributor
0 Kudos

i have selected the option "preserve white space" while creating the DT,even then i am getting only one white space for many white spaces present in the file.

This will not work as DT validation doesnt work in XI/PI (from PI 7.1 it does)

Anyway, to save the day use the fieldContentFormatting option as mentioned above by Prateek

prateek
Active Contributor
0 Kudos

Have you tried the parameter fieldContentFormatting in FCC.

From help.sap

NameA.fieldContentFormatting

- Enter trim to remove all the leading and subsequent blanks for a value found. This is the default.

- Specify nothing to ensure that the value remains unaltered.

Regards,

Prateek