2008 Mar 18 8:43 PM
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
2008 Mar 18 8:52 PM
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
2008 Mar 18 9:01 PM
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
2008 Mar 18 9:17 PM
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