cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to read 'Responsible Resource' in program

Former Member
0 Kudos
296

Hello,

I have project guid with me, i need to read the responsible resource ( not the role ).

Could any one guide me on how to do it. I could see the roles and the participant guids in BUS2177 but have no idea how to get the responsible resource.

Accepted Solutions (0)

Answers (2)

Answers (2)

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Kudos

It seems the following worked for me. You may need to tidy up the code.


  DATA gr_dpr_objman TYPE REF TO cl_dpr_appl_object_manager .

  DATA lt_projects TYPE dpr_tt_project_db .
  DATA ls_project LIKE LINE OF lt_projects .
  DATA lt_proj_ref TYPE dpr_tt_guid_project_defs .

  DATA lr_common      TYPE REF TO if_dpr_common .
  DATA lr_participant_links TYPE REF TO cl_dpr_participant_links .
  DATA lt_partc_obj_all TYPE TABLE OF REF TO cl_dpr_entity_link .
  DATA lr_partc_entity TYPE REF TO cl_dpr_entity_link .
  DATA lr_participant TYPE REF TO cl_dpr_participant .

  DATA lv_bupa_from_partc TYPE bu_partner_guid .
  DATA lv_objid_bp LIKE but000-partner .
  DATA lv_objid_cp LIKE p1000-objid .
  DATA lv_objid_us LIKE p1001-sobid .
  DATA lv_sobid LIKE p1001-sobid .


* Get instance of object manager
  gr_dpr_objman = cl_dpr_appl_object_manager=>get_instance( ) .

*       Project
  CALL METHOD gr_dpr_objman->load_projects
    EXPORTING
      iv_guid        = p_guid
      iv_change_mode = space
    IMPORTING
      et_projects    = lt_proj_ref[].

  READ TABLE lt_proj_ref INTO ls_proj_ref INDEX 1 .

  CLEAR: lv_bupa_from_partc .

  CHECK ls_proj_ref-reference IS BOUND .

  lr_common = ls_proj_ref-reference .


  CHECK lr_common IS BOUND .

  lr_participant_links =
        cl_dpr_common_services=>get_participant_links(
                                    ir_common = lr_common ).

  CHECK lr_participant_links IS BOUND .

  lt_partc_obj_all = lr_participant_links->get_all( ) .

  LOOP AT lt_partc_obj_all INTO lr_partc_entity .

    IF lr_partc_entity->is_responsible( ) = 'X'.
      lr_participant = lr_partc_entity->get_parent_participant( ) .
      IF lr_participant->is_concrete( ) = 'X' .
        lv_bupa_from_partc = lr_participant->get_partner_guid( ) .
        EXIT .
      ENDIF .

    ENDIF .

  ENDLOOP .

  CHECK NOT lv_bupa_from_partc IS INITIAL .

  SELECT SINGLE partner
         FROM but000
         INTO lv_objid_bp
         WHERE partner_guid = lv_bupa_from_partc .

  lv_sobid = lv_objid_bp .

  SELECT SINGLE objid
         FROM hrp1001
         INTO lv_objid_cp
         WHERE ."... (conditions for BP-CP relation)


  SELECT SINGLE sobid
         FROM hrp1001
         INTO lv_objid_us
         WHERE ."... (conditions for CP-US relation)

former_member209919
Active Contributor
0 Kudos

Hello,

This information is stored in DPR-DASHBOARD table RESPONSIBLES field.

Sara