REPORT try_catch.
DATA :
vg_value TYPE i,
vg_string TYPE string VALUE 'ABC',
vg_cont TYPE i,
it_mara TYPE TABLE OF mara,
vg_where TYPE string VALUE 'VBELN = VG_STRING'.
DO 3 TIMES.
BREAK-POINT.
vg_cont = vg_cont + 1.
TRY.
CASE vg_cont.
WHEN 1.
vg_value = 1 / 0 .
EXIT.
WHEN 2.
vg_value = 1 * vg_string .
EXIT.
WHEN 3.
SELECT *
FROM mara
INTO TABLE it_mara
WHERE (vg_where) .
EXIT.
ENDCASE.
CATCH cx_sy_zerodivide.
MESSAGE 'xxx' TYPE 'I'.
CATCH cx_sy_conversion_no_number.
MESSAGE 'yyy' TYPE 'I'.
CATCH cx_sy_dynamic_osql_semantics.
MESSAGE 'zzz' TYPE 'I'.
BREAK-POINT.
ENDTRY.
ENDDO.
Serkan AKKAVAK
Computer Engineer
serkurumsal@yandex.com
Social Plugin