Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Spaces on internal table

Former Member
0 Likes
678

Hello,

I have an internal table like this.

DATA BEGIN OF IT_TEST OCCURS O,

FLD(20) TYPE C,

FLD2(20) TYPE C,

END OF IT_TEST.

I need to download the it_test´s data to a file, but i need that the fld2 with white spaces. When I check the file on notepad the fld has info, but the fld2 doesn´t have blank spaces, how can i fill this field in order to have it on the downloaded file?

Im filling the internal table like this:

...

it_test-fld = 'DATA 1 DATA 1'

WHILE num lt 20.

CONCATENATE it_test-fld2 ' ' into it_test-fld2.

add 1 to num.

ENDWHILE.

APPEND IT_TEST.

....

Then I download it with GUI_DOWNLOAD using ASC mode.

Thanks for helpingme, points will be rewarded!!

Gabriel P.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
642

Unfortunately, GUI_DOWNLOAD does not support fixed length files. It will automatically eliminates any trailing spaces. You can control it when downloading to the server side using TRANSFER with the LENGTH option.

One way around this problem is to have just another field of one character and always default it to 'X' to indicate record end.

DATA BEGIN OF IT_TEST OCCURS O,

FLD(20) TYPE C,

FLD2(20) TYPE C,

<b>end_of_rec type c,<--</b>

END OF IT_TEST.

Hello,

I have an internal table like this.

DATA BEGIN OF IT_TEST OCCURS O,

FLD(20) TYPE C,

FLD2(20) TYPE C,

END OF IT_TEST.

I need to download the it_test´s data to a file, but i need that the fld2 with white spaces. When I check the file on notepad the fld has info, but the fld2 doesn´t have blank spaces, how can i fill this field in order to have it on the downloaded file?

Im filling the internal table like this:

...

it_test-fld = 'DATA 1 DATA 1'

WHILE num lt 20.

CONCATENATE it_test-fld2 ' ' into it_test-fld2.

add 1 to num.

ENDWHILE.

APPEND IT_TEST.

....

Then I download it with GUI_DOWNLOAD using ASC mode.

Thanks for helpingme, points will be rewarded!!

Gabriel P.

4 REPLIES 4
Read only

Former Member
0 Likes
642

constants: c_20(20)

value ' '. "place 20 blanks here in the VALUE clause

MOVE c_20 to it_test-fld2.

Read only

0 Likes
642

do this way,

constants : var(30) value ' '.

it_test-fld2 = var.

Regards,

Santosh

Read only

0 Likes
642

Gabriel,

Has your issue been resolved?

If so, please reward points accordingly and close the thread.

If not, plz provide more detail.

Read only

Former Member
0 Likes
643

Unfortunately, GUI_DOWNLOAD does not support fixed length files. It will automatically eliminates any trailing spaces. You can control it when downloading to the server side using TRANSFER with the LENGTH option.

One way around this problem is to have just another field of one character and always default it to 'X' to indicate record end.

DATA BEGIN OF IT_TEST OCCURS O,

FLD(20) TYPE C,

FLD2(20) TYPE C,

<b>end_of_rec type c,<--</b>

END OF IT_TEST.