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

Passing internal table to subroutine

Former Member
0 Likes
1,327

Dear Frndz,

I am use funtion GUI_DOWNLOAD.

I called this function in a subroutine. I have to pass various internal tables to this form ..

How to do it.

Say

case mark.

when 1.

peform download using it1.

when 2.

perform download using it1.

endcase.

form download.

call funtion 'GUI_DOWNLOAD'

TABLES

DATA_TAB = <dyn_table>

endform.

regards.

siva

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,282

Hi ,

You can use using or tables .

case mark.

when 1.

peform download using it1.

or

perform download tables it1

when 2.

perform download using it1.

or

perform download tables it2

endcase.

form download tables int_tab type table

call funtion 'GUI_DOWNLOAD'

TABLES

DATA_TAB = <dyn_table>

endform.

Dear Frndz,

I am use funtion GUI_DOWNLOAD.

I called this function in a subroutine. I have to pass various internal tables to this form ..

How to do it.

Say

case mark.

when 1.

peform download using it1.

when 2.

perform download using it1.

endcase.

form download.

call funtion 'GUI_DOWNLOAD'

TABLES

DATA_TAB = <dyn_table>

endform.

regards.

siva

9 REPLIES 9
Read only

Former Member
0 Likes
1,282

hi siva

if you call like this peform download using it1.

then you define like

form download using it1..

endform.

Regards

Deva

Read only

Former Member
Read only

anversha_s
Active Contributor
0 Likes
1,282

hi,

Just do like below.

data : it1 like it_orginal,

it2 like it_orginal.

case mark.

when 1.

peform download using it1.

when 2.

perform download using it2.

endcase.

form download using it_final like it_orginal.

call funtion 'GUI_DOWNLOAD'

TABLES

DATA_TAB = it_final

endform.

Regards,

Anversha

Regards,

Anversha

Read only

Former Member
0 Likes
1,282

Hi Siva,

Use the option tables instead of using


case mark.
when 1.
perform download tables it1.  "tables
when 2.
perform download tables it2.  "tables
endcase.


*tables type any
form download tables it type any.   
call funtion 'GUI_DOWNLOAD'
TABLES
DATA_TAB = <dyn_table>
endform.

Hope this solves it.

Thanks,

Hitesh

Read only

Former Member
0 Likes
1,283

Hi ,

You can use using or tables .

case mark.

when 1.

peform download using it1.

or

perform download tables it1

when 2.

perform download using it1.

or

perform download tables it2

endcase.

form download tables int_tab type table

call funtion 'GUI_DOWNLOAD'

TABLES

DATA_TAB = <dyn_table>

endform.

Read only

Former Member
0 Likes
1,282

hi siva,

U can use this,

case mark.

when 1.

peform download using it1.

when 2.

perform download using it2.

endcase.

form download using p_table type any table.

call funtion 'GUI_DOWNLOAD'

TABLES

DATA_TAB = <dyn_table>

endform.

U ll get the desired result

Success.............

Read only

Subhankar
Active Contributor
0 Likes
1,282

Hi ,,,

Do it in this way...

case mark.

when 1.

peform download TABLES it1. ...........> Instead if using

when 2.

perform download TABLES it2..............> Instead if using

endcase.

form download TABLES p_itab STRUCTURE wa_data.

call funtion 'GUI_DOWNLOAD'

TABLES

DATA_TAB = p_itab

endform.

*Here structure of internal table it1 , it2 and work area WA_DATA must be same..

Read only

Former Member
0 Likes
1,282

Hi,

CASE mark.
  WHEN 1.
    PERFORM output_file TABLES itab1 USING p_file1.     
  WHEN 2.
    PERFORM output_file TABLES itab2 USING p_file2.
ENDCASE.
*&---------------------------------------------------------------------*
*&      Form  output_file                                              *
*&---------------------------------------------------------------------*
FORM output_file TABLES p_itab USING   p_p_file.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename              = p_p_file
      filetype              = 'ASC'
      write_field_separator = 'X'
    TABLES
      data_tab              = p_itab
    EXCEPTIONS
      OTHERS                = 1.
ENDFORM.                               " output_file

Regards

Adil

Read only

Former Member
0 Likes
1,282

Danq All.

As the problem was solved am closing the thread.

Regards,

siva