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
Related Q&A from Matthew Billingham
An SAP user is trying to run a report in an SAP ALV Grid online and wants to know how to get the data in the report to appear along with the header. Continue Reading
An SAP user needs to transfer customer purchase order spreadsheet data to SAP VA01 to create a new sales order. Continue Reading
An SAP user needs information on how to change the password on several SAP user accounts from a central location. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.