Skip to Content
Author's profile photo Kesari Katakam

HOW I DO IT: Purpose and the Creation of a “Deletion Transport”

Problem Description

When we have a Package which contains a “lot” of sub objects and we want to delete entire Package or bunch of objects under the package.

The problems we might face are:

A) Manual Deletion of objects requires lot of time and we need to delete all the sub objects, release the transport and then delete the Package .

B) Deletion of package in a non development system becomes a problem as we need to delete them in the development system manually

and  then move the transport across the landscape. And if we want to delete only in a Q system requires complex strategy.

So these problems can be simplified if we have a Deletion transport which would just delete the objects where we want.

Definition of a Deletion Transport:

Basically the definition of a deletion transport in our context is a transport in which all the objects are listed and marked for deletion & When we import this transport into any system the listed objects are deleted.

Situations:

When we talk about situations , it could be of a need when we are implementing a short term 3rd party solutions ( e.g smartShift’s smartUpgrade tool) , System Maintenance or a POC project etc.

Lets say

1) You have done a POC in a system and at the end you want to delete all those objects ( say from an IDES system ) .

2) You want to delete the objects in a quality system for some reason, but you dont want these objects to be deleted in the development system .

3) You are doing a maintenance of the development system and want to clean up the list of test objects.

Solution :

There is a field OBJFUNC in E071 table ( Object list of a Transport ). When OBJFUNC is ‘D’ the activity of the transport on this object would be “Deletion”.

But mere setting of this flag in the transport data wont convert a transport into a deletion transport.  The D indicator works only when the objects are not present in the system ( See below screen shot and short text of the field ) .

e071-D.png

So we need a dummy system where our objects are not present and we create a transport in that system with Deletion indicator . This is explained in detail in further section.

What you need :

1) First thing you need is “The problem” itself, Only when you really have this problem then this post makes some sense to you.

2) A Dummy system where none of these to-be-deleted-objects  exist. ( Say IDES or any Other development system than your main development system )

3) Some basis authorization who can help you in Create / Release / Download the K , R files ( In case you dont have the authorization ) .

Steps :

A) From the main system,( Where the objects actually exist) Download the object header data from TADIR into a tab delimited text file   , The first 3 fields are the only required data ( i.e The fields PGMID , OBJECT , OBJ_NAME of the TADIR table ) .

Excel-Data.png

We use this data to create the  TADIR entries in the dummy system. A TADIR entry is mandatory to add the object to a transport.

Caution: Review your object list once it is downloaded. Make sure only those objects which you wanted to delete are present

B) Create the below report program in the Dummy System where we Generate the transport.

Program specification is as below:

B1)  Create a Selection screen parameter P_FILE to read the object list file.

Create a Selection screen parameter P_TRKORR , for the “Deletion Transport”

Create a Selection screen parameter P_DEVC for entering a Z dummy devclass

Selection Screen.png

B2) Read the file into an internal table IT_TADIR

B3) Process the IT_TADIR to 1) Create a Dummy entry into TADIR 2) Create an entry into the transport

B4) Sample Code snippet

     DATA: W_TABIX  TYPE SY-TABIX.

     CLEAR W_TABIX .

     LOOP AT T_TADIR INTO W_TADIR.

            W_TABIX = W_TABIX + 1.

     *Step1 Create a Dummy Entry into TADIR ,

            W_TADIR-DEVCLASS = P_DEVC.   ” Any dummy development class other than $TMP

            MODIFY TADIR FROM W_TADIR.

     *Step2 Create an entry into the transport object list , E071

            W_E071-TRKORR = P_TRKORR.     ” The input deletion transport

            W_E071-AS4POS = W_TABIX .        “Sequence of the object within the transport

            MOVE-CORRESPONDING W_TADIR TO W_E071. ” Header data of the object

            MODIFY E071 FROM W_E071.         ” Update the standard table E071 for transport

       ENDLOOP.

C) Once the program is ready, then Create a Workbench transport with a Target System ( Can be a Virtual System, just to get the transport files ) and a Dummy Development Class.

Execute the program in the dummy system with mandatory input as object list file , deletion transport , and the dummy devclass.

Selection Screen.png

After the execution is complete, The transport will be loaded with the objects with Deletion Indiactor and the object list looks like below :

Deletion TR entries in SE01.png

D) Release the transport and Download the K (\usr\sap\trans\cofiles\ ) and R (\usr\sap\trans\data\ ) files of the transport.

E) Your “Terminator” transport is Ready!!!  Import the deletion transport into the required system where you wanted those objects to be deleted.

Sample Diagram of the Steps and Process

/wp-content/uploads/2013/08/process_261939.png

Note:

The development class you use in the Dummy system doesn’t have any affect . And it need not be same as the original development class in which the real objects are in.

The deletion transport should have a target assigned so that it generates the K and R files when it is released.

!caution! Make sure you are Importing this transport into “Required” systems and remove it in the import Q once it is imported.!!

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Thomas Zloch
      Thomas Zloch

      That's quite an interesting approach.

      However, your main use case is the deletion of all or many objects under a package. Are you aware that in SE80 you can mark the entire object tree, or any part of it, by fully exploding it, then marking the first object and holding the shift key when marking the last one? Then choose "Delete" from the context menu.

      This way you can mass-delete many objects very quickly, all DDIC consistency checks are active, and you have no dummy systems, transports, TADIR entries and programs to deal with.

      Thomas

      Author's profile photo Mauricio Cruz
      Mauricio Cruz

      That also works (it's exactly what I do btw), but it's a pain-in-the-#&$ process to handle object dependencies, even if you select the whole "table-data element-domain" tree...

      Author's profile photo Kesari Katakam
      Kesari Katakam
      Blog Post Author

      Adding to Mauricio's comments and stressing the special characters 😉 ,

      There are different errors SAP throws like "you cant delete the objects in Quantity Mode" etc ..and number of Popups you need to act upon ..including transport request popups,and any warning messages etc. So its going to be a tedious process .

      Consistency is definitely a point, that's why to use this approach there should be the "Problem" and  "Pain" as "Prerequisites" 😉

      Author's profile photo Mauricio Cruz
      Mauricio Cruz

      Hello Kesari,

      This terminator request can sure be handy, but it's ridiculous how complicated objects deletion can get in a SAP system. If you ever tried to uninstall something like ABAP2XLSX you know what I'm talking about. Maybe we should start making something like a SAPUnlink...

      And I would raise the font size of the following phrase if I were you:

      !caution! Make sure you are Importing this transport into "Required" systems and remove it in the import Q once it is imported.!!

      🙂

      Author's profile photo Former Member
      Former Member

      Hi Kesari,

      While importing the TR into the targert system. The object function OBJFUNC 'D' is not coming. While in the source system, OBJFUNC is 'D'. Can you help me out?

      Regards,

      Sanyam Kataria

      Author's profile photo Kesari Katakam
      Kesari Katakam
      Blog Post Author

      Hello Sanyam,

      are you sure that your source system doesnt contain the objects while you were creating the transport ?

      If so you must have already seen the objects getting deleted in the target after you import it.

      Isnt it the case? if so can you give more details.?

      Regards

      Kesari Katakam

      Author's profile photo Former Member
      Former Member

      Good lecture. Thank you for your time! I solved it a similar way but directly via se16n and hard modified data on tables E070 / E071 and E071K with assistance of excel  ... it is a quite ugly way but it works.