07-28-2008 8:08 AM
Hi ,
plz check my below program and exaplain me how to make use of parameter table
CLASS cl_abap_objectdescr DEFINITION LOAD.
CLASS add DEFINITION.
PUBLIC SECTION.
METHODS add IMPORTING x TYPE i
y TYPE i
EXPORTING z TYPE i.
ENDCLASS. "add DEFINITION
CLASS add IMPLEMENTATION.
METHOD add.
z = x + y.
ENDMETHOD. "ADD
ENDCLASS. "ADD IMPLEMENTATION
TYPE-POOLS: abap.
START-OF-SELECTION.
DATA : x TYPE i VALUE 10,
y TYPE i VALUE 20,
z TYPE i.
DATA : it_ptab TYPE abap_parmbind_tab,
wa_ptab TYPE abap_parmbind.
DATA : obj TYPE REF TO add.
DATA : add TYPE string VALUE 'ADD'.
wa_ptab-name = 'X'.
wa_ptab-kind = cl_abap_objectdescr=>exporting.
GET REFERENCE OF X INTO wa_ptab-value.
INSERT wa_ptab INTO TABLE it_ptab.
wa_ptab-name = 'Y'.
wa_ptab-kind = cl_abap_objectdescr=>exporting.
GET REFERENCE OF Y INTO wa_ptab-value.
INSERT wa_ptab INTO TABLE it_ptab.
wa_ptab-name = 'Z'.
wa_ptab-kind = cl_abap_objectdescr=>importing.
GET REFERENCE OF Z INTO wa_ptab-value.
INSERT wa_ptab INTO TABLE it_ptab.
CREATE OBJECT obj
TYPE
(add)
PARAMETER-TABLE
it_ptab.
WRITE : z.
The dump analysis is as follows
Runtime Errors DYN_CALL_METH_PARAM_NOT_FOUND
Except. CX_SY_DYN_CALL_PARAM_NOT_FOUND
Date and Time 2008.07.28 02:10:02
Short text
Formal parameter not found during dynamic method call.
regards
07-28-2008 8:11 AM
Hi,
Check this Link.Here is a Example -
http://www.sapnet.ru/abap_docu/ABAPCALL_METHOD_ABAP_OBJECTS.htm
Check out the reason of error here-
http://sapabap.iespana.es/manuales/abap46/abapcall_method_abap_objects.htm
Regards,
Sujit
07-28-2008 8:38 AM
Hi,
When to use parameter table addition with CREATE OBJECT statement?
and how to use it.
With example in SAP HELP I tried but its leading to dump as in my program shown.
regards
prasanth
07-28-2008 10:01 AM
Hi,
Parameter table in Method call is Basically used when call method Dynamically and pass the actual parameter dynamically.
The error you have mentioned occured when the specified and actual parameter are different.
Just follow the procedure and criteria for using parameter table in case of method call in this link.Hope you will get to know the reason for the runtime error.
http://help.sap.com/saphelp_nw70/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
Regards,
Sujit
07-28-2008 10:19 AM
hi,
You can Refer to the link.
http://www.sapnet.ru/abap_docu/ABAPCREATE_OBJECT_ABAP_OBJECTS.htm
Regards
Sumit Agarwal