cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Template name / or its GUID?

former_member194142
Participant
0 Kudos

Hello

I have Project GUID available in my program, now I need to get associated Template's description, pls. let me know how can I get associated template description by passing Project GUID?

Than you

Accepted Solutions (1)

Accepted Solutions (1)

TudorRiscutia
Active Participant
0 Kudos

Hi,

     It's farely easy:

     You get the instance of the CL_DPR_PROJECT_O class based on your Project GUID. And call the method ->GET_DATA_EXT importing ES_PROJECT_INT. This structure contains a component TEMPLATE_GUID (type DPR_TV_ENTITY_GUID).  Use this to load an instance of class CL_DPR_PROJECT_T (Template), and then call method ->GET_DESCRIPTION( ).

     If you don't know how to load a project instance, just copy-paste the following code:

data:
    lv_convert_guid
type dpr_tv_entity_guid.

  lo_project ?= cl_dpr_api_services
=>get_object_by_guid( iv_project_guid ).

  if lo_project is initial.
    lv_convert_guid
= iv_project_guid.
    cl_dpr_bapi_services
=>load_objects_of_object_type(
      
exporting
         iv_object_type    
= cl_dpr_co=>sc_ot_project
         iv_object_guid    
= lv_convert_guid
         iv_change_mode    
= cl_dpr_co=>sc_false ).

    lo_project ?= cl_dpr_api_services
=>get_object_by_guid( iv_project_guid ).
 
endif.

    

     Preferably, put this code inside a method and use the more generic CL_DPR_PROJECT.

     Hope this helps you!

Tudor

former_member194142
Participant
0 Kudos

Thank you.


You are awesome, your answer is in detail, I got some other knowledge (how to get Project instance, if it failed, how to get it from BASPI SERVICES,) as well, very good to know, Thank you very much

Regards

TudorRiscutia
Active Participant
0 Kudos

No problem,

We are struggling a lot with implementing PPM as well, mostly due to the fact there is no clear documentation. So it's really good to share knowledge!

Tudor

former_member194142
Participant
0 Kudos

Yes, almost same case with us, yes, very poor documentation, hmmm.

But, luckily as dead lines are coming closure our company engaged SAP consultants, hence now we are in good shape

Thank you

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

You can get description for template from cgpl_text by passing template GUID. However you have to first find out the template used to create operational project and then pass its GUID in cgpl_text. I am not sure if I understood the question right.

Regards.