‎2008 Aug 04 11:23 AM
Hi,
I need to return a dynamic internal table from a normal function module. Like I will create one dynamic internal table <t_dyntable> in function module. Now i need to return this <t_dyntable> to the calling programme as output from function module.
Please let me know how it is possible.
Regards,
Vimal
‎2008 Aug 04 7:06 PM
See function module HR_READ_INFOTYPE. In this FM internal table INFTY_TAB is returned as output. This function module returns the INFTY_TAB whose structure will depend upon the input to FM-- infotype. From the programme where u call this function module define the internal table of structure which this FM is expected to return and use it to get the data. For this see include
BEN47F01 where this FM HR_READ_INFOTYPE has been used.
‎2008 Aug 04 11:24 AM
You need to use Field Symbol to achieve the same.
Thanks
Sudharshan
‎2008 Aug 04 11:31 AM
Dear Sudharshan,
I have created the dynamic internal table using field symbols. I want to know how to define this dynamic internal table as parameter in Tables tab(SE37) and how to return this dynamic internal table as output.
Regards,
Vimal
‎2008 Aug 04 11:36 AM
Define ur table as type any table...For details see the table declaration
in FM REUSE_ALV_LIST_DISPLAY.
Regards,
Joy.
‎2008 Aug 04 7:06 PM
See function module HR_READ_INFOTYPE. In this FM internal table INFTY_TAB is returned as output. This function module returns the INFTY_TAB whose structure will depend upon the input to FM-- infotype. From the programme where u call this function module define the internal table of structure which this FM is expected to return and use it to get the data. For this see include
BEN47F01 where this FM HR_READ_INFOTYPE has been used.
‎2008 Aug 04 10:46 PM
Hello Vimal
If you fm is not RFC-enabled then you can export a data reference of your dynamic itab, e.g.:
DATA:
ldo_itab TYPE REF TO data.
FIELD-SYMBOLS:
<lt_itab> TYPE TABLE.
CALL FUNCTION 'Z_...'
IMPORTING
edo_reference = lde_itab.
ASSIGN ldo_itab->* TO <lt_itab>.
Regards
Uwe