A few days ago in a group chat room of a messenger the question was asked how texts (name of the supplier, name of the plant, …) are loaded when maintaining a customizing table, if the user enters the entry and confirms with the Enter-key. Since I did not have such a request so far, I had to first look at an example of how SAP does something like that. After a short analysis, I then understood the logic and then created the following example.
Request for the test:
- Create a customizing table and find a way to integrate the texts
- Texts should not be ready for input
Question and decision how to implement:
- Should the textfield include in the customizing table?
- No, as the texts already exist in the database
- Must be developed here?
- No, a maintenance view is created for the customizing table
- Do events of the table maintenance dialog have to be used here?
- No
Index of implementation steps
- Creating the Customizing table
- Create the maintenance view
- Transaction SE11: assign name
- Select type
- Description and table selection
- View fields
- Maintenance attribute for view field
- Table Maintenance Dialog
- Testing the implementation
- Further explanation why no development is necessary
Implementation steps
Info: I haven’t included popup with warning and package assignment. I ignored all warnings that happened in this sample and I assigned all objects to the local package $TMP.
- Creating the Customizing table
- Transaction SE11: assign name
- Delivery and Maintenance
- Fields
- Foreign key
- Foreign key for WERKS
- Foreign key for LIFNR
- Technical Setings
- Create the maintenance view
- Transaction SE11: assign name
- Select type
- Description and table selection
- View fields
- Maintenance attribute for view field
- Table Maintenance Dialog
- Table Maintenance Generator
- Technical Dialog Details
- Dialog Data Transport Details
- Testing the implementation
- Transaction SM30: Maintain Customizing
- Add Entry
- Confirm entry with Enter-key
- Further explanation why no development is necessary
- Screen of the maintenance view
- Module for completion
- Call the subroutine for completion
- Subroutine of completion
To create the customizing table, I use transaction SE11. In the initial screen I select database table, assign a name for the table (note: the name should be as self-explanatory as possible) and press the F5 key.
First, I give the table short description and choose the delivery class C (Customizing table) for the table.
My table should get the fields MANDT, WERKS and LIFNR.
In order to receive additional tables in a maintenance view for selection, it is important that at least one field in the table receives a foreign key relationship.
For the creation of the foreign key for the plant, SAP automatically proposes the table T001W, which I also assume.
In the popup for the foreign key creation, I accept all default values and confirm it with Copy.
For the creation of the foreign key for the vendor, SAP automatically proposes the table LFA1, which I also assume.
In the popup for the foreign key creation, I accept all default values and confirm it with Copy.
To activate the table I still have to make the technical settings. First I save the table and assign it to a package. For the data class, I chose APPL2 and size category 0.
Now I save the settings and jump back into the table, which I can now activate.
To create the customizing table, I use transaction SE11. In the initial screen I select View, give a name for the view (Hint: The name should be as self-explanatory as possible) and press the F5 key.
The type of the view must be a maintenance view.
First, I give the view a short description and enter in the tables the table just created and confirm with Enter.
Using the Relationships button, I can now add the two tables found through the foreign key relationship.
Now I have to determine which fields the view should have. I can call up the selection of fields by choosing the “Table fields” pushbutton.
Double-clicking on the table opens the field selection of the table. There I select the field “NAME1” for the tables T001W and LFA1.
In addition, I have of course also added the field “LIFNR” from my table.
So that the two name fields are only declared as output fields, I still set the value “R – View field can only be read” in the column Maintenance attribute for view field.
Before I can activate the view one of the two fields with the name NAME1 needs to be renamed.
Now I can activate the view and assign it to a package.
To maintain data using transaction SM30, I still need a table maintenance dialog.
I call the table maintenance generator directly from the maintenance view processing via Utilities-> Table Maintenance Generator.
I name the function group as well as the maintenance view and under Authorization group I use &NC&. My Maintenance type is one-level and gets the screen number 1.
Now I can use the sheet in the application toolbar to have the function group and the associated logics created by SAP. Again, it must be stated again in which package the development should be included.
After creating the function group, I set the flag for the standard recording routine so that changes to this table are transported.
Now I have completed all the steps for the request and I can check if everything works as it is desired.
I can perform table maintenance using transaction SM30 by specifying the view name.
When adding a new entry, I select one plant and one vendor each.
After pressing the Enter key, the texts for the plant and the vendor are loaded and updated in the display.
How does the data selection work? Of course I also looked at it a bit and will explain it here.
Since data is reloaded in the screen here, I take a closer look at the flow logic of the screen. There I noticed that SAP implemented the module “COMPLETE_ZMM_V_WERK_LIFNR” in the PROCESS AFTER INPUT. This include always has the same structure “COMPLETE_
In the module, only the subroutine “COMPLETE_EXPROFIELDS” is called.
The subroutine “COMPL_ZMM_V_WERK_LIFNR” is then called in the subroutine “COMPLETE_EXPROFIELDS”. The naming of the subroutine always has the same structure “COMPL_
In the subroutine “COMPL_ZMM_V_WERK_LIFNR” the additional data from the database will be loaded. Through this kind of implementation, SAP has taken a lot of work from developers.