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

Dynamic export table parameter

john_wayne
Participant
0 Likes
1,255

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

8 REPLIES 8
Read only

former_member209703
Active Contributor
0 Likes
1,043

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

Read only

0 Likes
1,043

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?

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,043

Hello,

You should take a cue from the widely used FM 'GUI_DOWNLOAD'.

BR,

Suhas

Read only

0 Likes
1,043

@Suhas Saha is it possible to use the logic from gui_download for RFC Function Module?

Read only

0 Likes
1,043

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.

Read only

0 Likes
1,043

@Jose Maria Otero what do you actually mean? right now im doing a RFC function module meaning it cant be done?

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,043

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

Read only

0 Likes
1,043

That's right.

RFC's don't allow generic types.