Application Development 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: 

download internal tables

Former Member
0 Kudos

hi all,

i have created one report program that containing 3 output internal tables so i download all the internal tables to presentation server.For this one i created one selection screen which containing 2 parameters one is the internal table name and the next one is presentation server file path,both are parameters.so i call this selection-screen 3 times repeatedly and i have to give those paramenters.This is my actual requirement.I declared those 2 parameters like this

p_tabnam(20) type c,

p_flname like rlgrap-filename.

But the problem is in funtion module "GUI_DOWNLOAD" i passed the value of p_flname parameter to filename and p_tabnam to data_tab.But it gives syntax error i.e. p_tabname is not an internal table data_tab should be the structure of internal table.How can i solve this problem can anybody help me.Give me any solution for this problem.

Regards,

Bujji.

12 REPLIES 12

Former Member
0 Kudos

Parameters of the function module is

- name of the file

- name of the internal table that contains the data ! Not the database table !!!!

So you should first select the data into an internal table then download the internal table

INTERNAL TABLE <> DATABASE TABLE

Clemenss
Active Contributor
0 Kudos

Hi,

if there is an internal table with name specified for parameter p_tabnam it might work like this:

field-symbols:

<ft> type table.

assign (p_tabnam) to <ft>.

check sy-subrc = 0.

call funtion 'GUI_DOWNLOAD'

...

tables

data_tab = <ft>

...

Regards,

C.

Former Member
0 Kudos

hi li,

i already tried with filed symbols also but still i get that syntax error.sorry i did not mention this in my previous mail

Former Member
0 Kudos

Hi Murali,

Do you have an internal tables that contains data ?

internal dable are declared in abap like this usually

data : itab2 type mara occurs 0,

itab type standard table of kunnr.

basically this is it.

Once this table does exists you can use GUI_DOWNLOAD

the error message tells you that you didn't declared an internal table.

How can you check that ? The content you want to download can be seen in SE16??? BANg ! This is a databse table

Did I help you ?

Former Member
0 Kudos

hi stephan kaminiski,

i declared internal tables like this

types:begin of t_tab1 ,

matnr like mara-matnr,

mbrsh like mara-mbrsh,

-


-


end of t_tab1.

data:itab1 type standard table of t_tab1,

wa_1 like line of itab1.

Regards,

Murali Mohan,

Former Member
0 Kudos

if possible please post your complete code

regards

Former Member
0 Kudos

Hi Murali,

Ok.

and in the gui_download you do use ITAB1 then for the download that is correct ?

could you copy past the CALL that is existing in youyr program ?

Former Member
0 Kudos

Hi,

Declare the field symbol of type STANDARD TABLE.

field-symbols <FS> type <b>standard table</b>.

ASSIGN ('internal_table') TO <FS>.

call function 'GUI_DOWNLOAD'

EXPORTING

FILENAME = 'C:\ttest.txt'

TABLES

DATA_TAB = <FS>

EXCEPTIONS

other = 9.

Your filename parameter should be of type STRING.

data filename type <b>string</b>.

Svetlin

P.S. If you find an answer useful, please assign reward points.

Message was edited by: Svetlin Rusev

0 Kudos

hi svetlin,

Actually i am giving the internal table name to that function module through selection-screen parameter.for this one i declare p_tabnam(10) type c(parameter) for internal table name and i declare field-symbols <FS> type standard table & assign p_tabnam to <FS> but it gives syntax error like

'p_tabname and <FS> are type-incompatible'.

but what i want is that i need to give the internal table name in 'GUI_DOWNLOAD' in runtime through parameter.How can i do this.i am waiting for your reply.

regards,

Murali.

0 Kudos

you are getting this error cause you are not passing body of internal table , just add [] with internal table name when you pass it

regards

0 Kudos

Hi,

See this code.

parameters: p_tabnam(20),

p_flname like rlgrap-filename.

field-symbols <FS> type standard table.

data: filename type <b>string</b>.

start-of-selection.

ASSIGN <b>(p_tabnam)</b> TO <FS>.

filename = p_flname.

call function 'GUI_DOWNLOAD'

EXPORTING

FILENAME = filename

TABLES

DATA_TAB = <FS>

EXCEPTIONS

other = 9.

The filename should be of type string.

Svetlin

P.S. If you find an answer useful, please assign reward points.

0 Kudos

Hi svetlin,

Thank You very much,maximum i solved my problem with your soon reply.

Regards,

Murali Mohan,