Tuesday, July 6, 2010



Selection screens serve as the interface between the program and the user, and allow, for example, limitation of the amount of data to be read from the database.

Logical databases supply selection screens whose concrete appearance is dependent on the specified node name (NODES). Selection screen versions (if supplied by the logical database) offer a subset of default selection screens.

You can use the declarative language elements PARAMETERS and SELECT-OPTIONS to generate a default selection screen (screen 1000) with input-ready fields.

In addition to the default selection screen, you can generate additional selection screens with SELECTION-SCREEN BEGIN .... and call them with CALL SELECTION-SCREEN.

You can create variants of a selection screen. A variant is a user-specific selection variant. You would create a screen variant if you frequently start a program with the same selection variants or start in background processing.

The PARAMETERS statement is a declarative language element. As in the case of the DATA statement, you can declare the fields with TYPE or LIKE. The system generates input-ready fields in the selection screen. The names of PARAMETERS fields can be up to 8 characters long. You can maintain selection texts (parameter names) with the function Text elements/Selection texts.

You can set a default value with the DEFAULT addition. If you assign a MEMORY ID , the system uses SAP Memory and the SET/GET parameter to set the default value. If you declare mandatory fields with the OBLIGATORY addition, users cannot leave the selection screen until values have been entered in these fields.

You can also define parameters as checkboxes (AS CHECKBOX). Doing so creates a one-character field that can contain a " "(SPACE) or an "X". You can evaluate the contents of checkboxes using IF/ENDIF control structures.

You can also define a series of radio buttons for the selection screen with the addition RADIOBUTTON GROUP . The maximum length name for a RADIOBUTTON GROUP is 4 characters. Only one radio button in a group can be active and can be evaluated during program processing. You can evaluate the contents of radio buttons using CASE/ENDCASE control structures.

The SELECT-OPTIONS statement is a declarative language element. In contrast to the PARAMETERS statement, it allows complex selections instead of just one input-ready field.

SELECT-OPTIONS generates an internal table with a standard structure. This consists of 4 fields: seltab-sign, seltab-option, seltab-low, and seltab-high. The name of selection table can contain up to 8 characters. You can maintain selection texts (name of the selections) with the function Text elements/Selection texts.

Use the addition FOR to specify the field against which the system should check the selection entries. This field must be declared in a DATA or TABLES statement. The fields seltab-low and seltab-high possess the same field characteristics as the check field.

Each line of the selection table formulates a condition using one of the following relational operators. The following values are possible:

SIGN: I (Include), E (Exclude)

OPTION: EQ, NE, LE, LT, GE, GT, BT(Between), NB (Not Between),
CP (Contains Pattern), NP (Contains Pattern not)

The selection set is the union of all includes (I1,..., In) minus the union of all excludes (E1, ..., Em). If the table remains empty, selection is performed using the total selection set, if you are working in the SELECT statement with WHERE IN .

When you make entries on a selection screen, the system populates the internal table . Standard entries for the fields seltab-sign and seltab-option are I and EQ for individual selections, and I and BT for ranges.

To change the default entries for seltab-sign and seltab-option, choose Selection options (double click on the appropriate entry field or activate the pushbutton). The system offers all the alternatives for fields seltab-sign and seltab-option that are appropriate for the selection. If the traffic signal icon is green during Select, there is an I in seltab-sign; a red light indicates E.

To delete a table entry, use the appropriate pushbutton (Delete selection).

Every selection criterion can be used to make multiple selections unless defined otherwise. If multiple selections are present, the color of the arrow changes from white to green.

Additions to the SELECT-OPTIONS statement:
DEFAULT enables you to set default values for seltab-low (single value) or seltab-low and seltab-high (interval). You can use OPTION and SIGN to set default values for seltab-option and seltab-sign that differ from the normal defaults.
MEMORY ID allocates a SPA/GPA parameter. The value stored in SAP Memory with the ID is placed in seltab-low (lower interval limit) when you call the selection screen.

LOWER CASE suppresses conversion of the entry into upper-case. This addition is
not permitted for Dictionary fields, since the attribute set in the Dictionary takes

OBLIGATORY generates a mandatory field. A question mark appears in the entry field in the selection screen, and the user must enter a value.

NO-EXTENSION suppresses multiple single or multiple range selections.
NO INTERVALS suppresses the seltab-high (upper interval limit) entry on the selection screen. You can use the additional screen, Multiple selection, to enter ranges.

If you entered a logical database in the attributes of the type 1 program, the selection screen of the logical database is processed. If you have programmed additional SELECTION-OPTIONS or PARAMETERS statements, the system displays them after the selections of the logical database.

You can use the SELECTION-SCREEN statement to design the layout of the selection screen. You can group selections that belong together logically with the supplemental BEGIN OF BLOCK and place a frame around them using WITH FRAME. You can assign a title to the block, but you can only use the addition TITLE together with a frame.

You can nest framed blocks to a maximum of 5 frames.

Before de signing a selection screen, you should orient yourself to the screen design guidelines found in the sample transaction BIBS.

You can display multiple parameters and comments in one output line. To do so, you must enclose them between the SELECTION-SCREEN BEGIN OF LINE and SELECTION-SCREEN END OF LINE statements. The COMMENT parameter enables you to include text in the line.

Comment texts must always have a format (position and output length). The position can be set with a data field, pos_low or pos_high. These are the positions for fields seltab-low and seltab-high on the selection screen.

Adding COMMENT ... FOR FIELD ensures that the F1 Help for field is displayed for the comment text and for the parameter itself. If you hide the parameter (selection variant: attribute invisible) the comment text is also hidden.

You can use POSITION to set the cursor for the next output position (only within ... BEGIN OF LINE ... END OF LINE).

The INITIALIZATION event is processed exactly once in an executable program. You can supply default values to the selection screen fields of the logical database during this event.
You can use F1 Help (Technical help) to determine the names of the selection fields.

You can use the addition DEFAULT to supply additional report-specific default values to selection screen fields in a selection-option statement. The value sets are entered in the internal table during this event.

The selection screen can generally be initialized during event AT SELECTION-SCREEN OUTPUT. This event corresponds to event Process Before Output (PBO) of the selection screen, and therefore may be passed several times. A typical task for the selection screen's PBO event is dynamic screen modification (LOOP AT SCREEN), that is, showing or hiding fields, enabling or preventing input, and so on.

You can perform an error dialog check of the selection screen fields within the AT SELECTIONSCREEN processing block. The event belongs to the PAI (Process After Input) processing of the selection screen. In case of errors (MESSAGE Exxx or MESSAGE Wxxx), all fields are made ready for input again.

You can refer to individual selections with the parameters ON or ON . In case of errors, only these selections are made input-ready again.

To check the entry combinations of a logical group, you can use the event AT SELECTIONSCREEN ON BLOCK . Fields in this block are made ready for input when an error message is issued.

The event AT SELECTION-SCREEN ON END OF belongs to the PAI processing of the selection screen for Multiple selections.

You can perform entry checks for selection criteria of the logical database and for your own program-specific selections.

You can work with several selection screens in one program. The default selection screen always has the screen number 1000.

You can also define a selection screen with SELECTION-SCREEN BEGIN OF SCREEN ... END OF SCREEN . Between the BEGIN ... END ... statements, you declare the required selections with SELECT-OPTIONS and PARAMETERS. The selection screen is assigned the screen number and is called with CALL SELECTION-SCREEN .

The system takes care of the return from the selection screen, which means you do
not have to program it yourself with LEAVE SCREEN (as is the case with CALL SCREEN).
The program is continued immediately after the call. However, you must use system field sy-subrc to query whether the user chose Execute (F8) or Cancel (green and yellow arrows, red X). Execute (F8) returns sy-subrc = 0; Cancel returns sy-subrc = 4.

You can supply the selection screen with default values at INITIALIZATION.

You can determine which selection screen is currently processing with the AT
SELECTION-SCREEN event. You can do so with a CASE control structure and evaluate the system field sy-dynnr.

You can create any number of selection sets (variants) for a program. The variants are allocated to the program uniquely.

Creating variants makes sense when you frequently start a program with the same selection default values.

You can mark Start with variants in the program attributes. Users (system, services, reporting) can then start the program only with a variant.

If the program uses several selection screens, you can choose to create a variant for all the selection screens or individually for each selection screen.

Naming conventions and transporting variants

"SAP&xxx" are supplied by SAP
"CUS&xxx" are created by customers (in client 000)

Variants that follow these naming conventions are client-independent and will automatically be transported along with the report. If these naming conventions are not followed, an entry for a request (task) must be added to the object list: LIMU VARI .

You have to assign a name and a description to each variant. By default, variants are available for both online and background processing. You can also define a variant exclusively for use with background processing.

You can protect the variant itself and the individual selection criteria and parameters against unauthorized changes. If you select Display only in catalog, this variant will not be displayed in the general value help (F4).

The type of a selection is determined in its declaration: Type s for SELECT-OPTIONS, type p for PARAMETERS. If you select Selections protected, then the field(s) will not be ready for input. You can use the hide attribute to suppress selection criteria and parameters on the screen, if required, resulting in a less cluttered selection screen.

When you use selection variables, there are three basic ways of supplying your selections with values at runtime:
From table TVARV (type T)
Date fields using dynamic date calculation (type D), such as today's date
User-specific variables (type B); Prerequisite: The selection must be declared with the MEMORY ID addition.

No comments:

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)


Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

Blog Archive