cancel
Showing results for 
Search instead for 
Did you mean: 

Relationsships are not copying, not sure am I missing something?

former_member194142
Participant
0 Kudos

Hello,

RELATIONSSHIPs (predecessor / successor) are not copying when we COPY a task, say, task_1 has a processor under relationships tab and when user want to copy this task_1 into a new task (task_2), almost all the attributes are copying but the task_1's relationships are not copying into task_2, pl. let us know how can make relationships also will be copied into newly creating task for COPY button/function

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

former_member194142
Participant
0 Kudos

Any help pl.?

Thank you

hanspeterbaier
Active Participant
0 Kudos

Hi,

unfortunately it is not possible in SAP Standard (even release 6.1) to copy the relations to predecessor/successor elements when copying (or cut/paste) a task.

br,

Peter

former_member194142
Participant
0 Kudos

Thank you.

Then can I go ahead & achieve this requirement by calling the BAPI_BUS2175_RELATION_ADD, BAPI_CPROJECTS_COMMIT_WORK  in the CL_DPR_DEMO_SUBSYSTEM class (I mean custom class of this subsystem, say ZCL_DPR_DEMO_SUBSYSTEM) because as you know this subsystem will trigger just before the data base standard SAP's commit work statement

Pl. let us know is it safe / suggestible using these 2 BAPIs (incl. COMMIT WORK BAPI) in the subsystem class?

Regards

hanspeterbaier
Active Participant
0 Kudos

Hi,

you can do this with a Z-Subsystem. First of all you should use BAPI_BUS2172_LOAD with the project GUID and change-mode enabled (X). Then call BAPI_BUS2175_RELATION_ADD.


With the BAPI_CPROJECTS_COMMIT_WORK inside of Subsystems you should be very careful. If you use this within your Z-subsystem the BAPI_CPROJECTS_COMMIT_WORK (save-process) interrupts a running save process. cProjects does the COMMIT by itself, after all subsystems are processed. You can have a look to this COMMIT in CL_DPR_TRANSACTION_MANAGER/EXECUTE_SAVE.

Moreover with BAPI_CPROJECTS_COMMIT_WORK the method INITIALIZE_AFTER_SAVE (Z-subsystem and SAP-subsystems) is executed too early, resulting in initializing some data (inconsistencies, dumps).


To say it the short way: You should not call BAPI_CPROJECTS_COMMIT_WORK in your Z-subsystem, the COMMIT is done by cProjects-Standard.


br,

Peter

former_member194142
Participant
0 Kudos

Sure, Thank you

Pl. let us know in which method of the below list I need to place my code of calling the BAPI,

1 - INITIALIZE AFTER SAVE

2 - PREPARE TO SAVE

3 - SAVE

I'm guessing its SAVE method

hanspeterbaier
Active Participant
0 Kudos

Hi,

it depends on your implementation logic, but PREPARE_TO_SAVE (doing stuff like getting details) or SAVE is a good starting point. INITIALIZE_AFTER_SAVE is too late.

PREPARE_TO_SAVE has the advantage, that you can implement the logic and react on data inconsistencies before SAVE does the DB update process.

br,

Peter

Message was edited by: Hans-Peter Baier

former_member194142
Participant
0 Kudos

Thank you

Answers (0)