on 2007 Jul 18 11:23 PM
HI Gurus,
I am brand new to cProjects. I have a task like in cProjects project --> Tasks. if the user chnage one field then depending on that another field should populate in other tab field.
the web dynpro component for this is DPR_DET_DATA_TASK_O.
regards
Giri
Hi Giri,
There is a seperate forum for Cprojects.
Thanks
Anzy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The are several BADIs in SPRO for Cprojects.
You can put code in the CHANGE event for instance.
Accessing the CProject data takes a bit of time to understand.
There is a singleton that is the data manager.
You then ask to pass you the tasks.
from here you call a SET method to update task.
Try this abap to help learn the some of the cproject classes.
REPORT zcp_tool.
DATA:
lv_resp_role_guid TYPE DPR_TV_GUID,
lv_guid16 TYPE dpr_tv_entity_guid,
lv_guid32 TYPE dpr_tv_guid_bapi,
ls_proj_def_detail TYPE bapi_ts_project_def_detail,
ls_ci_ext TYPE ci_dpr_project .
DATA:
lT_PHASES TYPE DPR_TT_PHASES,
lr_phase type REF TO CL_DPR_PHASE ,
lT_TASKS TYPE DPR_TT_TASKS,
lr_task type REF TO cl_dpr_task,
lT2_TASKS TYPE DPR_TT_TASKS,
lS_PHASE_CHG TYPE DPR_TS_PHASE_CHG,
lS_PHASE_EXT TYPE DPR_TS_PHASE_EXT,
lS_PHASE_INT TYPE DPR_TS_PHASE_INT,
lS_TASK_CHG TYPE DPR_TS_TASK_CHG,
lS_TASK_EXT TYPE DPR_TS_TASK_EXT,
ls_TASK_INT TYPE DPR_TS_TASK_INT,
lt_project_phases TYPE dpr_tt_progphase_assignment,
ls_project_phase type DPR_TS_PROGPHASE_ASSIGNMENT ,
lS_PROJECT_CHG TYPE DPR_TS_PROJECT_CHG,
lS_PROJECT_INT TYPE DPR_TS_PROJECT_INT,
lT_BUPA_LINK_EXT TYPE DPR_TT_BUPA_LINK_EXT,
ls_BUPA_LINK_EXT TYPE DPR_TS_BUPA_LINK_EXT ,
ls_but000 type but000,
lt_name TYPE TABLE OF bapi_ts_name,
ls_name TYPE bapi_ts_name,
lt_description TYPE TABLE OF bapi_ts_description,
ls_description TYPE bapi_ts_description,
lt_status TYPE TABLE OF bapi_ts_status,
ls_status TYPE bapi_ts_status,
lv_partner type BU_PARTNER ,
lt_return TYPE TABLE OF bapiret2.
DATA:
lR_RESP_ROLE TYPE REF TO CL_DPR_PARTICIPANT,
lr_obj_mgr TYPE REF TO CL_DPR_APPL_OBJECT_MANAGER ,
lr_common TYPE REF TO if_dpr_common,
lr_project_o TYPE REF TO cl_dpr_project_o,
lr_phase_o TYPE REF TO cl_dpr_phase_o,
lr_task_o TYPE REF TO cl_dpr_task_o,
ls_attributes_ext TYPE dpr_ts_project_ext.
PARAMETERS: projguid TYPE guid_32.
PARAMETERS: projid TYPE dpr_project-project_id
MATCHCODE OBJECT zsh_dpr_project.
START-OF-SELECTION.
REFRESH: lt_return,
lt_name,
lt_description,
lt_status.
IF not projguid is initial.
lv_guid16 = projguid.
lv_guid32 = projguid.
else.
SELECT SINGLE guid FROM dpr_project
INTO lv_guid16
WHERE project_id = projid.
lv_guid32 = lv_guid16.
ENDIF.
WRITE: / 'Project id', projid,
'Char GUID 32', lv_guid32.
lr_obj_mgr = CL_DPR_APPL_OBJECT_MANAGER=>get_instance( ).
lr_obj_mgr->load_application_objects(
EXPORTING
IV_GUID = lv_guid16
* IMPORTING
* ET_APPLICATION_OBJECTS = ET_APPLICATION_OBJECTS
* ET_LOCKED_APPLICATION_OBJECTS = ET_LOCKED_APPLICATION_OBJECTS
).
*lr_obj_mgr->get_project( IV_GUID = lv_guid16 ).
lr_common = lr_obj_mgr->get_application_object( IV_GUID = lV_GUID16
).
* Get attributes
lr_project_o ?= lr_common.
* CALL METHOD lr_project_o->get_data_ext
* EXPORTING
* iv_language = sy-langu
* IMPORTING
* es_project_ext = ls_attributes_ext.
*
** Names (Short texts)
* lt_name[] = cl_dpr_bapi_services=>get_names( lr_common ).
* LOOP AT lt_name INTO ls_name.
* WRITE: / 'Name', ls_name.
* ENDLOOP.
** descriptions
* lt_description[] = cl_dpr_bapi_services=>get_descriptions( lr_common
).
* LOOP AT lt_description INTO ls_description .
* WRITE: / 'Desc', ls_description.
* ENDLOOP.
*
** Status
* lt_status[] = cl_dpr_bapi_services=>get_status( lr_common ).
* LOOP AT lt_status INTO ls_status .
* WRITE: / 'Status', ls_status.
* ENDLOOP.
** Get message(s) for log
* lt_return[] = cl_dpr_bapi_services=>cgpl_log_to_bapi_return( ).
lr_project_o->get_data_ext(
IMPORTING
ES_PROJECT_CHG = lS_PROJECT_CHG
ES_PROJECT_EXT = ls_attributes_ext
ES_PROJECT_INT = lS_PROJECT_INT
).
write: / 'ECC Record GUID',
lS_PROJECT_CHG-extended_attributes-ZZCP_RECORDGUID.
* Responsibilities
* Get responsible role
lr_resp_role =
lr_project_o->mr_participant_links->get_responsible_role( ).
if lr_resp_role is bound.
* Get GUID of responsible role
lv_resp_role_guid = lr_resp_role->get_guid( ).
lr_resp_role->get_bupa_assignments(
IMPORTING
RT_BUPA_LINK_EXT = lT_BUPA_LINK_EXT
).
read table lT_BUPA_LINK_EXT index 1
into ls_BUPA_LINK_EXT.
SELECT single partner FROM but000 into lv_partner
WHERE partner_guid = ls_BUPA_LINK_EXT-BUPA_GUID.
endif.
CALL FUNCTION 'BAPI_BUS2172_GET_DETAIL'
EXPORTING
project_definition_guid = lv_guid32
IMPORTING
es_project_definition_detail = ls_proj_def_detail
* ES_EXTENSION_OUT = ES_EXTENSION_OUT
es_ci_project = ls_ci_ext.
lT_PHASES = lr_project_o->mr_phases->get_all( ).
*
lt_tasks = lr_project_o->mr_tasks->get_all( ).
break soadyp.
LOOP AT lT_PHASES INTO lr_phase .
lr_phase_o ?= lr_phase.
lr_phase_o->get_data_ext(
IMPORTING
ES_PHASE_CHG = lS_PHASE_CHG
ES_PHASE_EXT = lS_PHASE_EXT
ES_PHASE_INT = lS_PHASE_INT
).
* also get all tasks here.
lT2_TASKS = lr_phase_o->get_all_tasks( ).
APPEND LINES OF lT2_TASKS to lT_TASKS.
ENDLOOP.
LOOP AT lT_TASKS INTO lr_task .
lr_task_o ?= lr_task.
lr_task_o->get_data_ext(
IMPORTING
ES_TASK_CHG = lS_TASK_CHG
ES_TASK_EXT = lS_TASK_EXT
ES_TASK_INT = lS_TASK_INT
).
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
65 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.