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

Vertical lines

madan_ullasa
Contributor
0 Likes
1,081

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.....

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,026

one option may be u can concatenate | after each field of internal table

8 REPLIES 8
Read only

Former Member
0 Likes
1,027

one option may be u can concatenate | after each field of internal table

Read only

0 Likes
1,026

the column will have varying length values. It wud not be a vertical line.

Read only

Former Member
0 Likes
1,026

why can't you down load the itab to .xls format.

this will give you what ever you need.

thanks

vijay

Read only

Former Member
0 Likes
1,026

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

Read only

Former Member
0 Likes
1,026

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.

Read only

Former Member
0 Likes
1,026

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.

Read only

Former Member
0 Likes
1,026

Just use pipe operator '|' as a separator

Read only

Former Member
0 Likes
1,026

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