‎2011 Aug 01 9:34 AM
Hi all
Currently im having this issue whereby i need a dynamic export table parameter in the function module. this is because there is a dynamic selection from the database and then i do not know what is the reference type for the exporting table. how to define a dynamic reference type. btw im developing on 4.6C
‎2011 Aug 01 9:39 AM
Can't you just define the table parameter in the FM, with no explicit type assigned to it?
Then you can use a Field-Symbol to assign the dynamic table to the export parameter
‎2011 Aug 01 9:49 AM
i cant assign the field symbol to the export table because export table is not a field symbol. and also is it possible to do this in a RFC function module?
‎2011 Aug 01 9:45 AM
Hello,
You should take a cue from the widely used FM 'GUI_DOWNLOAD'.
BR,
Suhas
‎2011 Aug 01 9:55 AM
@Suhas Saha is it possible to use the logic from gui_download for RFC Function Module?
‎2011 Aug 01 10:01 AM
If you are using an RFC FM it would be different 'cause you always have to type all the parameters.
In case it's not an RFC, of course you can do it.
FUNCTION ZJMOTERO.
*"----------------------------------------------------------------------
*"*"Interfase local
*" IMPORTING
*" REFERENCE(I_RUTA) TYPE ZJMOTERO3
*" TABLES
*" TABLE
*"----------------------------------------------------------------------
field-symbols: <fs> type table.
data: a type ref to data.
data: tabla type table of pa0001.
select * into table tabla from pa0001 where pernr eq 1.
assign tabla to <fS>.
table[] = <fs>[].
ENDFUNCTION.
‎2011 Aug 01 10:09 AM
@Jose Maria Otero what do you actually mean? right now im doing a RFC function module meaning it cant be done?
‎2011 Aug 01 10:37 AM
Hello,
As already mentioned you can't use generic types in RFC modules.
There are some standard SAP FMs using similar logic as your's, e.g., RFC_READ_TABLE. You can leverage its logic.
BR,
Suhas
‎2011 Aug 01 12:07 PM