‎2010 Oct 26 11:57 AM
Hi there,
Is there a meta-class equivalent in ABAP Objects?
I know I can execute methods (static or otherwise) dynamically if I know the names involved (names of class/object, method, parameters, etc).
But if I don't know all names, how can I find them dynamically? For instance, if I know static method "CREATE_CAKE" from class "CL_CAKE_FACTORY", can I know at run time which parameters I can use (if any)?
Best Regards,
Paulo
‎2010 Oct 26 1:50 PM
Hello Paulo
The way how to dynamically execute CALL METHOD is described in the ABAP keywords help.
CALL METHOD (meth_name)
Syntax
CALL METHOD dynamic_meth { parameter_list
| parameter_tables }.
Effect
This statement calls the method dynamically specified in dynamic_meth.
Actual parameters are assigned to formal parameters without parentheses,
either statically using parameter_list or dynamically using parameter_tables.
The syntax of parameter_list is the same as that for the static method call.
...
In order to get the signature of methods you can use class CL_OO_CLASS.
Regards
Uwe
‎2010 Oct 26 1:50 PM
Hello Paulo
The way how to dynamically execute CALL METHOD is described in the ABAP keywords help.
CALL METHOD (meth_name)
Syntax
CALL METHOD dynamic_meth { parameter_list
| parameter_tables }.
Effect
This statement calls the method dynamically specified in dynamic_meth.
Actual parameters are assigned to formal parameters without parentheses,
either statically using parameter_list or dynamically using parameter_tables.
The syntax of parameter_list is the same as that for the static method call.
...
In order to get the signature of methods you can use class CL_OO_CLASS.
Regards
Uwe
‎2010 Oct 26 5:21 PM
Hi there,
CL_OO_CLASS was just what I was looking for.
Thanks,
Paulo