ABAP Tools - Working with Eclipse (Storage)
How do you access deleted source code in the ABAP Development Tools even though you never transported it? More about how ADT uses the storage and how it works.
Table of contents
In this article we will look at storing the source code in the ABAP Development Tools and how you can use the storage for problems and other things. The article refers to working with a Windows computer.
Introduction
The ABAP Development Tools have been around for over 10 years now and should now be standard in ABAP development, as many of the new features are only available via ADT. However, there are many companies that do not offer their developers access to the tools or the developers themselves are not interested. To do this, we will look at resource management and how you can use them efficiently.
Workspace
When you start Eclipse for the first time, you will be asked for the workspace. This is a directory on your hard drive where all the necessary Eclipse settings and plugins are stored. In most cases, you can then confirm the dialog so that the next time you start the program, you will not be asked again and you will always use the same workspace.
If we take a closer look at the workspace, we will find two folders that seem inconspicuous at first glance.
You can access the installed Eclipse plugins via the "eclipse-workspace -> .metadata -> .plugins" directory. The plugins are then each delimited by namespace.
Administration
In this section we look at the management of resources using the ABAP Development Tools.
System
To do this we create a new ABAP system by going to "File -> New -> ABAP Project". Here you should see systems that you have access to. Normally the SAP GUI configuration is used.
In this case we use a CAL system, which we use for the demo (S/4HANA 2022 release). If you work with Working Sets, you can also assign the system to an existing set.
Once the system has been created, a corresponding folder has been created in the "org.eclipse.core.resources.semantic" plugin. There you will find the system-specific settings. We will now need this folder accordingly.
Object
In the next step we create our first test object. To do this we create an executable class in the system, which we create in the $TMP package.
Now that the class has been created, there are now further artifacts from the ABAP Development Tools in the "S4H_TEST_WORKSPACE -> .adt" folder. There we find our class and a configuration for the class.
If we now change the class and save the changes, the file in the workspace is updated. This means that our changes remain locally persisted even after a restart or completion. Finally, we activate the object, so that it is also activated in the SAP system and can run.
Versions
Whenever you click Save in the editor, a local history is created, which you can use to view the work status from an hour ago or yesterday. You do not normally find such changes automatically in the SAP GUI, or they fill up your change history. Use "Right-click -> Compare with -> You can view the changes in the "Local History" section.
If you would like to view more changes over a longer period of time, you will find further configuration options for the local changes in the settings.
If you are looking for the changes, you will find them in the "org.eclipse.core.resources" plugin. Unfortunately, the management structure is not as easy to read as the storage of the original resources.
Delete
Finally, we delete the class from the system again to test the behavior of the storage and the file system. This removes the folder with the class from the file structure.
Deletion behavior
In the last step, we actively removed the object from the system, and the resource was removed from the system. However, this only applies to this system. In Eclipse, we have the option of creating the same system under a different name. If we open the object there, it is loaded into our workspace. If we now delete the object from the first system, it is removed from there. In the second system, it remains on the hard drive and we can access the latest version of the source code.
This also means, however, that if it is deleted by a third party (another developer, Git, misdirected transport), we can still access the resources to restore the latest version. This happened to a colleague of ours and this gives you a chance to get into development, especially if you have already implemented a lot and have not yet created a version in the system.
Hint: If your resources were accidentally removed from the system and you did not actively do this, there is a good chance that you will be able to get the objects back.
Conclusion
In this article we wanted to discuss resource management in Eclipse and how you can perhaps gain a few advantages from it in emergency situations. But you should now also have a better understanding of how the system handles this and why you can also edit the files once the network is gone.