Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

CX_SY_DYN_CALL_PARAM_NOT_FOUND

Former Member
0 Kudos
4,074

Hi,

We are using try and catch in our program, but I'm not sure I understand how can I see the error that was caugth.

If I wouldn't write the try/catch, I would get a specified dump that explain what is exactly the issue, and in case of CX_SY_DYN_CALL_PARAM_NOT_FOUND error, it would have tell me which param is missing.

But if I use try/catch, I can't understand what is the issue during debugging.

I have the following code:

TRY.

     .......

CATCH cx_root.

     WRITE 'Exception during processing'.

ENDTRY.



Does someone know how can I see the long error like I see in st22? ot at least some more data other than "CX_SY_DYN_CALL_PARAM_NOT_FOUND"?

I tried to click on the variable cx_root, but it has no value..


Thanks

1 REPLY 1

matt
Active Contributor
0 Kudos
566

In the debugger, go throw each statement in the TRY. At some point one will raise the exception. (You don't have to single step(F8) - you can use Execute (F6). When this happens, you'll see in the tool bar some new buttons.

Option 1

Click on Last Exception Object. This will show you the exception object that was raised - something like {O:8\CLASS=CX...}

Click on the object, and you'll get all its attributes. You'll see CX_ROOT

You can compare these with CX_SY_DYN_CALL_PARAM_NOT_FOUND viewed through SE24. If you look at CX_ROOT->TEXTID it will have a hex string value. Find this in the constants of the exception class and you'll know what the text represents. E.g. FUNCTION_PARAM_NOT_FOUND. You can then look in the texts tab to see what it means. E.g. Call of the function &FUNCTION& failed; the formal parameter &PARAMETER& does not exist

Then in debug lookup the value of function and parameter (in this example) in the exception object.

Option 2

Click on display trigger location. This will show you where the exception was thrown. Set and save a break point here, re-run your code, and you'll be able to see the values associated with what was thrown.

Option 3

Catch the exception into a variable, and look at the value of the variable in debug.

TRY.

     .......

CATCH cx_root INTO DATA(error).

     WRITE error->get_text( ).

     WRITE error->get_longtext( )

ENDTRY.

Look at error in debug and you'll see all it's attributes. Just like on option 1.