Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Handling exception

Former Member
0 Likes
495

I am executing a function module to find classification data

CLAF_CLASSIFICATION_OF_OBJECTS

which gives me a dump for

RAISE NO_CLASSIFICATION

how to handle such exceptions. I am new to exception handling so could someone help me with the code.

Thank you

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
433

Hi,

Try giving the exceptions when calling the function module..

Ex..


CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
  EXPORTING
*   CLASS                      = ' '
*   CLASSTEXT                  = 'X'
    classtype                  =
*   CLINT                      = 0
*   FEATURES                   = 'X'
*   LANGUAGE                   = SY-LANGU
    object                     =
*   OBJECTTABLE                = ' '
*   KEY_DATE                   = SY-DATUM
*   INITIAL_CHARACT            = 'X'
*   NO_VALUE_DESCRIPT          =
*   CHANGE_SERVICE_CLF         = 'X'
*   INHERITED_CHAR             = ' '
*   CHANGE_NUMBER              = ' '
  tables
    t_class                    =
    t_objectdata               =
*   I_SEL_CHARACTERISTIC       =
*   T_NO_AUTH_CHARACT          =
 EXCEPTIONS
   NO_CLASSIFICATION          = 1
   NO_CLASSTYPES              = 2
   INVALID_CLASS_TYPE         = 3
   OTHERS                     = 4
          .

Thanks

Naren

2 REPLIES 2
Read only

Former Member
0 Likes
434

Hi,

Try giving the exceptions when calling the function module..

Ex..


CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
  EXPORTING
*   CLASS                      = ' '
*   CLASSTEXT                  = 'X'
    classtype                  =
*   CLINT                      = 0
*   FEATURES                   = 'X'
*   LANGUAGE                   = SY-LANGU
    object                     =
*   OBJECTTABLE                = ' '
*   KEY_DATE                   = SY-DATUM
*   INITIAL_CHARACT            = 'X'
*   NO_VALUE_DESCRIPT          =
*   CHANGE_SERVICE_CLF         = 'X'
*   INHERITED_CHAR             = ' '
*   CHANGE_NUMBER              = ' '
  tables
    t_class                    =
    t_objectdata               =
*   I_SEL_CHARACTERISTIC       =
*   T_NO_AUTH_CHARACT          =
 EXCEPTIONS
   NO_CLASSIFICATION          = 1
   NO_CLASSTYPES              = 2
   INVALID_CLASS_TYPE         = 3
   OTHERS                     = 4
          .

Thanks

Naren

Read only

Former Member
0 Likes
433

When you insert the function call using the pattern button in SE38, you will get the exceptions and optional parameters commented out. Uncomment the exceptions and also the following sy-subrc check. See below.


 EXCEPTIONS
   NO_CLASSIFICATION          = 1
   NO_CLASSTYPES              = 2
   INVALID_CLASS_TYPE         = 3
   OTHERS                     = 4
          .
IF sy-subrc <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.