ABAP Reports Syntax for Select Options

Here in this post we are going to have a look at the abap programming language syntax for a key word select optoins.Basic form for this key word is SELECT-OPTIONS sel FOR f.

Effect

Declares a variable selection option. This statement only makes sense in reports, i.e. in programs defined as type 1 in the attributes. You can execute reports with the SUBMIT statement. The statements SELECTOPTIONS and PARAMETERS determine the technical interface and the user interface. The parameters and selection options you specify are displayed on the selection screen for the user to enter values

sel must be 1 - 8 characters long.

This statement defines an internal table sel with a fixed structure which consists of the fields sel-SIGN , sel-OPTION , sel-LOW and sel-HIGH . · A report can be assigned to a logical database ldb . This means that both the logical database ldb and the report can define selection options and parameters. You define the database-specific selection options in an ABAP/4 include program DBldbSEL . The system then imports this include program into the actual logical database access program SAPDBldb and into the report. As a result, the database-specific selection options relevant to the report are available both to the database program SAPDBldb and to the report. The 'report-specific' selection options are known only in the report Some SELECT-OPTIONS additions are allowed only in DBldbSEL . The addition 'NO DATABASE SELECTION' can only be used in the report.

· Each line of the internal table sel formulates a condition. If you require precise details about how to formulate these conditions, see the section on the IN operator under Logical expressions .

If the user enters a value set on the selection screen, the internal table sel is automatically filled.
You can use normal ABAP/4 statements to read and manipulate the internal table sel .

The values you enter for the database-specific selection options are passed directly to the database for data selection . This also applies to report-specific SELECT-OPTIONS that refer to a field in a logical database table defined for dynamic selections .You must check report-specific selections that refer to other fields with the CHECK statement . This process is therefore not as efficient as the process described above.

· Under "Text elements/selection texts", you should enter a description for each selection criterion sel . This description is displayed on the selection screen. If no such text exists, the name sel of the selection option is displayed instead.

· The LOW and HIGH fields of a selection option are displayed in a length up to 18 bytes long (scrollable up to 45 bytes). If you define a length longer than 45, fields are truncated on the selection screen after the 45th character. This affects the first line of the SELECT-OPTIONS table. You can, however, pass longer selection options to a report if they are specified with the addition NO-DISPLAY and thus do not appear on the selection screen. Without NO-DISPLAY , the fields are then truncated whenever the selection screen is processed in the background .

Field attributes on the selection screen.The input/output fields displayed on the selection screen for entry of upper and lower limits have the same attributes for type, length or conversion exits as the field f specified after FOR . If f is a Dictionary field, the selection screen is regenerated automatically after most changes to its attributes. The attributes 'Check table' and 'Fixed values' are exceptions to this rule. If these are changed, you have to generate the program in the ABAP/4 Editor. This also generates the selection screen.

Addition 1

... DEFAULT g

Effect

Proposes the single value g as the default selection when the report is called.


· For each SELECT-OPTION , you can only specify one DEFAULT .
· You must specify the default value g in its internal format, e.g. " SELECT-OPTIONS DATE FOR SYDATUM DEFAULT '19931224' ", not " ... DEFAULT '24.12.1993' ".
· The default value g should normally be a literal because, at runtime, it is transferred to the selection options table sel so early that no value can be assigned to the field g . System fields are an exception here because the system usually assigns values to them as soon as the report processing starts.

· On the "Multiple Selection" screen, you can also enter ranges for selection options with " NO INTERVALS ".

· By combining this addition with " NO-EXTENSION ", you can restrict the user to entry of a single value for the selection option, but with the possibility of also choosing single value options like 'Greater than' or 'Less than or equal'.

Addition

... NO DATABASE SELECTION

Effect

This addition is allowed only for report-specific SELECTOPTIONS which refer to a field f belonging to a table dbtab of the logical database. Here, the selections entered by the user are not passed directly to the logical database unless the logical database supports dynamic selections for dbtab if dynamic selections for dbtab are not supported, the addition has no effect.
This addition can be useful if you only want the selections entered by the user for this SELECT-OPTION to be effective under certain conditions. However, you should be careful when using it: Since the selections have to be checked with CHECK after the records have been read, this has a
considerable effect on performance.

ABAP Programming Report for Stock Requirement List
programming report on produciton order for abap