Google Search - Blog...........

Changing The Screen During Runtime / At-Selection Screen Output Command.

The attributes are assigned to the screen field when the screen is designed in full screen editor. Such kind of assignment is static, which means that these attributes are fixed. But many times the need to change the attributes of the screen arises. And this has to be done during runtime.

Need To Change Screen

There can be a requirement in the transaction that, certain fields on the screen

Appear only in certain conditions.
Are in Change/display mode according to user inputs
Become mandatory subject to specific inputs.
Changes its format depending upon certain conditions.

Modifying the screen

At the runtime, attributes for each screen field is stored in system defined internal table, with header line, called as SCREEN TABLE. It contains name of field and its attributes. This tab le can be modified during the runtime i.e. through module pool program. Screen table has following fields:

Field Name Length Description
NAME 30 Name of screen field
GROUP1 3 Field belongs to field group1
GROUP2 3 Group 2
GROUP3 3 Group 3
GROUP4 3 Group 4
ACTIVE 1 Hide/Show
REQUIRED 1 Field input is mandatory
INPUT 1 Enable/Disable
OUTPUT 1 Field for display only
INTENSIFIED 1 Field is highlighted.
INVISIBLE 1 Field is suppressed.
LENGTH 1 Field output length is reduced
DISPLAY 3D 1 Field is displayed with 3-D Frame
VALUE_HELP 1 Field is displayed with Value help

E.g., SCREEN-ACTIVE = 0 has the same effect as the following statements.
SCREEN- INPUT = 0.
SCREEN-OUTPUT = 0.
SCREEN-INVISIBLE = 1.
The fields SCREEN-NAME and SCREEN-GROUP 1 through SCREEN-GROUP4 tell you which field and / or field group has the attributes.
You can assign up to 4 groups to a field.
You need to program screen modifications in module, which is processed during the event PROCESS BEFORE OUTPUT.

`SCREEN’ is an internal table and, in order to change the field values, LOOP statement has to be used so that the header-line can be populated with the new values, changing the earlier values, the SCREEN table consisted for the specific screen. Finally the changed record in the header-line is NOT APPENDED, but is MODIFIED to the SCREEN table. That is, we first use `LOOP AT SCREEN’ and then assign the values. And finally PRIOR TO ENDLOPP give `MODIFY SCREEN’.

PROCESS BEFORE OUTPUT.
MODULE MODIFY_SCREEN OUTPUT.

MODULE MODIFY_SCREEN.
LOOP AT SCREEN.
IF SCREEN-NAME = ‘SFLIGHT-CARRID’.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE.

No comments:

Post a Comment