首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SAP cProjects复制:设置任务级WBS

SAP cProjects复制:设置任务级WBS
EN

Stack Overflow用户
提问于 2011-09-23 06:41:03
回答 1查看 737关注 0票数 1

在cProjects中创建项目时,我使用BADI BADI DPR_FIN_GECCO_ATTR来操作在SAP中创建的外部WBS。

SAP接受我为阶段级别传递的ID,但是对于任务级别,SAP会在我的WBS ID的末尾附加一个字符串"/TTO“。"/TTO“是否违反了PS中的屏蔽结构?

代码语言:javascript
复制
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: <project_ext> type dpr_ts_project_ext,
               <project_int> type dpr_ts_project_int,
               <phase_ext>   type dpr_ts_phase_ext,
               <phase_int>   type dpr_ts_phase_int,
               <task_ext>    type dpr_ts_task_ext,
               <task_int>    type dpr_ts_task_int,
               <attributes>  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 <project_ext>.
    assign ir_project_int->* to <project_int>.  

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

  when cl_dpr_co=>sc_ot_task.
    assign ir_attributes_ext->* to <task_ext>.
    assign ir_attributes_int->* to <task_int>.
    read table ct_attributes assigning <attributes>
      with key data_element = lc_task_id_co.
    if sy-subrc = 0.
      <attributes>-value = <task_ext>-search_field.  "something like Z/001-001-001
      "sometime after this badi call it is changed to Z/001-001-001/TTO
    endif.
endcase.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-09-23 12:25:11

我已经找到了SAP更改WBS的地方:

在类CL_IM_CPRO_PROJECT_LABEL方法IF_EX_GCC_PS_PROJECT_LABEL~GET_WBS_ELEMENT中,有以下逻辑:

代码语言:javascript
复制
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.

这是GCC_PS_PROJECT_LABEL的标准BAdI实现的一部分。

我通过使用方法末尾的隐式增强点并在那里重置WBS元素来增强方法,从而解决了这个问题。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7522305

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档