on 10-01-2014 10:47 AM
Hi All ,
I am calling some class methods inside the data class. So i am using the statement catch exe in lo_exe1.
After how can i display the execption , I mean the message manger will be initial inside the data class, So how can i handle the exceptions from data feeder class.
Please share your ideas!
Thanks,
Pradeep.
Hi Pradeep,
if you do not need the connect the error to a GUIBB field you can easily send the exception as message to the FPM:
mo_fpm->mo_message_manager->report_object_message( "mo_fpm e.g. from fpm factory
ir_message_object = lx_error "<<<< exception, e.g. TYPE REF TO CX_ROOT
io_component = me
iv_severity = iv_severity ).
and if you want to include previous exceptions as well you can do something like:
*----- recusively walk up previous path
DATA lx_root TYPE REF TP cx_root.
DATA(lx_root) = lx_error.
WHILE lx_root IS BOUND.
IF lx_root->textid <> lx_root->cx_root.
mo_fpm->mo_message_manager->report_object_message(
ir_message_object = lx_root
io_component = me
iv_severity = iv_severity ).
ENDIF.
lx_root = lx_root->previous.
ENDWHILE.
Regards, Jens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pradeep,
1) Populate table lt_messages with message on catch exe... and export lt_message to feeder class.
2) in your feeder class, move lt_message to et_messages.
Let me know if I've misunderstood your requirement....
Thanks
Jitin Kharbanda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pradeep,
DATA CLASS
method catch_exception.
try.
...
...
...
catch.
prepare your lt_message table. (TYPE FPMGB_T_MESSAGES)
et_message = lt_message.
(you need to define et_message (TYPE FPMGB_T_MESSAGES) as export parameter of this method.
endtry.
endmethod.
FEEDER CLASS
data lt_message TYPE FPMGB_T_MESSAGES.
call method lo_data_class->catch_exception( importing et_message = lt_message ).
et_message = lt_message.
(ET_MESSAGE here is exporting parameter of your feeder class).
Thanks
Jitin Kharbanda
Hello Pradeep,
For an exception caught, you can do some action (if required) and then add message to lt_message.
You need to maintain the message in a message class (based on the exception)
example - "Communication Error."
data : ls_msg TYPE fpmgb_s_t100_message.
try.
catch zex_comm_err into lo_err.
ls_msg-msgid = message class.
ls_msg-msgno = message number.
ls_msg-severity = type of message (E, I, S etc..)
APPEND ls_msg TO lt_message.
et_message = lt_message.
endtry.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.