SAP cProjects复制:设置任务级别WBS
在cProjects中创建项目时,我使用SAP cProjects复制:设置任务级别WBS,sap,abap,badi,Sap,Abap,Badi,在cProjects中创建项目时,我使用BADI-BADI-DPR\u-FIN\u-GECCO\u-ATTR操作在SAP PS中创建的外部WBS ID SAP接受我传递给阶段级别的ID,但对于任务级别,SAP在WBS ID的末尾附加了一个字符串“/TTO”。知道为什么会发生这种情况以及我如何摆脱它吗。“/TTO”违反或屏蔽PS中的结构 constants: lc_phase_id_ps type char30 value 'DPR_TV_PROJECT_ELEMENT_ID_PS',
BADI-BADI-DPR\u-FIN\u-GECCO\u-ATTR
操作在SAP PS中创建的外部WBS ID
SAP接受我传递给阶段级别的ID,但对于任务级别,SAP在WBS ID的末尾附加了一个字符串“/TTO”。知道为什么会发生这种情况以及我如何摆脱它吗。“/TTO”违反或屏蔽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: <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.
常数:lc\U阶段\U id\U ps类型char30值'DPR\U TV\U项目\U元素\U id\U ps',
lc_任务_id_co类型char30值“DPR_TV_项目_元素_id_co”。
字段符号:键入dpr\U ts\U项目\U ext,
输入dpr\u ts\u项目\u int,
输入dpr\u ts\u phase\u ext,
输入dpr\u ts\u phase\u int,
键入dpr\u ts\u task\u ext,
输入dpr\u ts\u task\u int,
键入dpr\u ts\u iaom\u object\u属性。
case ir\u common->get\u object\u type()。
当cl_dpr_co=>sc_ot_项目时。
“还没有对这些数据做任何事情
将ir_项目_ext->*分配给。
将ir_项目_int->*分配给。
当cl_dpr_co=>sc_ot_阶段时。
将ir_属性\u ext->*分配给。
将ir_属性\u int->*分配给。
读取表ct\U属性分配
关键数据\u元素=lc\u相位\u id\u ps。
如果sy subrc=0。
-value=-phase_id.“类似于Z/001-001
恩迪夫。
当cl_dpr_co=>sc_ot_任务时。
将ir_属性\u ext->*分配给。
将ir_属性\u int->*分配给。
读取表ct\U属性分配
关键数据元素=lc任务id公司。
如果sy subrc=0。
-value=-search\u字段。“类似于Z/001-001-001
“在本次badi呼叫后的某个时候,它被更改为Z/001-001-001/TTO
恩迪夫。
尾声。
我找到了SAP更改WBS的地方:
在ClassCL\u IM\u CPRO\u PROJECT\u LABEL
methodIF\u EX\u GCC\u PS\u PROJECT\u LABEL~GET\u WBS\u ELEMENT
中,存在以下逻辑:
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.
如果lv对象类型为“DPO”。
读取外部对象的表属性
转换为ls_属性
关键数据元素='DPR\U TV\U项目元素\U ID\U CO'。
如果sy subrc=0。
如果lv_对象_类型_co eq'TTO'或“Aufgabe”H860739
lv_对象_类型_co eq'ITO'。“Checklistenpunkt”H860739
连接ls_属性值“H860739
低压对象类型公司“H860739
转换为ls_值。"