Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Google
 

Tuesday, December 27, 2011

SAP ABAP cProjects replication and Set task-level WBS

When creating a project in cProjects I am using BADI BADI DPR_FIN_GECCO_ATTR to manipulate the external WBS ID that is created in SAP PS.
SAP accepts the ID that I pass for the Phase level, but for the Task level SAP appends a string "/TTO" to the end of my WBS ID. Any idea why this happens and how I can get rid of it. The "/TTO" violates or masking structure in PS?

constants: lc_phase_id_ps type char30 value 'DPR_TV_PROJECT_ELEMENT_ID_PS',
           lc_task_id_co  type char30 value 'DPR_TV_PROJECT_ELEMENT_ID_CO'.

field-symbols:  type dpr_ts_project_ext,
                type dpr_ts_project_int,
                  type dpr_ts_phase_ext,
                  type dpr_ts_phase_int,
                   type dpr_ts_task_ext,
                   type dpr_ts_task_int,
                 type dpr_ts_iaom_object_attribute.

case ir_common->get_object_type( ).
  when cl_dpr_co=>sc_ot_project.
    "not doing anything with this data yet
    assign ir_project_ext->* to .
    assign ir_project_int->* to .  

  when cl_dpr_co=>sc_ot_phase.
    assign ir_attributes_ext->* to .
    assign ir_attributes_int->* to .
    read table ct_attributes assigning 
      with key data_element = lc_phase_id_ps.
    if sy-subrc = 0.
      -value = -phase_id.  "something like Z/001-001
    endif.

  when cl_dpr_co=>sc_ot_task.
    assign ir_attributes_ext->* to .
    assign ir_attributes_int->* to .
    read table ct_attributes assigning 
      with key data_element = lc_task_id_co.
    if sy-subrc = 0.
      -value = -search_field.  "something like Z/001-001-001
      "sometime after this badi call it is changed to Z/001-001-001/TTO
    endif.
endcase.
 
 
Answer:
I have found the spot where SAP changes the WBS:
In Class CL_IM_CPRO_PROJECT_LABEL method IF_EX_GCC_PS_PROJECT_LABEL~GET_WBS_ELEMENT there is the following logic:
if lv_object_type_co ne 'DPO'.
  read table attributes_of_ext_obj
       into ls_attribute
       with key data_element = 'DPR_TV_PROJECT_ELEMENT_ID_CO'.
  if sy-subrc = 0.
    if lv_object_type_co eq 'TTO' or     "Aufgabe            "H860739
       lv_object_type_co eq 'ITO'.       "Checklistenpunkt   "H860739
      concatenate ls_attribute-value                         "H860739 
                  lv_object_type_co                          "H860739
                  into ls_value.         "<<==Here it is     "H860739
      wbs_element = ls_value.                                "H860739
    else.                                                    "H860739
      wbs_element = ls_attribute-value.
    endif.                                                   "H860739
  else.
    message e013(iaom_cprojects)
      with 'DPR_TV_PROJECT_ELEMENT_ID_CO'
      raising error_occurred.
  endif.
  "...
  "... Code removed
endif.

 

No comments:

Post a Comment

Mega Search