Skip to Content
author's profile photo Former Member
Former Member

How to access CCM Data from external applications?

Hi All,

What are the RFC's / BAPI's that I can use to access data of CCM from external applications? I tried to look at the function modules, but somehow its not as clear as what it would be R/3.

I am looking for getting information regarding Catalogs, list of items, item details etc.

Please help.

regards,

Ravi

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 16, 2006 at 11:23 AM

    Hi Ravi,

    The CCM is developed in ABAP Object, I think it is the reason why you found it "difficult".

    The main class to use for getting catalog content is <b>/CCM/CL_CATALOG_MANAGER</b>.

    Here is a sample code for getting catalog items (items from a specific category in may case)

    FUNCTION ZCA_CTLG_ERRORS_GET.
    *"----------------------------------------------------------------------
    *"*"Interface locale :
    *"  IMPORTING
    *"     VALUE(CATALOG_ID) TYPE  /CCM/OBJECT_ID
    *"     VALUE(ERROR_CATEGORY_ID) TYPE  /CCM/OBJECT_ID DEFAULT 'DUMMY'
    *"     VALUE(ERROR_CHAR_ID) TYPE  /CCM/OBJECT_ID DEFAULT 'ZERREURS'
    *"  TABLES
    *"      RESULT STRUCTURE  ZCA_ERRORS OPTIONAL
    *"  EXCEPTIONS
    *"      WRONG_CTLGID
    *"      WRONG_CATEGORYID
    *"----------------------------------------------------------------------
    
    DATA: CATALOG_MANAGER   TYPE REF TO /CCM/CL_CATALOG_MANAGER,
          SCHEMA_MANAGER    TYPE REF TO /CCM/CL_SCHEMA_MANAGER,
          SCHEMA_REQ_DATA   TYPE /CCM/S_SCHEMA_HEADER_API_X,
          SCHEMA_DATA       TYPE /CCM/S_SCHEMA_HEADER_API,
          ERROR_CATEGORY    TYPE /CCM/S_OBJECT_EXT_ID,
          CATEGORY_REQ_DATA TYPE /CCM/S_CATEGORY_API_X,
          CATEGORY_DATA     TYPE /CCM/S_CATEGORY_API,
          ITEM_MANAGER      TYPE REF TO /CCM/CL_ITEM_MANAGER,
          ITEM_LIST         TYPE /CCM/T_COMPONENT_API,
          WA_ITEM           TYPE /CCM/S_COMPONENT_API,
          WA_CHAR           TYPE /CCM/S_CHAR_VALUE_API.
    
    
    
    data: WA_RESULT    type ref to ZCA_ERRORS.
    
    data: IS_REQ_DATA  TYPE /CCM/S_COMPONENT_API_X value ' X '.
    
    
    refresh result.
    *Create Catalog Manager
    TRY.
        CALL METHOD /CCM/CL_CATALOG_MANAGER=>CREATE_MANAGER
          EXPORTING
            IV_PROCESS        = 'AI'
            IV_CATALOG_ID     = CATALOG_ID
    *    IV_CATALOG_GUID   =
    *    IT_VIEW_GUID      =
    *    IT_VIEW_ID        =
            IV_ACTIVE_VERSION = 'X'
          RECEIVING
            RESULT            = CATALOG_MANAGER
            .
      CATCH /CCM/CX_OBJECT_NOT_FOUND .
      raise wrong_ctlgid.
      CATCH /CCM/CX_MNGR_CREATION_FAILED .
    ENDTRY.
    
    *Get Catalog Schema manager
    TRY.
    CALL METHOD CATALOG_MANAGER->GET_SCHEMA_MANAGER
    *  EXPORTING
    *    IV_SCHEMA_TYPE = '01'
      RECEIVING
        RESULT         = SCHEMA_MANAGER
        .
     CATCH /CCM/CX_MNGR_CREATION_FAILED .
    ENDTRY.
    
    *Get Schema data
    TRY.
    CALL METHOD SCHEMA_MANAGER->GET_SCHEMA_DATA
      EXPORTING
    *    IV_GUID           =
    *    IS_ID             =
        IV_DEFAULT_SCHEMA = ABAP_TRUE
    *    IS_LOCALE         =
        IS_REQ_DATA       = SCHEMA_REQ_DATA
    *    IV_WITH_DELETED   = ABAP_TRUE
      RECEIVING
        RESULT            = SCHEMA_DATA
        .
     CATCH /CCM/CX_OBJECT_NOT_FOUND .
     CATCH /CCM/CX_OBJECT_READ_FAILED .
    ENDTRY.
    
    move: ERROR_CATEGORY_ID to ERROR_CATEGORY-ID,
          SCHEMA_DATA-GUID  to ERROR_CATEGORY-CONTEXT.
    
    *Get My Category data
    TRY.
    CALL METHOD SCHEMA_MANAGER->GET_CATEGORY_DATA
      EXPORTING
    *    IV_GUID         =
        IS_ID           = ERROR_CATEGORY
    *    IS_LOCALE       =
    *    IV_ASPECT       =
        IS_REQ_DATA     = CATEGORY_REQ_DATA
    *    IV_WITH_DELETED = ABAP_TRUE
      RECEIVING
        RESULT          = CATEGORY_DATA
        .
     CATCH /CCM/CX_OBJECT_NOT_FOUND .
       raise wrong_categoryid.
     CATCH /CCM/CX_OBJECT_READ_FAILED .
    ENDTRY.
    
    
    *Get Item manager
    TRY.
        CALL METHOD CATALOG_MANAGER->GET_ITEM_MANAGER
    *  EXPORTING
    *    IV_ITEM_TYPE = '01'
          RECEIVING
            RESULT       = ITEM_MANAGER
            .
      CATCH /CCM/CX_MNGR_CREATION_FAILED .
    ENDTRY.
    
    
    *Get all items from my category
    TRY.
    CALL METHOD ITEM_MANAGER->GET_ITEMS_BY_CATEGORY
      EXPORTING
        IV_CATEGORY_GUID  = CATEGORY_DATA-GUID
    *    IS_LOCALE         =
    *    IV_ASPECT         =
    *    IV_FROM_POS       =
    *    IV_MAX_HITS       =
        IS_REQ_DATA       = IS_REQ_DATA
    *    IV_WITH_DELETED   = ABAP_TRUE
    *    IV_EXP_CHAR_VALUE = ABAP_FALSE
      RECEIVING
        RESULT            = ITEM_LIST
        .
     CATCH /CCM/CX_OBJECT_READ_FAILED .
     CATCH /CCM/CX_OBJECT_NOT_FOUND .
    ENDTRY.
    
    *TRY.
    *    CALL METHOD ITEM_MANAGER->GET_ALL_ITEMS
    *      EXPORTING
    **    IS_LOCALE         =
    **    IV_ASPECT         =
    *        IS_REQ_DATA       =  IS_REQ_DATA
    **    IV_WITH_DELETED   = ABAP_TRUE
    **    IV_EXP_CHAR_VALUE = ABAP_FALSE
    *      RECEIVING
    *        RESULT            = ITEM_LIST
    *        .
    *  CATCH /CCM/CX_OBJECT_NOT_FOUND .
    *  CATCH /CCM/CX_OBJECT_READ_FAILED .
    *ENDTRY.
    
    loop at ITEM_LIST into WA_ITEM.
    
    * Fill the export table with my required data
      loop at WA_ITEM-CHAR_VALUE_TAB into WA_CHAR
      where ID-ID EQ ERROR_CHAR_ID.
    
        read table RESULT REFERENCE INTO WA_RESULT
        with key ID = WA_ITEM-ID
        VALUE_INDEX = WA_CHAR-VALUE_INDEX.
        if sy-subrc NE 0.
          move: WA_ITEM-ID           to RESULT-id,
                WA_CHAR-VALUE_INDEX  to RESULT-VALUE_INDEX.
          append RESULT  REFERENCE INTO WA_RESULT.
        endif.
    
        case WA_CHAR-COMP_INDEX.
          when 1.
            move WA_CHAR-VALUE to WA_RESULT->ERROR_TYPE.
          when 2.
            move WA_CHAR-VALUE to WA_RESULT->ERROR_NB.
          when 3.
            move WA_CHAR-VALUE to WA_RESULT->ERROR_TEXT.
        endcase.
    
    
      endloop.
    endloop.
    
    
    
    ENDFUNCTION.

    Have fun.

    Vadim.

    PS: Please don't forget rewarding for answers on your threads

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Vadim,

      I was expecting SAP to give some standard BAPI's so that we don't have to do all this. Anyways as SAP has not given anything like that, I guess we have no other go.

      I am traditionally an ABAPer for last 8 years and ABAP objects is no big deal. In fact I did look into those classes.

      Thanks a lot for your detailed answer.

      Regards,

      Ravi

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.