Create SAP Transaction to Maintain ABAP Table using SM30
ABAP developers can create new transaction code which call SAP SM30 Maintain Table Views tcode to prevent direct call of SM30 by SAP user. If you do not prefer to give permission to your SAP users to run SAP SM30 transaction, an ABAP developer can create a new SAP transaction which will run SM30 in the background behind the scenes.
This ABAP tutorial shows how to create transaction code to execute SM30 to maintain ABAP tables by SAP users.
Before we start our SAP tutorial, I assume that you have already create ABAP table in your development SAP system.
I created a dummy local object user table named ZUSERTABLE for this tutorial.
I also create the table maintenance dialog screen using the SE11 screen menu "Utilities > Table Maintenance Generator"
After I activate the table and generate the table maintenance dialog screens, I can display and maintain ZUSERTABLE ABAP table content using SAP SM30 transaction code.
Let's now create new SAP transaction which differs a little bit from the referenced ABAP tutorial.
First of all, call SE93 SAP transaction.
SE93 transaction code will display the Maintain Transaction screen.
Enter a non-existing new tcode in Transaction Code textbox on the screen.
For example, I use ZUSERTABLE_SM30 for test purpose.
Press on Create button to continue transaction code creation process
The following screen in transaction code generation wizard, the type of the new SAP transaction will be defined. This screen is important. ABAP programmer will not continue with default option but choose Transaction with parameters (parameter transaction)
Press Enter or Continue button for following step.
If you select Transaction with parameters (parameter transaction) in previous screen, following transaction code create dialog screen will be shown.
Please pay attention to areas where marked with red borders.
First of all the new transaction will call SM30 tcode which I provided in Default values for Transaction textbox.
An other important customization on above screen is, ABAP developers should add two new parameters namely UPDATE and VIEWNAME. The ViewName parameter defines the target ABAP table which will be maintained via SM30 using the new SAP transaction. The Update parameter provides the permission to edit the table content, not to display as readonly
Save the transaction.
Now you can call new created SAP transaction ZUSERTABLE_SM30 to maintain target ABAP table (defined in tcode properties) without SM30 call on the foreground.
Creating transaction code for table maintenance (SM30)
Allowing access to table maintenance via a custom transaction code is fairly straight forward. Once the table maintenance has been generated for a specific database table you need to create a parameter transaction which will essentially call transaction SM30 and pass the relevant details of the table you want to maintain. See below for example
Step 1 - Create parameter transaction (i.e. via SE93)
Step 2 - Enter GUI support
If you see the option to select GUI support (newer systems) then select the appropriate ones you would like to use, usually just select windows.
Step 3 - Enter transaction code.
Now enter the transaction you want to execute (In this case it is SM30). Also Select the transaction radio button if using an older SAP system. You also get the option to skip the intial screen which I have ticked in this example so that the user is taken straight to the table view. We assign which table they are going to see in the below default/proposed value(step 4).
Step 4 - Enter transaction details.
Now within the Proposed/Default values section there are a number of values which can be setup, simply press the add(+) button and use the drop down menu to view the list. The 2 values assigned in this example are as follows:
VIEWNAME <tablename> Sets table name to be maintained
UPDATE X Open table for update
If you want the table maintenance to be display only, simply add the SHOW value equals 'X' instead update.
VIEWNAME <tablename> Sets table name to be maintained
SHOW X Open table for display
Step 5 - Update for newer gui screens.
Your SAP gui screen may look more like this but it is still basically the same so instructions as above are still valid