Skip to Content

Read categorization schema

Hey there,

I'm trying to read a specific categorization schema within CRM Interaction Center.

Does anybody know a function module or some specific tables I can read?

Many thanks for your help in advanced.

Robert

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 19, 2013 at 06:23 AM

    Hello Robert,

        I have a similar requirement where you able to figure it out how to read categorization schema

        at interaction center?

    Regards

    Najm

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 03, 2012 at 02:46 AM

    Hi,

    use the below code if its in gui,

       *data declarations
    DATA : lv_guid       TYPE crmd_orderadm_h-guid,
           lr_aspect     TYPE REF TO if_crm_erms_catego_aspect,
           lr_category   TYPE REF TO if_crm_erms_catego_category,
           lr_categories TYPE REF TO data,
           ls_cat_lang   TYPE crmt_erms_cat_ca_lang,
           lv_cat_string TYPE string,
           lt_guid       TYPE crmt_object_guid_tab,
           lt_subject    TYPE crmt_subject_wrkt,
           ls_subject    TYPE crmt_subject_wrk,
           BEGIN OF ls_catid,
           catid         TYPE crm_erms_cat_ca_id,
           END OF ls_catid,
           lt_catid      LIKE TABLE OF ls_catid.

    TYPES: ty_categories_tab_type TYPE TABLE OF  REF TO if_crm_erms_catego_category.
    FIELD-SYMBOLS: <fs_categories> TYPE ty_categories_tab_type.



    PARAMETERS : objid TYPE crmd_orderadm_h-object_id DEFAULT '8000001570'.

    SELECT SINGLE guid FROM crmd_orderadm_h INTO lv_guid WHERE object_id = objid.


    CREATE DATA lr_categories TYPE ty_categories_tab_type.

    CALL METHOD cl_crm_ml_category_util=>get_categoryfirst
      EXPORTING
        iv_ref_guid     = lv_guid
        iv_ref_kind     = 'A'
        iv_catalog_type = 'D'
      IMPORTING
        er_aspect       = lr_aspect
        er_category     = lr_category.


    CALL METHOD cl_crm_ml_category_util=>get_cat_pars_all
      EXPORTING
        ir_aspect     = lr_aspect
        ir_category   = lr_category
      IMPORTING
        er_categories = lr_categories.

    ASSIGN lr_categories->* TO <fs_categories>.

    SORT <fs_categories>.
    LOOP AT <fs_categories> INTO lr_category.
      CALL METHOD lr_category->get_details
        IMPORTING
          ev_cat_lang = ls_cat_lang.
      ls_catid-catid = ls_cat_lang-cat-cat_id.
      APPEND ls_catid TO lt_catid.
      CLEAR : ls_catid.
    ENDLOOP

    if you want to read it in  UI of service request component,

      

    * get category assigned in service request
      lr_adminh ?= me->typed_context->btadminh->collection_wrapper->get_current( ).
      IF lr_adminh IS BOUND.
        lr_coll = lr_adminh->get_related_entities( iv_relation_name = 'BTHeaderCategorySet' ).
      ENDIF.
      CHECK lr_coll IS BOUND.
      lr_hdr_cat ?= lr_coll->get_current( ).
      CHECK lr_hdr_cat IS BOUND.
      CLEAR lr_coll.
      IF lr_hdr_cat IS BOUND.
        lr_coll = lr_hdr_cat->get_related_entities( iv_relation_name = 'BTCategorySchemaAll' ).
      ENDIF.
      CHECK lr_coll IS BOUND.
      lr_cat_schma ?= lr_coll->get_current( ).
      WHILE lr_cat_schma IS BOUND.
        CALL METHOD lr_cat_schma->if_bol_bo_property_access~get_property_as_string
          EXPORTING
            iv_attr_name = 'ASP_ID'
          RECEIVING
            rv_result    = lv_aspid.
        IF lv_aspid EQ 'STC_SR_CATEGORIES'.
          EXIT.
        ELSE.
          lr_cat_schma ?= lr_coll->get_next( ).
        ENDIF.
      ENDWHILE.
      CLEAR lr_coll.
      IF lr_cat_schma IS BOUND.
        lr_coll = lr_cat_schma->get_related_entities( iv_relation_name = 'BTCategoryFirst_S' ).
      ENDIF.
      CHECK lr_coll IS BOUND.
      lr_cat_first ?= lr_coll->get_current( ).
      CHECK lr_cat_first IS BOUND.

      DATA : ls_category TYPE crmst_category_btil.
      CALL METHOD lr_cat_first->if_bol_bo_property_access~get_properties
        IMPORTING
          es_attributes = ls_category. "Category guid

    Add comment
    10|10000 characters needed characters exceeded