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

export to excel, notepad

Former Member
0 Likes
497

I have a selection screen. The user will give some input and he should also select a mode in which he wants the results, say excel or notepad. According to that i should give the output in excel or notepad. Can someone give me idea on how to go about this. Any sample code will be of great help.

thanks

Balaji

I have a selection screen. The user will give some input and he should also select a mode in which he wants the results, say excel or notepad. According to that i should give the output in excel or notepad. Can someone give me idea on how to go about this. Any sample code will be of great help.

thanks

Balaji

2 REPLIES 2
Read only

Former Member
0 Likes
445

CHECK FM WS_EXCEL

BR< JAcek

Read only

Former Member
0 Likes
445

Hi,

PARAMETERS: R1 RADIOBUTTON GROUP RAD1,
                         R2 RADIOBUTTON GROUP RAD1 DEFAULT 'X'.

*   Download internal table to presentation server file(PC)

  DATA: ld_filename TYPE string,
* Pre version 4.7 declaration e_file like rlgrap-filename.

  DATA: begin of it_datatab occurs 0,
  row(500) type c,
 end of it_datatab.


IF R1 = 'X'.
ld_filename = 'c://doc_________--/test.xls'.    " For Excel sheet
ELSEIF R2 = 'X'.
ld_filename = 'c://doc_________--/test.txt'.    " For Text file
ENDIF.


  call function 'GUI_DOWNLOAD'
       exporting
            filename         = ld_filename
            filetype         = 'ASC'
       tables
            data_tab         = it_datatab[]
       exceptions
            file_open_error  = 1
            file_write_error = 2

others = 3.

Regards

Sudheer