Problem solve Get help with specific problems with your technologies, process and projects.

Saving a project with customized modifications

I'm working with SAP v.4.6C, on the PS module.

The standard reaction of TA CJ27 or CJ2B (creating a project or modifying a project) is to leave the TA after the project is saved. My question is how to save a project without leaving these transactions with a standard modification (i.e. adding a button with the function linked.)

I did a modification of the program LCJGRF0O line 1275 just after the SAVE OK-CODE for this function using a Function Module.
In this function module, I use the instruction
"PERFORM cjtr_save(saplcjtr) USING ' '."
(include program LCJGRF4Y line 63) that save correctly the project but it also clear and refresh some internal tables like "afvg_bt" and others. This cause the project to be no more modified again (for example if I try to change the length of an activity I have a message saying "Activities are not locked. Should they be locked?" and modifications are not possible anymore.) I thought the Function Module 'CJDT_NZTAB_CREATE' could help but I did not find a solution. Can you help?

Naturally, modifying a standard SAP program is 'at your own risk'. You don't mention why you need to modify the behavior in this manner, so I'll give you a purely technical response.

Where you process the function code of your new button 'Save without quitting', use EXPORT to MEMORY to place a flag in memory, plus the project definition name.

Next write an executable ABAP, which sets the PID for the project definition name, and then does CALL TRANSACTION CJ2B ... SKIPP FIRST SCREEN

You can then make a further mod, just before the standard code in CJ2B or CJ27 performs the LEAVE statement to quit the transaction. In this mod, use IMPORT to check the status of the flag you put there when the button was pressed. If the flag is not set, then processing continues as normal. If it is set, FREE the memory id, and then use SUBMIT to call your executable ABAP.

This should then duplicate the effect you are trying to achieve.

The reason that you need to use SUBMIT rather than CALL TRANSACTION, is that in the latter, when the transaction ends, processing will continue in CJ2B or CJ27.

Dig Deeper on SAP ABAP

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.