2007 Jan 31 2:16 PM
Hi,
I want to know how to pass values of a particular SELECT-OPTIONS into an Function module.
for e.g. : SELECT-OPTIONS :S_TCODE FOR TSTC-TCODE OBLIGATORY.
Now, here i want to pass value of S_TCODE into a functtion module.
Pls help me with this.
Thanks.
Regards.
2007 Jan 31 2:18 PM
Hi
U can create an TABLES parameter without reference in your function module:
CALL FUNCTION 'Z_MY_FUNCTION'
...................................
TABLES
SEL = S_TCODE[].
Max
2007 Jan 31 2:19 PM
if function module has input table then u can pass s_matnr directly to table and u can execute the FM for getting the output.
if function module doesnot have a table but a field then
loop at s_matnr.
call the FM which will return the value.
append this value to internal table.
endloop.
use the internal table for processing.
2007 Jan 31 7:19 PM
Hi Rahul,
Tables passed using TABLES parameters in a FM have a default header line. Using header lines is obsolete in the context of ABAP Objects. So try to avoid using TABLES parameters in FM (and elsewhere e.g. in FORM routines). TABLES statement is already an obsolete statement now in the same context.
You may use the CHANGING parameters for passing this select-options. You may create a Table Type in the ABAP Dictionary that will look like similar to your select-options selection table. Make use of S_SIGN and S_OPTION data elements. .
Alternatively, you may define an internal table type using TYPE GROUP radiobutton in the ABAP Dictionary. You need to include this type group using TYPE-POOLS statement in the global data of the function group in which your FM exists.
Now, on the FM Changing tab, define the table parameter and refer to this table type using TYPE reference.
Hope this helps.
Thanks
Sanjeev