cancel
Showing results for 
Search instead for 
Did you mean: 

need class to create task

Former Member
0 Kudos

HI experts:

I need some classes to create task in cproject 4.5 .

I used BAPI to create task ,but three are multiple transaction with DB , then pool performance.

I had asked this question to Simon who come from Germany sap company Headquarters , he advanced me to use class to create task,and this mechanism will reduce transaction with DB .

But I can not find suitable Class , other words , I need example to create task through class.

please help me .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

yudong,

Unfortunately I can't give you the code example but I can give you the information so that you can write the code yourself.

1. Get instance of CL_DPR_APPL_OBJECT_MANAGER. Load phase using method LOAD_PHASES method.

2. Get the instance of phase class CL_DPR_PHASE from Load_phases method.

3. Get the instance of CL_DPR_TASKS by reading public instance attribute MR_TASKS of instance of CL_DPR_PHASE .

4. Use method ADD to add new task and get the instance of CL_DPR_TASK.

5. Use methods ( like SET_DATA_EXT) of CL_DPR_TASK to set the data of the task.

6. Use method IF_DPR_PROVIDER_TRANSACTION~DO_SAVE of CL_DPR_APPL_OBJECT_MANAGER.

Answers (1)

Answers (1)

former_member201206
Active Contributor
0 Kudos

Hi Yudong,

The BAPI is the best way to create a task from external, thouhg it may take some CPU time.

I really donot recommend you to call the class to do it. Anyway if you want to do it, you can set the break-point of cl_dpr_task_o, method constructor. Create a task from web-ui and check, which other classes are involved. I do think, it is a complex and unstable way to do it.

Kind regards,

Zhenbo

Former Member
0 Kudos

code example please