Multiple Operations in Screen Programming
Create a Module Pool Program to Display, Search, Create, Modify and Delete records from the custom table.
Step 1: Create a Database table named “ZEMPLOYEEINFO” in SE11, same as shown below. (Click here: How to create a Database table).
Step 2: Now activate and save the table.
Step 3: Now go to SE80, select “Program” from the drop-down list and enter the name of the Main Program & Press Enter.
Step 4: A pop-up will rise and ask you to create it. Click on yes.
Step 5: Another Pop will come out to ask you to enter the name of the module pool program. Click on the “Create with TOP Include” checkbox and click on the tick button.
Step 6: Now enter the name of the TOP Include and continue saving it as a module pool program.
Step 7: Now double click on “Include ********_TOP “ on the screen, create it and write the following code.
Step 8: Now activate it.
Step 9: Now right-click on the Program name and create a screen.
Step 10: Select the Text tool from the toolbox and write the text.
Step 11: Select the Input box and name it EMP_ID as shown below.
Step 12: Create a Search Button as shown below.
Step 13: Create a Reset Button as shown below.
Step 14: Create a “Create” button as shown below.
Step 15: Create a Delete button as shown below.
Step 16: Create a Save button as shown below.
Step 17: Create a Change button as shown below.
Step 18: Create a table control as shown below. (How to Create Table Control). Enter Name of Table Control.
Step 19: Enter the name of the Internal Table and Work Area as shown below.
Step 20: Select the fields to display in table control as shown below.
Step 21: Give the Table control attributes as shown below.
Step 22: Now select all Additional table maintenance functions.
Step 23: Now Set includes table control and click Continue.
Step 24: Click on the finish button.
Step 25: Now save the screen and activate it.
Step 26: Now go to the “Flow Logic” tab and uncomment the PBO and PAI modules respectively.
Step 27: Then double click on both the Modules and create them in the Main Program, for now as shown below.
Step 28: Now inside “MODULE status_0100 OUTPUT” write down the code shown below. Then save and activate it.
Step 29: Now inside “MODULE user_command_0100 INPUT” write down the code for defining the functionality of each button created on the screen as shown below.
Step 30: Now right-click on the program name and create-> Transaction.
Step 31: Enter the name of the Transaction code and a short description. Select the radio button “Program and screen (dialog transaction)”.
Step 32: Now enter the screen number of that screen which you want to see first when you run your transaction code, here in our case we are adding screen number 100.
Step 33: Now save and activate the whole program by right-clicking on the program name and clicking on the “Activate button”.
Step 34: Now run the transaction code in the transaction box.