Application Development and Automation 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: 
Read only

Condition Exceptions

Former Member
0 Likes
429

Hi

Im using the following API:

CL_WS_HELPER=>get_proxy_abapkey_by_esrkey(

EXPORTING

esr_key = l_t_esr_key

IMPORTING

abap_key = l_t_abap_key

  • EXCEPTIONS

  • not_found = 1

).

This API throws NOT_FOUND Exception.

Questions:

1. I'm not able to find this exception type anywhere in the workbench. In the error it says Exception Condition NOT_FOUND is thrown.

2. How to catch these kind of exceptions?

Please help.

Thanks,

Piyush

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
401

Hello,

You donot have to create / handle these EXCEPTIONS. Just uncomment these lines & check SY-SUBRC after the method call:

CL_WS_HELPER=>get_proxy_abapkey_by_esrkey(
EXPORTING
esr_key = l_t_esr_key
IMPORTING
abap_key = l_t_abap_key
EXCEPTIONS   "Uncomment these lines
not_found = 1 "Uncomment these lines
).
CASE sy-subrc.
WHEN 0.

WHEN 1.
" Error Handling

WHEN OTHERS.
ENDCASE.

BR,

Suhas

2 REPLIES 2
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
402

Hello,

You donot have to create / handle these EXCEPTIONS. Just uncomment these lines & check SY-SUBRC after the method call:

CL_WS_HELPER=>get_proxy_abapkey_by_esrkey(
EXPORTING
esr_key = l_t_esr_key
IMPORTING
abap_key = l_t_abap_key
EXCEPTIONS   "Uncomment these lines
not_found = 1 "Uncomment these lines
).
CASE sy-subrc.
WHEN 0.

WHEN 1.
" Error Handling

WHEN OTHERS.
ENDCASE.

BR,

Suhas

Read only

Former Member
0 Likes
401

Hello Bajaj,

uncomment Exceptions and not_found = 1 lines.

CL_WS_HELPER=>get_proxy_abapkey_by_esrkey(

EXPORTING

esr_key = l_t_esr_key

IMPORTING

abap_key = l_t_abap_key

EXCEPTIONS

not_found = 1

).

if you want to know why this exception occured , just keep a breakpoint in get_proxy_abapkey_by_esrkey method.

Thanks