‎2014 Aug 28 3:58 PM
Hi Gurus,
we just changed out ERP from EHP6 to EHP7.
Since we did so we are facing an issue with an Z-Report we are using quite often.
This reports looks up Workitems and executes the according methods so that we can go into debugging if we were facing any problems or errors.
since the EHP Upgrade this statement has problems:
data: lt_parmbind type abap_parmbind_tab,
lt_excpbind type abap_excpbind_tab,
lo_runtime type ref to object.
call method lo_runtime->(iv_cls_method)
parameter-table
lt_parmbind
exception-table
lt_excpbind.
this CALL METHOD Statement has Problem with the Exception Table. We are quite often getting DYN_CALL_METH_EXCP_NOT_FOUND short dumps with Exception "CX_SY_DYN_CALL_EXCP_NOT_FOUND".
The system has problems handling the content of lt_excpbind. if i clear this table the CALL METHOD statement works fine.
AS an example we are trying to call /IDXGC/CL_PD_PROCESS_STEPS-->CREATE_DATA. This method has 2 exceptions
| /IDXGC/CX_PROCESS_ERROR | Process Layer Exception |
| CX_BO_TEMPORARY | Temporary Business Exception |
The Content of LT_EXCPBIND is
| INDEX | NAME | VALUE |
| 2 | /IDXGC/CX_PROCESS_ERROR | 1 |
| 2 | CX_BO_TEMPORARY | 2 |
From my point of view the Problem ist, that they are marked as "class based". I think so because if you looked up the SAP Help for the EXCEPTION-TABLE Statement it is written that is statement only works for none-classbased exception.
I think that restriction is quiet clear. But what i am wondering about is.. that restriction also exists for EHP6. And in EHP6 it work. Does anyone know why? Or how i can change me CALL METHOD Statement that i will work again?
Best Regards
Udo
‎2014 Nov 11 4:04 PM
Hi Udo,
the exception-table must contain only non-class-based exceptions. If you want call a dynamic method with class-based exceptions you dont fill the exception-table. You have to call the dynamic-method with TRY...CATCH...ENDTRY. If you dont know exactly which exception this method can raise you can catch CX_ROOT, the mother of all exception classes.
Excample:
TRY.
CALL METHOD lr_instance->(method_name)
PARAMETER-TABLE ptab.
CATCH cx_root into lr_error.
lv_error = lr_error->get_text( ). "--> maybe a usefull error message
ENDTRY.
Greetz, Matthias
‎2014 Nov 11 4:04 PM
Hi Udo,
the exception-table must contain only non-class-based exceptions. If you want call a dynamic method with class-based exceptions you dont fill the exception-table. You have to call the dynamic-method with TRY...CATCH...ENDTRY. If you dont know exactly which exception this method can raise you can catch CX_ROOT, the mother of all exception classes.
Excample:
TRY.
CALL METHOD lr_instance->(method_name)
PARAMETER-TABLE ptab.
CATCH cx_root into lr_error.
lv_error = lr_error->get_text( ). "--> maybe a usefull error message
ENDTRY.
Greetz, Matthias
‎2014 Nov 11 4:12 PM
Class-based exceptions must be caught using try/catch statement.
Calling dynamically a method catchable exceptions are:
CX_SY_DYN_CALL_PARAM_NOT_FOUND
Anyway catching cx_root (as shown by Matthias) will catch everything is catchable.