2012 Jun 26 12:13 PM
Hello Experts,
This is my first ever post on this site, till now i got everything i needed from here but now i need some advice from you all.
I need to do program or task in which if user inputs any string or name (eg: z_tab1, or z_prog1 etc) then search the entire directory to see if any object or anything exists related to that given input string.
Till now its fine and i did this using tadir and tdevc but next part is like after getting the result user should be able to rename it.
So problem is coming in 2nd part, RENAME.
In tadir directory i cant edit the obj_name as its primary key.
Please help me with this.
Sorry if anything is wrong as its my first time here.
Thanks in advance.
Ankur.
2012 Jun 26 3:01 PM
Hi,
I found the following objects that could be useful in your process. But as I found out this is a bit tedious job to simulate the entire process into a custom code. Good luck though
Copy Domain: DDUT_OBJECT_COPY
Rename FM: RS_FUNCTION_RENAME
Class for Transport Request: CL_WB_REQUEST
Cheers
Vivekananda Rao
Message was edited by: Vivekananda Rao
2012 Jun 26 12:40 PM
So, what do you do after rename? I can just imagine all those tables that will require adjustment, due to changed fieldnames, programs that suddenly start abending, since the fields have been changed, etc. This sounds like a disaster in progress to me.
2012 Jun 26 12:45 PM
Hey Break Point,
I know and am aware of the consequences, but this is what i need. Please give suggestions.
2012 Jun 26 12:56 PM
2012 Jun 26 1:09 PM
Hello Yogendra,
The problem is, how to do it. i can have function module to rename message class, program name etc but what about domain, tables etc. How to do that.
Please suggest.
2012 Jun 26 1:25 PM
IMHO, you should not look for rename function modules but for copy, activate and delete function modules for each type of object, not forgeting the FM required to manage the transport request...
Example, Domain : RS_DD_COPY, RS_DD_ACTIVATE and RS_DD_DELETE.
You could use a tool like SAT (old SE30) to analyze execution of SE11, SE38 or SE24 type of transactions to find the FM required.
Hint: Once you get some FM names, you could perform some where-used to find report includes like LSEAPFAP (Function Group SEAP) which call those and analyze this FM looking for a form like rename_object and similar forms.
Regards,
Raymond
2012 Jun 26 1:40 PM
Thanks Break point, Yogendra and Raymond for quick replies.
Hello Raymond,
i tried to debug the process of renaming program. But i need to look more into it, till then if you get something than please do share.
2012 Jun 26 3:01 PM
Hi,
I found the following objects that could be useful in your process. But as I found out this is a bit tedious job to simulate the entire process into a custom code. Good luck though
Copy Domain: DDUT_OBJECT_COPY
Rename FM: RS_FUNCTION_RENAME
Class for Transport Request: CL_WB_REQUEST
Cheers
Vivekananda Rao
Message was edited by: Vivekananda Rao
2012 Jun 27 5:03 AM
Thanks Vivekananda Rao, i will try this way. If you come up with anymore suggestion or advice then it will be very kind of you.
2012 Oct 31 2:14 PM
Hello Ankur,
I also started a discussion about something similar you are doing (http://scn.sap.com/message/13629734#13629734) . Basically, I also have a package with an entire range of objects (data elements, tables, structures, views, tables types, classes, interfaces, programs) and I have to copy and rename every single one of this object with a different namespace.
Additionally I also want to replace inside all the objects (class methods, reports and function modules) the old used objects with the renamed ones...because there are a lot of dependencies beween the objects, a refactory process of the entire code that I have.
How are you doing with your tool? Is it working? It performs only a renaming for the objects or does also the code refactory?
Can you help me please?
2012 Nov 02 6:00 AM
Hello Mihai Dipsan,
As Thomas replied in your post, its very complex due to dependencies, but with the help of Shambhu, Thomas and many friends from SCN am able to get some of it.
The basic thing behind this process is:
1. create new object (with same properties but new name)
2. Use where used list for old object
3. Go to each place, replace the old name with new name.
This is what your report should do. But as told earlier, lots of dependencies are there.
I will suggest first take backup of all your work, then you go for each object one by one, i mean like for eg take tables first, then structures etc.
prepare one separate renaming report for each object. I will tell you the FMs or Methods which are useful.
Regards,
Ankur Sharma
2013 Jan 09 5:37 AM
Hi Ankur,
I am also working on similar functinality. Kindly share FMs with me.
Regards,
Pratibha Vashist
2013 Jan 09 6:01 AM
2013 Jan 09 6:02 AM
Hello Pratibha Vashist,
You want to rename all DDIC objects ?
And there is no direct FM to rename DE or Table, structures etc. The basic thing to follow, as mentioned in posts earlier, is: create new object with same properties (new name), go to each place and replace the name with newly created one and lastly delete the old object.
Regards,
Ankur Sharma
2013 Jan 09 9:02 AM
Hello Kumar Akshat,
I have used that FM but its not updating all database tables like TADIR with new name.
Regards,
Pratibha Vashist
2013 Jan 09 9:08 AM
Hi Pratibha,
That's the function module used by standard when you rename a program. So, it should not be wrong. Maybe you are missing some step. You can debug how the standard renames a program by trying to rename a test program.
2013 Jan 09 9:17 AM
2013 Jan 09 10:15 AM
Hello Pratibha,
That FM will rename only programs. And if that FM is not updating tadir entry then you can use one more fm which will update the tadir.
2013 Jan 10 6:05 AM
Thanks Ankur & Akshat for your help. I found the Bug.
Can you please suggest any method to find delete old name of renamed program from TADIR table. i used FM: TR_TADIR_INTERFACE for this but it is not deleting old entry saying: object is distributed. so entry can not be deleted. how ever delflag field can be set. but again this is not getting marked by standard for all objects.
2013 Jan 10 7:15 AM
Hello Pratibha,
As per my information, we can delete entry from tadir for local objects only. Objects which are associated with some package won't get its entry deleted from tadir because tadir makes an entry to keep record which objects are created in package etc.
Well its my view, waiting for some more answers from expert.
2013 Jan 10 8:02 AM
@Ankur Sharma: Thanks. Is there any method/FM available which can tell us only existing objects( Programs, includes and FMs) of a package.
2013 Jan 10 9:04 AM
Hello Pratibha,
Check field 'DELFLAG' in tadir, it is marked (or set) for deleted objects, may be this can help you.
Regards,
Ankur Sharma
2013 Jan 10 12:27 PM
Hi Ankur,
'DELFLAG' option is not working. however i found solution myself. We can look for active programs in table TRDIR and FMs in table TFDIR.
Thanks Ankur & Akshat for your quick responces. These helped me a lot.
Regards,
Pratibha Vashist
2013 Jan 11 9:31 AM
2013 Jan 10 11:25 AM
Hi Ankur,
As I perceived that you have already got, a major portion of your query solved, but out of curiosity, I just want to know, Why do you need all these..??
Thanks.