ERPClimb logoERPClimb
ABAP Core
ABAP Developmentbeginner 9 min read

ABAP Core Part 5: Selection Screens — PARAMETERS, SELECT-OPTIONS and Validation

Preview · a free account unlocks the full lesson

Key takeaway

Build selection screens users understand: PARAMETERS, SELECT-OPTIONS and ranges, checkboxes and radio buttons, defaults, value helps and input validation in AT SELECTION-SCREEN.

In this lessonShow sections

Visual overview

ABAP Core Part 5: Selection Screens — PARAMETERS, SELECT-OPTIONS and Validation — learning sheetFlow: Build the screen in the code example (block, airline, date range, radio buttons, test checkbox) → Default the date range in INITIALIZATION → Validate the airline in AT SELECTION-SCREEN → Use the ranges in the SELECT and run with different inputs, including exclusions. Key ideas: PARAMETERS; SELECT-OPTIONS AND RANGES; BLOCKS AND TEXTS; EVENTS. Watch out: Always check authorization for the entered values — the selection screen is user input.ERPClimb.com / ABAP / LESSON 5/10 / LEARNING SHEETABAP Core Part 5: Selection Screens — PARAMETERS,SELECT-OPTIONS and Validation1 · HOW IT FLOWS1Build the screenin the codeexample (block…2Default the daterange inINITIALIZATION3Validate theairline in ATSELECTION-SCREEN4Use the rangesin the SELECTand run with…2 · KEY IDEAS EXPLAINEDParametersTYPE from the dictionary → field label (via Goto →Text elements → Selection texts), F4 help andchecks.DEFAULT, OBLIGATORY, LOWER CASE, MEMORY ID.Select-Options And RangesCreates a range table with SIGN (I/E), OPTION (EQ,BT, CP, …), LOW, HIGH.WHERE fldate IN @s_fldate — empty range = norestriction.Blocks And TextsSELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAMETITLE TEXT-001. … END OF BLOCK b1.EventsINITIALIZATION — before the screen: defaults (e.g.date range = next 30 days).AT SELECTION-SCREEN — after input: validation;MESSAGE … TYPE 'E' keeps the user on the screenwith the field ready for input.3 · REMEMBER · WATCH OUTRememberPARAMETERS = one value; SELECT-OPTIONS = a range table (single values,intervals, exclusions).Use SELECT-OPTIONS directly in WHERE … IN s_… — empty means"all".Validate input in AT SELECTION-SCREEN; set defaults in INITIALIZATION.!Watch outAlways check authorization for theentered values — the selectionscreen is user input.4 · IN A REAL PROJECTA report accepted a company code as a free parameter without any check. A user from one country enteredanother country's company code and exported confidential margin data. The audit finding required a fix withindays. The team added AUTHORITY-CHECK in AT SELECTION-SCREEN for the entered organizational values and switched…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Parts 1 through 4 used a single input parameter. Real reports need more flexible input than that, and this part covers the classic selection screen used by executable programs.

PARAMETERS defines a single input value: PARAMETERS p_carr TYPE s_carr_id OBLIGATORY. PARAMETERS = one value; SELECT-OPTIONS = a range table (single values, intervals, exclusions). Giving it a TYPE from the dictionary brings along a field label — which can be overridden through Goto → Text elements → Selection texts — plus automatic F4 help and type checks.

Other useful additions include DEFAULT, OBLIGATORY, LOWER CASE and MEMORY ID. A checkbox is just PARAMETERS p_test AS CHECKBOX DEFAULT 'X'., and radio buttons work as a group: PARAMETERS: p_list RADIOBUTTON GROUP out DEFAULT 'X', p_alv RADIOBUTTON GROUP out.

SELECT-OPTIONS, by contrast, builds a full range table: SELECT-OPTIONS s_fldate FOR ls_sflight-fldate. creates a range table carrying SIGN (I for include, E for exclude), OPTION (EQ, BT, CP, and so on), LOW and HIGH. Use SELECT-OPTIONS directly in WHERE … IN s_… — empty means "all".

It plugs directly into a WHERE clause as WHERE fldate IN @s_fldate, where an empty range means no restriction at all. NO-EXTENSION and NO INTERVALS can restrict what kind of input the user is allowed to enter, and ranges can also be built entirely in code with something like DATA lt_range TYPE RANGE OF s_carr_id.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.