Professional Documents
Culture Documents
____________________________________________________
Short Text
Dialog for entering dynamic selection conditions
Functionality
The simplest procedure is where a selection screen appears when you call the function module. If you enter
your selections and press Copy, the function module returns the selections to the caller in three different forms.
The essential input parameter (SELECTION_ID) is the selection ID returned by the previous call to
FREE_SELECTIONS_INIT. It is used to identify this special set of dynamic selections so that, during a
transaction, you can manage several sets of dynamic selections that can be redisplayed one after the other for
maintenance.
The second input parameter TITLE can contain the selection screen title.
The third input parameter STATUS can include the number of a GUI status for the selection screen (see
documentation of the parameter "STATUS").
If a field selection is made when you call FREE_SELECTIONS_INIT or following an earlier call to
FREE_SELECTIONS_DIALOG, you immediately see the selection screen for entering the selections for the
chosen fields. From here, you can then make a new selection - as long as this is defined by this selection ID. If
no fields are selected, you first see the field selection screen and can then branch to the selection screen.
Example
The field
string QCAT (structure RSDSQCAT) contains the key of a selection view:
TYPE-POOLS RSDS.
IF SY-SUBRC = 0.
CALL FUNCTION 'FREE_SELECTIONS_DIALOG'
EXPORTING
SELECTION_ID = SELID
TITLE = TITLE
IMPORTING
WHERE_CLAUSES = TWHERE
EXPRESSIONS = TEXPR
FIELD_RANGES = TRANGE
NUMBER_OF_ACTIVE_FIELDS = ACTNUM
TABLES
FIELDS_TAB = FIELDS
EXCEPTIONS
INTERNAL_ERROR = 01
NO_ACTION = 02
NO_FIELDS_SELECTED = 03
NO_TABLES_SELECTED = 04
SELID_NOT_FOUND = 05.
IF SY-SUBRC = 0.
CLEAR DS_CLAUSES.
MOVE 'ABCD' TO DS_CLAUSES-TABLENAME.
READ TABLE TWHERE WITH KEY DS_CLAUSES-TABLENAME INTO DS_CLAUSES.
SELECT * FROM ABCD WHERE ...
AND (DS_CLAUSES-WHERE_TAB).
...
ENDIF.
ENDIF.
Parameters
SELECTION_ID
TITLE
FRAME_TEXT
STATUS
AS_WINDOW
START_ROW
START_COL
NO_INTERVALS
JUST_DISPLAY
PFKEY
ALV
TREE_VISIBLE
DIAG_TEXT_1
DIAG_TEXT_2
WARNING_TITLE
AS_SUBSCREEN
NO_FRAME
WHERE_CLAUSES
EXPRESSIONS
FIELD_RANGES
NUMBER_OF_ACTIVE_FIELDS
FIELDS_TAB
FCODE_TAB
FIELDS_NOT_SELECTED
Exceptions
INTERNAL_ERROR
NO_ACTION
SELID_NOT_FOUND
ILLEGAL_STATUS
Function Group
SSEL