Skip to Content
0
Former Member
Sep 10, 2007 at 06:16 AM

How to export internal table and pass the internal table to another screen?

173 Views

Hi,

I have a sql SELECT statement that select data from table into internal table. I would like to export out the internal table and pass to another screen and display the data in ALV list. How to export it out? I try but the error given was " The type of "OUT_SELECT_ITAB" cannot be converted to the type of "itab_result".

Another question is, how to pass the internal table that i export out from the function module to another screen?

Here is the code

==============================================================

FUNCTION ZNEW_SELECT_ZSTUD00.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(IN_SELECT_YEAR) TYPE ZSTUD00-EYEAR

*" EXPORTING

*" REFERENCE(OUT_RESULT) TYPE CHAR9

*" REFERENCE(OUT_SELECT_ITAB) TYPE ZSTUD00

*"----


&----


*& Global Declarations

&----


DATA: itab TYPE ZSTUD00,

itab_result TYPE TABLE OF ZSTUD00.

&----


*& Processing Blocks called by the Runtime Environment

&----


itab-eyear = IN_SELECT_YEAR.

SELECT *

FROM ZSTUD00

INTO TABLE itab_result

WHERE eyear = IN_SELECT_YEAR.

IF sy-subrc = 0.

out_result = 'Success'.

OUT_SELECT_ITAB = itab_result.

ELSE.

out_result = 'Fail'.

ENDIF.

ENDFUNCTION.

===============================================================

Please advise. Thanks

Regards,

Rayden