How can I pass my select-options as a Function Module parameter?
I have a program, with some parameters, and need to pass the select-options parameter to a Z_FM to be used in a select statement.
How can I pass my select-options as a Function Module parameter?
I have a program, with some parameters, and need to pass the select-options parameter to a Z_FM to be used in a select statement.
In your Function Module definition, at the tables section, define a table LIKE RFG_RANGES.
Your FM will look like
TABLES
range_table STRUCTURE EFG_RANGES
Then you can use it as if it were your original select-options parameter.
WHERE field IN range_table
This worked in a FM used as RFC Hope this helps
Yes, it dumps an error for the length.
The solution is to use an auxiliary table.
DATA t_aux TYPE STANDARD TABLE OF efg_ranges.
t_aux[] = param_range[];
CALL FUNCTION 'Z_MYFM'
TABLES
range_param = t-aux.
This should work.
The problem is select-option sets the lengths of low and high depending on the table-filed used to define the select-options.
rfg_ranges have a fixed length of 45.
Just to share the full solution.
Parameters:
SELECT-OPTIONS: p_docs FOR bkpf-belnr.
Call the FM.
DATA taux TYPE STANDARD TABLE OF efg_ranges.
taux[] = p_docs[].
CALL FUNCTION 'ZCRIP_GET_PG'
EXPORTING
soc = p_bukrs
fecha_ini = fini
fecha_fin = ffin
TABLES
documentos = taux.