SAP ABAP Table Control and Subscreen

Ahmet Acar
4 min readMay 28, 2019

--

Table control is one of a ABAP displaying mechanisms. With the help of Table control we can see the output table in different visibility approach. Today, I will explain to you creating table control and subscreen, then I give you some example codes about this topic.

So, we starting how can you creating table control in a screen. With this document, this job is child’s play :) I will explain in detail from 0 to 100.( I will skip creating program part, because you heard something about table control, you must know those parts :) )

Firstly, we create a simple program, as you can see program is totally empty. We right click to program name and follow this path Create->Screen.

Create Screen

Enter screen number (Numbers isn’t important except 1000 because 1000 screen number using selection screen codes in program, I do not suggest). In this example i will give 9000 and next part entering Short Description then click Layout button in top layer.

Screen Number
Go to Layout

Table control with wizard is the control provided by SAP, in which the users are not needed to code separately for table control operations. It generates automatically system generated code for the following table control operations.

  1. Insertion
  2. Deletion
  3. Scrolling
  4. First
  5. Last
  6. Next
  7. Previous
  8. Select
  9. Select all
  10. Deselect
  11. Deselect all

Go to the layout of the screen, where you can find the table control with wizard. Drag and drop the table control with wizard to the layout of the screen.

Drag and drop the table control wizard

One you drag and drop the control a popup will appear.

Table Control Wizard

Press Continue, in the next screen enter the table control name as “TC_9000” or your own name.

Name of Table Control

In the next screen you input the internal table and work area which has been created earlier.

Note: Before it is done, you must activate the page, in which you have declared the internal table and work area. Then only this table control screen will take its properties.

Table Name

The next screen will automatically retrieve the fields available in the internal table and show. We have to select those fields, which and all should be displayed in table control.

Definition of Columns

Select the input/output attributes as “Input Control” and give the field for selection of table control rows. Select the single line selection because I will use this in an example code.

Table Control Attributes

In this part, you will select checkbox about scrolling, insert/delete and select/ deselect.

Note: This Checkboxes relating table control width and high values.

Select Additional Table Maintenance Functions

Click on Continue, the table control with auto generated code will automatically be created.

Table Control Created

This will automatically create PBO & PAI modules for table control operations.

SUBSCREEN

Creating a subscreen on a ABAP dynpro screen is a fairly simple process, you just add a subscreen area (i.e. SBSCRN) to your main program screen and then add the following ABAP code to the dynpro screens PBO flow logic.

Usage of Subscreens

For this example the main screen is 9000 and the subscreen is 0200. You then build the subscreen content as you would any other screen.

Subscreen Creating

This is the PBO and PAI part. Call subscreen <subscreen_name> including <program_name><subscreen_number>.

Screen Follow Logic

•Subscreens do not have own ok_codes

•Ok_code is parsed by the main screen

•No changes to GUI status during subscreen flow logic

•Following instructions are not allowed in subscreens:

–SET TITLEBAR, SET PF-STATUS, SET SCREEN, LEAVE SCREEN, LEAVE TO SCREEN

Example definition subscreen

Thank you for reading. Stay tuned!

What do you guys think? I love to know your thoughts. Kindly like, share or comment below.

Ahmet Acar.

--

--

Ahmet Acar
Ahmet Acar

Written by Ahmet Acar

SAP ABAP Developer, Computer Engineer, Amateur Basketball Player.

No responses yet