cancel
Showing results for 
Search instead for 
Did you mean: 

Remove spaces

Former Member
0 Kudos

Hi,

I'm downloading a idoc to a txt with gui-download and i want to remove the blank spaces between the fields except some char fields that i want to show with the space of the variable even if is empty.i've used the trunk_trailing_blanks but it removes the empty spaces of all fields.

this is what i have:

start of xpto occurs 0,

a(15) value 'abcdefg',

b(15) value '125436',

c(7) value 'hft',

d(9) value '234',

end of xpto.

file now:

abcdefg125436hft234

what i want:

abcdefg 125436hft 234

thks,

Ricardo

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

U can add one new variable which will hold the space or any value u want as seperator.And then while concatenting add that variable.

Regards,

Ranjit Thakur

Former Member
0 Kudos

the condense did't do anything

former_member181962
Active Contributor
0 Kudos

If you want space after every field, then use:

concatenate field1 field2 field3 into final separated by space.

if you want spaces only for particular fields, then do like this

concatenate field1 ` ` field2 field3 ` ` field4 into final.

(The single quote you see here is the key you find to the left of key '1/!')

Regards,

Ravi

Former Member
0 Kudos

use condense c NO-GAPS

former_member181962
Active Contributor
0 Kudos

loop at xpto.

concatenate xpto-field1 xpto-field2 xpto-field3 into

v_str separated by space.

x_new_table = v_str.

append x_new_table.

clear x_new_table.

endloop.

x_new_table is ready to use.

Regards,

Ravi

Former Member
0 Kudos

Either you have a space for every field or you don't have for anyone. The code Ravikanth has given, will introduce a space for every field.

Regards,

Ravi