Adding a basic selection screen to your first ABAP report









Now that you hav created your first abap report it is time to add a selection screen to it so that the user can restrict the amount of data that will be retrieved.

Step 1 - Add code to create selection screen parameter
Starting with the basic program created in lesson 3, add the folloing code to below the data declaration.

* Creates a selection screen parameter called p_ebeln
  Parameter: p_ebeln type ekko-ebeln.


Step 2 - Update SELECT statement
Now add parameter to SELECT code to restrict selection based on user input

  Select *           		"* means get all fields
   up to 10 rows		"only retrieves 10 rows
    from ekko			"Gets data from ekko table
    into table it_ekko   	"Internal table to store retrieved data in
   where ebeln eq p_ebeln.      "restrict select based on user input in to selections param


Step 3 - Test
Save activate and test the code and you should see a selection screen similar to the following


Step 4 - Further reading on the selection screen
Now you have implemented a simple selection screen you can check out here for more information on the building your abap report selection screen