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: 

What is this error?

Former Member
0 Kudos
5,236

Hi all,

I have written a code to add a Recipient as follows:

recipient = cl_distributionlist_bcs=>getu_persistent

( i_dliname = LV_DL_NAME

i_private = ' ' ).

CALL METHOD io_send->add_recipient

EXPORTING

i_recipient = recipient

i_express = 'X'.

BUT, WHEN I TRY TO DO A SYNTAX CHECK I ALWAYS GET A TWO WARNING MESSAGES AS FOLLOWS :

The exception CX_SEND_REQ_BCS is neither caught nor is it declared in the RAISING clause of "TRIGGER_EXECUTED".

The exception CX_ADDRESS_BCS is neither caught nor is it declared in the RAISING clause of "TRIGGER_EXECUTED".

Please tell me how to rectify the above two warnings .

Kindly reply imediately as this is bit urgent

Regards,

Vijay

3 REPLIES 3

romanweise
Active Contributor
0 Kudos
722

Hi,

the methods you call declare exceptions in their interface (if you navigate into these mothods you will see them in the signiture).

The system shows a warning as you did not handle these methods. Haandling these methods can be either done by include a correct exception handling in the mmethod (try. catch. endtry.) or by defining thne exception in the method interface to delegate the handling to the caller which has to implement the exception handling.

If you do not do one of both an the method throws an exception you will get a short dump.

Rgds.

Roman Weise

0 Kudos
722

Hi Roman Weise,

Thanks for your reply.

Can you kindly send me a code snippet for the above query please.

Kindly reply immediately as this is bit urgent.

Regards,

Vijay

romanweise
Active Contributor
0 Kudos
722

Hi,

the code would have the following structure:

DATA:

lr_send_exc type ref to CX_SEND_REQ_BCS,

lr_addr_exc type ref to CX_ADDRESS_BCS.

try.

recipient = cl_distributionlist_bcs=>getu_persistent(

i_dliname = LV_DL_NAME

i_private = ' ' ).

io_send->add_recipient(

i_recipient = recipient

i_express = 'X' ).

catch CX_SEND_REQ_BCS into lr_send_exc.

(put all coding here if the method call with this exception in its signiture is not sucessfull, e.g. raise a message, put a log entry ...)

catch CX_ADDRESS_BCS into lr_addr_exc.

(put all coding here if the method call with this exception in its signiture is not sucessfull, e.g. raise a message, put a log entry ...)

endtry.

What you really do in your error handing depends of your program and your requirements.

Rgds.

Roman