‎2010 Mar 07 8:16 AM
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
‎2010 Mar 07 3:33 PM
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).
‎2010 Mar 07 8:33 AM
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®
‎2010 Mar 07 10:35 AM
It didnt solve my problem
Edited by: sriharshachelle on Mar 7, 2010 4:20 PM
‎2010 Mar 07 1:06 PM
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.
‎2010 Mar 07 2:07 PM
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.
‎2010 Mar 07 3:58 PM
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.
‎2010 Mar 07 3:33 PM
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).
‎2010 Mar 08 10:01 AM