SE11 - Create configuration tables and assign transaction codes
1. Create a custom table
SE11, create a custom table. If you want to make a configuration table, be sure to set the properties: allow display/maintenance.
Note:
The editing mode of the general application table remains the default.
After setting "Allow display/maintenance", SE16N editing can be supported. Generally, this permission will not be granted, and a separate configuration table is required.
The table fields are as follows:
save, activate table.
2. Create table maintenance function
Menu: Utilities → Table Maintenance Generator, or: SE54
Description: If the maintenance type selects one step, data maintenance does not require transmission.
You can also drag the width of the edit box below the field name on the layout page.
Transformation: Change the field editing style.
Settings: Field is not editable.
After adjusting the field properties (column width, column title, editing style, etc.), save and activate.
3. Function verification
Execute SM30, enter the table name, and click Edit:
Enter the table editing state, you can edit the fields allowed to be maintained, and save it after updating.
Click on the new entry to enter the row insertion state:
fill in the data and click Save to save the data.
4. Set transaction code
Generally, SM30 permissions will not be opened, and additional transaction codes need to be set.
Execute SE93 and enter the transaction code you want to set:
Description:
VIEWNAME, specify the table or view to be maintained;
UPDATE, specify to enter the editing state directly, SHOW, specify to enter the viewing state.
After saving, the transaction code is created successfully.
Execute ZBCEH to enter the table maintenance interface.
5. Bring out the default value of the field
For non-editable fields that need to be automatically assigned values, you can use SE54 table maintenance events or screen events, which are demonstrated below.
(1) Method 1: Table maintenance event
In the table maintenance interface: Menu, Environment → Modify → Event
Add event: 21-Fill the hidden field, customize the FORM name: FRM_FILL_DATA.
Click the code editor, select the included file, and add the following FORM code:
form frm_fill_data.
IF ztbcehlist-erdat IS INITIAL.
ztbcehlist-erdat = sy-datum.
ztbcehlist-uzeit = sy-uzeit.
ztbcehlist-ernam = sy-uname.
ELSE.
ztbcehlist-lstdate = sy-datum.
ztbcehlist-lsttime = sy-uzeit.
ztbcehlist-lstuser = sy-uname.
ENDIF.
ENDFORM.
Save and activate to realize automatic generation of new information and maintenance information.
(2) Method 2: Screen events
In the table maintenance interface, double-click the screen number, enter the Screen-Logical Flow tab, and
add the following code in the screen flow logic:
Double-click the MODULE name zset_date_time, create the MODULE
and select the included file, and add the following MODULE code:
MODULE zset_date_time INPUT.
IF ztbcehlist-erdat IS INITIAL.
ztbcehlist-erdat = sy-datum.
ztbcehlist-uzeit = sy-uzeit.
ztbcehlist-ernam = sy-uname.
ELSE.
ztbcehlist-lstdate = sy-datum.
ztbcehlist-lsttime = sy-uzeit.
ztbcehlist-lstuser = sy-uname.
ENDIF.
ENDMODULE.
Save and activate to realize automatic generation of new information and maintenance information.
Original article, please indicate the source when reprinting - X-Files