‎2009 Sep 28 10:44 AM
Hi everyone,
I'm developing a custom function module that is going to be used by various different programs. For some programs the logic processed in the FM will be the same, but for some cases additional logic is required. I only want to run through this logic if it is required by the calling program. I 'm thinking i can determine whether or not logic should be processed based on whether or not an export parameter for the FM has been specified in the calling program. But I'm not sure what way to do this.
For example.
CALL FUNCTION 'Z_Function'
EXPORTING
pernr = peras-pernr
begda = l_begda
endda = l_endda
IMPORTING
param_a = l_param_a
param_b = l_param_b
EXCEPTIONS
DATA_MISSING = 1
OTHERS = 2 .
If both parameters above are specified then that's fine. However if only l_param_a or l_param_b is specified then i only want to process the logic to relevant to determing the value of that export parameter. The reason for this is that this function module will could run thousands of times (per employee basis) and i dont want to slow performance by retrieving data that is not required in some programs.
So within the function module - is there a straightforward way i can check whether param_a or param_b has been speficied by the calling program ? Having to separate function modules is not an option for us.
Thanks alot for your time
DK
‎2009 Sep 28 10:46 AM
Check out option IF ... IS SUPPLIED in ABAP help.
http://help.sap.com/abapdocu_70/en/ABENLOGEXP_SUPPLIED.htm
Thomas
‎2009 Sep 28 10:46 AM
Check out option IF ... IS SUPPLIED in ABAP help.
http://help.sap.com/abapdocu_70/en/ABENLOGEXP_SUPPLIED.htm
Thomas
‎2009 Sep 28 10:55 AM
Thomas,
Excellent, exactly what I need - I had not unearthed this is my search. Thanks alot - I appreciate your time and help.
Best Regards
Damien