Application Development 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: 

How to access linked objects in SCASE TCode through code

former_member604288
Discoverer
0 Kudos

Hello All,

I have a requirement where I need to check whether there is any linked objects present in a created case in SCASE. Is there any function that will give me the answer to this? I only need this for Linked Objects and not notes. Please help.

Regards,

Ritam

1 ACCEPTED SOLUTION

maheshpalavalli
Active Contributor
0 Kudos

Hi Ritam Banerjee,

first you need to get the case instance, get the backend record model and then get all the elements:


  CALL METHOD cl_scmg_case_api=>if_scmg_case_api~open_case

    EXPORTING

      im_case_guid      = iv_case_guid

      im_enqueue        = ' '

    RECEIVING

      re_case           = lo_case_api

    EXCEPTIONS

      failed            = 1

      enqueue_failed    = 2

      invalid_guid      = 3

      cx_srm_gsp_back   = 4

      no_authority      = 5

      illegal_case_type = 6

      OTHERS            = 7.




  CALL METHOD lo_case_api->get_backend_record

    RECEIVING

      re_record_backend = lo_record_backend

    EXCEPTIONS

      OTHERS            = 1.




      CALL METHOD lo_record_backend->element_get_by_type

        EXPORTING

          type        = 'INSTANCE'

        RECEIVING

          element_tab = lt_case_elements.

BR,

Mahesh

3 REPLIES 3

maheshpalavalli
Active Contributor
0 Kudos

Hi Ritam Banerjee,

first you need to get the case instance, get the backend record model and then get all the elements:


  CALL METHOD cl_scmg_case_api=>if_scmg_case_api~open_case

    EXPORTING

      im_case_guid      = iv_case_guid

      im_enqueue        = ' '

    RECEIVING

      re_case           = lo_case_api

    EXCEPTIONS

      failed            = 1

      enqueue_failed    = 2

      invalid_guid      = 3

      cx_srm_gsp_back   = 4

      no_authority      = 5

      illegal_case_type = 6

      OTHERS            = 7.




  CALL METHOD lo_case_api->get_backend_record

    RECEIVING

      re_record_backend = lo_record_backend

    EXCEPTIONS

      OTHERS            = 1.




      CALL METHOD lo_record_backend->element_get_by_type

        EXPORTING

          type        = 'INSTANCE'

        RECEIVING

          element_tab = lt_case_elements.

BR,

Mahesh

0 Kudos

Thanks Mahesh. That solved my problem.

0 Kudos

You are most welcome. and Ritam.

I've some queries regarding the case management. if possible could you pls share your linkedin or mail id to me at https://messages.sap.com .

BR,

Mahesh