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

GUI_DOWNLOAD fn module text allignment problem

Former Member
0 Likes
939

Hi

I have a problem while downloading data from internal table to presentation server filepath using GUI_DOWNLOAD fn module.

For me the requirement is to display each field data at a fixed location in a DAT file (notepad) for all lines irrespective of any delimiter.

Now data of ech field is getting displayed continuously after its preceeding field with the specified delimiter. I want to fix the location of each field at a particular point for all lines in the file after download.

Is there any other fn module for this or any change in the parameters for fixing the field positions in the output file ?

Harsha

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
0 Likes
786

You just have to create an internal table with character-like fields of the lengths you want. For each line you may use CONCATENATE field1 field2 field3 etc. INTO line RESPECTING BLANKS (valid from 7.0), and append it to a table of strings. Note: RESPECTING BLANKS do not remove any blanks. Then download the table of strings using GUI_DOWNLOAD (no separator).

7 REPLIES 7
Read only

former_member194669
Active Contributor
0 Likes
786

Try this way


DATA: tab TYPE c   VALUE cl_abap_char_utilities=>horizontal_tab.
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    filename              = p_file  
    filetype              = 'ASC'
    write_field_separator = tab         
  TABLES
    data_tab              = it_table.

a®

Read only

0 Likes
786

It didnt solve my problem

Edited by: sriharshachelle on Mar 7, 2010 4:20 PM

Read only

0 Likes
786

Hi,

Take an internal table with a single field of type string. Concatenate all your values into a wa of same type seperated by cl_abap_char_utilities=>horizontal_tab and append to new itab. Now download this itab. It should work fine.

Thanks,

Vinod.

Read only

0 Likes
786

Hi Vinod

I have tried your way solution also. Still my problem is not solved.

Present Output:

test test E12EDWQD 0000110.000

venky kirupa test case- final se 87549-8655-9 0000110.000

Vetri Velan SAFETWT 0000961.540

Amount fieilds(last field) of each line need to be alligned one below the other starting from same position in all lines. At present its all random based on the length of previous field.

Harsha.

Read only

0 Likes
786

Hi,

Currency and quantity fields are always right aligned. So take character variable. Move currency/quantity field data to this character variable and CONDENSE. Now while concatenation, take these character variables instead of taking from your final table work area.

Thanks,

Vinod.

Read only

Sandra_Rossi
Active Contributor
0 Likes
787

You just have to create an internal table with character-like fields of the lengths you want. For each line you may use CONCATENATE field1 field2 field3 etc. INTO line RESPECTING BLANKS (valid from 7.0), and append it to a table of strings. Note: RESPECTING BLANKS do not remove any blanks. Then download the table of strings using GUI_DOWNLOAD (no separator).

Read only

0 Likes
786

Hi

THank you. Your solution solved my problem.

Harsha.