03-17-2005 5:51 AM
Hello All,
I need to pass variable number of parameters, either to a function module or a class method.
Can anyone tell me if at all this is possible and if yes how? It would be great if someone can suggest about this or some other way to solve this problem.
Thanks,
Mohit
03-17-2005 6:50 AM
Keep the maximum number of parameters possible as importing in your function module and make the absolute necessary ones, mandatory and other as optional.
For eg.
Call FM1 with parameters A B C
Call FM1 with parameters A B F
Call FM1 with parameters A B G
So your function module should have import parameters as:
<u><b>FM1</b></u>
A - Mandatory
B - Mandatory
C - Optional
F - Optional
G - Optional
Regards,
Subramanian V.
03-17-2005 6:50 AM
Keep the maximum number of parameters possible as importing in your function module and make the absolute necessary ones, mandatory and other as optional.
For eg.
Call FM1 with parameters A B C
Call FM1 with parameters A B F
Call FM1 with parameters A B G
So your function module should have import parameters as:
<u><b>FM1</b></u>
A - Mandatory
B - Mandatory
C - Optional
F - Optional
G - Optional
Regards,
Subramanian V.
03-17-2005 7:15 AM
or have a tables paramters where the structure is something like
1.parameter name
2. option
3. sign
4. low
5. high
and within your FM you can read this table and make selections accordingly.
(Note: there is a delivered structure available within the SAP system, i dont remember the structure name. which exactly has the same fields as i have mentioned ablve.)
Regards
Raja
09-29-2008 9:39 AM
Raja's answer was helpful.
BTW the delivered structure he is talking about is RSPARAMS.
Edited by: Mohit V Gadkari on Sep 29, 2008 2:10 PM