Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Exception Class Help

$
0
0

Hi Experts,

 

I need some advice on why my exception is not getting caught. Here are the details.

 

Exception Class:  ZCX_BW_SD_CODE

 

class ZCX_BW_SD_CODE
definition
public
inheriting from CX_STATIC_CHECK
final
create public .
public section.
*"* public components of class ZCX_BW_SD_CODE
*"* do not include other source files here!!!

constants ZCX_BW_SD_CODE type SOTR_CONC value '1F47B9514EDAE054E1000000AC13310E'.
"#EC NOTEXT
constants NO_DATA_SP type SOTR_CONC value '1F49B9514EDAE054E1000000AC13310E'. "#EC
NOTEXT
constants NO_ORDER_DATA_SP type SOTR_CONC value '2248B9514EDAE054E1000000AC13310E'.
"#EC NOTEXT
data REQUEST type RSREQUEST .
data PACKET type RSDATAPID .
data RECORD type RSARECORD .
data SDORDER type /BI0/OIDOC_NUMBER .
data SDORDERLINE type /BI0/OIS_ORD_ITEM .
data GT_BSARKSD type /BI0/OIGT_BSARKSD .
data DISTR_CHAN type /BI0/OIDISTR_CHAN .

 

Exception is raised in a method ZCL_BW_SD_CODE->GET_ORDERS

 

methods GET_ORDERS
importing
!I_T_SP type ANY TABLE
!I_PACKET type RSDATAPID
raising
resumable(ZCX_BW_SD_CODE) .

 

METHOD get_orders.
...
IF i_t_sp IS INITIAL.
RAISE EXCEPTION TYPE zcx_bw_sd_code
EXPORTING
textid = zcx_bw_sd_code=>no_data_sp
packet = i_packet.
ELSE.
...
ENDMETHOD.

 

I'm calling this method in the start routine of a BW 7.0 Transformation.

 

...

    DATA: gl_cx TYPE REF TO zcx_bw_sd_code,
                gcl_sdcode TYPE REF TO zcl_bw_sd_code.
    DATA: gv_text TYPE string.

....

* Load Sale Order
lookup table in SD code class
TRY.
CALL METHOD gcl_sdcode->get_orders
EXPORTING
i_t_sp = SOURCE_PACKAGE[]
i_packet = datapackid.
* If there is no SD Order data selected than raise an error.
*Always need to have reference SD order data and data in Source Package.

CATCH zcx_bw_sd_code INTO gl_cx. <-----NOT CATCHING THE EXCEPTION HERE
gv_text = gl_cx->get_text( ).

monitor_rec-msgid = 'Z001'.
monitor_rec-msgty = 'I'.
monitor_rec-msgno = 040.
monitor_rec-msgv1 = gv_text.
APPEND monitor_rec TO MONITOR
RAISE EXCEPTION TYPE CX_RSROUT_ABORT.
ENDTRY.

...

If I type gl_cx as cx_root the it catches but I'm not sure why it won't catch zcx_bw_sd_code.  Thank you in advance for any help.

Regards,

Dae Jin


Viewing all articles
Browse latest Browse all 8332

Trending Articles