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: 

FM CLAF_CLASSIFICATION_OF_OBJECTS

0 Kudos
2,089

Trying to use this FM, if I run the FM in se37 it returns results.

If I run this code with the same inputs, it doesn't return anything. Why would it work in the test but not in code? Subrc is returning 1.

DATA: lv_sclass   TYPE TABLE OF sclass,
      lv_clobjdat TYPE TABLE OF clobjdat WITH HEADER LINE.


CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
  EXPORTING
    classtype          = '001'
    features           = 'X'
    object             = 'testcomp'
    objecttable        = 'MARA'
    initial_charact    = 'X'
  TABLES
    t_class            = lv_sclass
    t_objectdata       = lv_clobjdat
  EXCEPTIONS
    no_classification  = 1
    no_classtypes      = 2
    invalid_class_type = 3
    OTHERS             = 4.

IF sy-subrc = 0.
  LOOP AT lv_clobjdat.
    WRITE: / 'SPR_PKG_TYPE =',lv_clobjdat-ausp1.
  ENDLOOP.
ENDIF.<br>
1 ACCEPTED SOLUTION

Ryan-Crosby
Active Contributor
1,984

If I had to venture a guess which is all anyone can do without knowing your system data it would be on account of the object = 'testcomp'. In SE37 the system will convert fields to upper case unless you select the option for lower case, which give you a different result than this code here.

Regards,

Ryan Crosby

1 REPLY 1

Ryan-Crosby
Active Contributor
1,985

If I had to venture a guess which is all anyone can do without knowing your system data it would be on account of the object = 'testcomp'. In SE37 the system will convert fields to upper case unless you select the option for lower case, which give you a different result than this code here.

Regards,

Ryan Crosby