Monday, 6 January 2014

Deleting Tables SAP TABLES

Deleting Tables SAP TABLES

One will not often have to delete an entire database table, for largely the same reasons as were outlined above for fields. If this does have to be done it is important to remember that one’s own customer-specific tables are the only ones which can be deleted, SAP de-livered tables cannot be deleted. Because ZEMPLOYEES3 has only just been created, and nothing else depends on this table, it can be deleted without consequences.
To check whether a table can be deleted without causing unintended consequences else-where in the system, return to the ABAP Dictionary’s initial screen. Because the original ZEMPLOYEES table was used in the programs which have been created, use this as a test.
Insert this into the Database table field on the screen and then click the ‘Where-used list’ icon from the toolbar
Deleting Tables SAP TABLES

                                 
Once this is clicked, a dialogue box will appear offering a list of check-boxes. This will then search all of the different areas of the SAP system selected for references to the table ZEMPLOYEES. To execute this search click the Continue icon. Choose ‘Yes’ to the pop-up box, and wait while the system compiles the search results, which here show that this ta-ble is being used currently by 2 programs
Deleting Tables SAP TABLES

Having done this, one now knows that if the ZEMPLOYEES table were to be deleted, these programs would become inactive. By double-clicking these entries, one can see the code in the program where ZEMPLOYEES is referred to, and if you double-click on any line of the program, it will open the program at that line of code in the ABAP Editor. The Where-used button is a very useful tool, which can be invaluable not just when deleting pro-grams, but in many other scenarios.
If you were to try to delete ZEMPLOYEES, the system would not allow this course of action and would prevent it from happening until all the programs that are dependent upon it were either edited to remove references or deleted altogether themselves.
Since nothing depends upon ZEMPLOYEES3, this can be deleted. With the correct name in the ‘Database table’ field, click the ‘Delete’ button in the toolbar
                        
Deleting Tables SAP TABLES


A box appears stating that the data contained in the table would also be deleted. If you click the green tick icon this time, the system would return to the main screen with the table still intact. If the middle button, illustrated with the trashcan icon is clicked, this will proceed with the deletion. Once this is done, the status bar should confirm the action. If you try to display the table now, it does not exist. Once the deletion is completed, it can-not be undone:
Deleting Tables SAP TABLES

Deleting Tables SAP TABLES

No comments:

Post a Comment