SELECT SINGLE 'X'
FROM seoclass
WHERE clsname = 'CL_GUI_FRONTEND_SERVICES'
INTO @data(x).
CHECK sy-subrc = 0.
SELECT SINGLE @abap_true
FROM scarr
WHERE carrid = @carrier
INTO @DATA(exists).
IF exists = abap_true.
cl_demo_output=>display( |Carrier { carrier } exists in SCARR| ).
ELSE.
cl_demo_output=>display( |Carrier { carrier } does not exist in SCARR| ).
ENDIF.
CONSTANTS entry_exists TYPE abap_bool VALUE abap_true.
SELECT SINGLE @entry_exists
FROM seoclass
WHERE clsname = 'CL_GUI_FRONTEND_SERVICES'
INTO @DATA(answer_from_db).
IF answer_from_db = entry_exists.
WRITE 'Entry exists.' COLOR COL_POSITIVE.
ELSE.
WRITE 'Entry does not exist.' COLOR COL_NEGATIVE.
ENDIF.
[..]
CLASS-METHODS is_class_available
IMPORTING
class_name TYPE seoclsname
RETURNING
VALUE(result) TYPE abap_bool.
[..]
METHOD is_class_available.
CONSTANTS entry_exists TYPE abap_bool VALUE abap_true.
SELECT SINGLE @entry_exists
FROM seoclass
WHERE clsname = @class_name
INTO @result.
IF sy-subrc <> 0.
ENDIF.
ENDMETHOD.
[..]
IF lcl_test=>is_class_available( 'CL_GUI_FRONTEND_SERVICES' ) = abap_true.
WRITE 'Class exists.' COLOR COL_POSITIVE.
ELSE.
WRITE 'Class does not exist.' COLOR COL_NEGATIVE.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
5 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |