‎2008 Feb 29 11:55 AM
Hi there,
I'm trying to call dynamically a function module using the following statement:
DATA: lt_parmbind TYPE abap_func_parmbind_tab,
lt_excbind TYPE abap_func_excpbind_tab,
ls_parmbind TYPE abap_func_parmbind,
ls_excbind TYPE abap_func_excpbind.
.....
CALL FUNCTION my_function_module_name
PARAMETER-TABLE
lt_parmbind
EXCEPTION-TABLE
lt_excbind.
I get the following error message:
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYN_CALL_PARAM_MISSING', was
not caught in
procedure "DEBUG_FM" "(METHOD)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
When calling the function module "/NYH/AGIB_BCA_GET_ACCOUNTS", one of the
parameters
needed according to the interface description was not specified.
This parameter was "I_PARTNER".
But the table lt_parmbind does contain a structure with ls_parmbind-name = "I_PARTNER".
Someone has an idea about the problem?
Any help would be greatly appreciated, thank you.
‎2008 Feb 29 12:02 PM
I think you must check the value in lt_parmbind-value.
If the value is initial, then the reference is not catched in field and the system misses the parameter.
Hope this helps,
Roby.
‎2008 Feb 29 12:09 PM
Hi Roberto,
thank you for your quick answer.
Here are the values for the relevant row.
VALUE[Fref]: ->123240
TABLES_WA[Fref]:
KIND:20
NAME: I_PARTNER
Perhaps is the WA field? Do you have an idea on how to fill it?
‎2008 Feb 29 12:15 PM
The field VALUE must contains the reference to the data object, not the data object itself:
You must set the value like this:
GET REFERENCE OF <your_variable> INTO lt_parmbind-value.The content from debugger must appear like this:
with a numeric value instead of "initial".
Let me know!
‎2008 Feb 29 1:09 PM
Hi Roberto,
I tried that sintax, and my understanding is that in the VALUE filed I have a reference to the actual parameter.
However in the debugger, before the statement
INSERT ls_parmbind INTO TABLE lt_parmbind.the structure ls_parmbind has these values:
-
Component | Val.Ty. | Val. | Technical Type. |
-
VALUE | --> | 123240 | REF TO \TYPE=BU_PARTNER |
TABLES_WA | Fref. | ||
KIND | 20 | I(4) | |
NAME | I_PARTNER | C(30) |
-
‎2008 Feb 29 2:47 PM
And it still don't work I suppose...
I'll try and let you know
‎2008 Feb 29 3:01 PM
‎2008 Mar 03 8:46 AM
Sorry man, but I can't get the function module you're using in my system...
Could you please post the source code? I need to check it out to help you..
‎2008 Mar 03 9:43 AM
Hi Roberto,
here is the code of the method that dynamically calls the function module.
What happens is that I have the parameters name, value and type stored for each Function Module in the in the internal table mt_log_pd (these fields are string type).
I populate the table for the dynamic calling by looping at mt_log_pd: I guess that the problem is in the value assignment.
DATA: ls_log_pd LIKE LINE OF mt_log_pd,
lt_log_pd LIKE mt_log_pd,
lt_parmbind TYPE abap_func_parmbind_tab,
lt_excbind TYPE abap_func_excpbind_tab,
ls_parmbind TYPE abap_func_parmbind,
ls_excbind TYPE abap_func_excpbind,
lr_dyn_ref TYPE REF TO data.
FIELD-SYMBOLS: <l_fs_par_value> TYPE ANY.
*----------------------------------------------------------------------*
"Populate the parameter tab
LOOP AT mt_log_pd INTO ls_log_pd WHERE functmdl = i_functmdl.
IF ls_log_pd-parent_field = 0 AND ls_log_pd-param_kind <> 2.
"Name
ls_parmbind-name = ls_log_pd-param_name.
"Kind
CASE ls_log_pd-param_kind.
WHEN 1. "Importing
ls_parmbind-kind = abap_func_importing.
WHEN 2. "Exporting
ls_parmbind-kind = abap_func_exporting.
WHEN 3. "Changing
ls_parmbind-kind = abap_func_changing.
WHEN 4. "Tables
ls_parmbind-kind = abap_func_tables.
WHEN OTHERS.
"exception
ENDCASE.
"Value
CREATE DATA lr_dyn_ref TYPE (ls_log_pd-param_ass_type).
ASSIGN lr_dyn_ref->* TO <l_fs_par_value>.
<l_fs_par_value> = ls_log_pd-param_value.
GET REFERENCE OF <l_fs_par_value> INTO ls_parmbind-value.
"GET REFERENCE OF <l_fs_par_value> INTO ls_parmbind-tables_wa.
"ls_parmbind-value = lr_dyn_ref.
INSERT ls_parmbind INTO TABLE lt_parmbind.
ENDIF.
ENDLOOP.
*----------------------------------------------------------------------*
"Execute the Function Module
CALL FUNCTION i_functmdl
PARAMETER-TABLE
lt_parmbind
EXCEPTION-TABLE
lt_excbind.
‎2008 Mar 03 11:17 AM
Just one thing that could help...
The field ls_parmbind-value is assigned to the reference of <l_fs_par_value>, that is assigned inside the loop cycle.
When the dynamic calling is performed, may be the case that elements of table lt_parmbind have references to variables that don't exist anymore.
Could this be the cause of the error message? If so, do you have any suggestion to solve the problem?