‎2006 Jan 05 6:11 AM
frnds,
im downloading an internal table to a file(txt file )using the function module "gui_download". i want to have vertical lines between the columns... any suggestions ?
points assured...
madan.....
‎2006 Jan 05 6:13 AM
one option may be u can concatenate | after each field of internal table
‎2006 Jan 05 6:13 AM
one option may be u can concatenate | after each field of internal table
‎2006 Jan 05 6:15 AM
the column will have varying length values. It wud not be a vertical line.
‎2006 Jan 05 6:22 AM
why can't you down load the itab to .xls format.
this will give you what ever you need.
thanks
vijay
‎2006 Jan 05 8:21 AM
I guess your internal table (itab1) has a structure like this:
| ...
This can be done as follows:
DATA: itab2(1024) TYPE c OCCURS 0,
string LIKE LINE OF itab2.
[...]
LOOP AT itab1.
CONCATENATE itab1-field1
itab1-field2
itab2-field3
INTO string
SEPARATED by '|'.
APPEND string TO itab2.
ENDLOOP.
After this you have to call GUI_DOWNLOAD with DATA_TAB = itab2.
That´s it!
--MIKE
‎2006 Jan 05 9:21 AM
Hi Madan,
1. It seems that this separator | functionality
u may require in other programs also
with other internal tables, in near future.
2. Hence, one way (which i tried and works fantastic - Just as u want)
is to
a) COPY the fm GUI_DOWNLOAD to some ZAB_GUI_DOWNLOAD
Do it thru SE80
First Copy the Function Group SFES To some ZSFES
Then the system will ask to copy Function Modules.
At That time just Select For Copying GUI_DOWNLOAD
b) Activate The Whole Function Group ZSFES
c) In the Code Search For (Select radiobutton Main Program)
horizontal_tab
d) After Searching, comment the line, and do AS :
prc_tab_string = cl_abap_char_utilities=>horizontal_tab.
prc_tab_string = '|'.
Note : Here | can also be given as some IMPORT PARAMETER
For FLEXIBILITY Purpose in future if required.
For this, definitly, we need add one more parameter
in IMPORT for achieving this.
e) ACTIVATE
3. Now in your program while calling the FM ZAB_GUI_DOWNLOAD
pass parameter :
WRITE_FIELD_SEPARATOR = 'X'
4. It will work fantastic.
Regards,
Amit M.
‎2006 Jan 05 9:21 AM
data:begin of itab occurs 0,
fld(8),
fld2(8),
end of itab.
data:begin of itab2 occurs 0,
string tpe string,
end of itab2.
loop at itab.
itab2-string+0(8) = itab-fld.
itab2-string+8(1) = '|'.
itab2-string+9(8) = itab-fld2.
itab2-string+17(1)= '|'.
append itab2.
clear itab2.
endloop.
‎2006 Jan 05 9:24 AM
‎2006 Jan 05 9:31 AM
Madan
Use the FM get_component_list
to find No of fields lenghts and type
then U can seperate it as our Gurus specified
REgards,
PAVAN