cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Project Type of the Current Project from CL_DPR_SESSION_STATE

Former Member
0 Kudos

Hello All,

To get the Project type of the current project, I am using the "get_project_type" method of "CL_DPR_SESSION_STATE". This works perfectly in most of the scenarios, but when a project locked by user1 and user2 is trying to view the project, the above class does not return the required information! Has anyone come across this situation? If so, i would appreciate your help if you can point me to a class/method that can be use to determine the project type of the current project.

regards,

Gopal.

Accepted Solutions (0)

Answers (1)

Answers (1)

chromik_artur
Discoverer
0 Kudos

Hi,

try it about the reference to "if_dpr_common":

  DATA: lo_session_state    TYPE REF TO cl_dpr_session_state,
             lo_common           TYPE REF TO if_dpr_common,
             lo_manager          TYPE REF TO cl_dpr_appl_object_manager,

             l_proj_type            TYPE CGPL_OBJECT_TYPE,
             l_origin_guid_prj   TYPE dpr_tv_guid,
             lw_obj_event        TYPE dpr_ts_obj_event.

  lo_session_state = cl_dpr_session_state=>get_instance( ).
  lw_obj_event = lo_session_state->get_focusobject( ).
  lo_manager = cl_dpr_appl_object_manager=>get_instance( ).
  l_origin_guid_prj = lw_obj_event-root_guid.

  TRY.
      lo_common ?= lo_manager->mr_mapper->get_application_object_by_guid( l_origin_guid_prj ).
    CATCH cx_dpr_object_mapping_error.

     RETURN.

  ENDTRY.

  l_proj_type = lo_common->get_object_type( ).