Skip to Content
Technical Articles
Author's profile photo arghadip kar

How to find whether a Transaction Code is Created for a Table Maintenance Generator?

Introduction

In every SAP Project you work for you will have a Custom table which is defined by the SAP Technical Consultant and generally it starts with z or y or based on Project naming standard. Sometimes this Custom table needs to be maintained manually and it is always a great Practice to create a separate Transaction Code for Maintenance. When you come to an existing Project it is very hard to know whether a Transaction Code is created for the Table Maintenance Generator for a particular Custom table or Standard Table.

Solution

Suppose we want to know whether a Table Maintenance Generator and a Transaction Code is created for table ZAP_PARENT_ORGUN

Check Table Maintenance Generator created for a Table.

Go To SE16–>TVDIR

Now we enter Table name ZAP_PARENT_ORGUN as mentioned below

If you have an entry that means a Table Maintenance generator is created like below.

Now we will check whether a Transaction Code is created for this Table Maintenance Generator.

 

Go To SE16–>TSTCP

Now enter * ZAP_PARENT_ORGUN * as mentioned below and Execute

 

Wala here we get the Transaction Code

 

Conclusion

You can use this both in SAP ECC and SAP S/4 HANA

 

Below is the video version.

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Anton Sikidin
      Anton Sikidin

      Hello, arghadip kar.

      I already automated this process.

       

      • From my report you can find:
      • table maintenance
      • table maintenance transaction
      • view maintenance
      • view maintenance transaction
      • cluster maintenance
      • cluster maintenance transaction
      *&---------------------------------------------------------------------*
      *& Report  ZTCODE_BY_TABNAME                                        *
      *&                                                                     *
      *&---------------------------------------------------------------------*
      *&    Autor Sikidin A.P.                                                                  *
      *&                                                                     *
      *&---------------------------------------------------------------------*
      
      report  ztcode_by_tabname                                        .
      
      
      parameters
        : tabname type tabname obligatory
        .
      
      data
            : lv_tcode type tcode
            , lt_dd26s type table of dd26s
            , lv_vclname  type vcl_name
            .
      
      field-symbols
                     : <fs_dd26s> type dd26s
                     .
      
      start-of-selection.
      
        write : / 'Table maintenance'.
        uline.
      
        perform get_tcode_by_tabname using tabname.
      
        write : /' '.
        write : /' '.
        write : /' '.
      
        uline.
        write : / 'View maintenance'.
        uline.
        select distinct viewname  as viewname
          into corresponding fields of table lt_dd26s
          from dd26s
          where tabname = tabname
          .
      
      
        loop at lt_dd26s assigning <fs_dd26s>.
          write : / 'View ', <fs_dd26s>-viewname.
          perform get_tcode_by_tabname using <fs_dd26s>-viewname.
        endloop.
      
        write : /' '.
        write : /' '.
        write : /' '.
        uline.
        write : / 'Cluster  maintenance'.
        uline.
      
        select vclname into lv_vclname
          from vclstruc
          where object  = tabname.
      
          write : / 'Cluster ', lv_vclname.
          perform get_tcode_by_tabname using lv_vclname.
        endselect.
      
        loop at lt_dd26s assigning <fs_dd26s>.
          select vclname into lv_vclname
            from vclstruc
            where object  = <fs_dd26s>-viewname.
      
            write : / 'Cluster ', lv_vclname.
            perform get_tcode_by_tabname using lv_vclname.
          endselect.
        endloop.
        uline.
      
      *&---------------------------------------------------------------------*
      *&      Form  get_tcode_by_tabname
      *&---------------------------------------------------------------------*
      *       text
      *----------------------------------------------------------------------*
      *      -->TABNAME    text
      *      -->TCODE      text
      *----------------------------------------------------------------------*
      form get_tcode_by_tabname using tabname
                                .
      
        data
              : lv_tcode type tcode
              , lv_text type ttext_stct
              , lv_param  type tcdparam
              .
      
        concatenate '%' tabname '%' into lv_param .
      
      
      
      
        select
              tstcp~tcode
              tstct~ttext
        into (lv_tcode, lv_text)
        from
        tstcp inner join tstct on
                   tstcp~tcode = tstct~tcode
        where
               tstcp~param like lv_param
        .
      
          write : / lv_tcode, lv_text.
        endselect.
      endform.                    "get_tcode_by_tabname
      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      Tip: put this on GitHub and let others update the code to use methods instead of subroutines and WRITEs. Step 3: Profit. 🙂

      Author's profile photo Anton Sikidin
      Anton Sikidin

      Fell free to make pull request to this repo

      https://github.com/AntonSikidin/ztcode_by_tabname

      Author's profile photo Matthew Billingham
      Matthew Billingham

      A perform inside a select endselect inside a loop. 😮

       

      Tip: rewrite into ABAP objects and create ABAP Unit Tests.

      Author's profile photo Former Member
      Former Member

      Well this is something people always do what is on the post, anyways liked the code Anton shared. Please do put it on GitHub with changes as Jelena advised.

      Author's profile photo Axel James
      Axel James

      you are just amazing you give the best solutions