Saturday, March 15, 2008

SCREEN ELEMENTS FOR OUTPUT IN SAP

A text field is a rectangular area on a screen in which the system displays text.

Text fields contain labels for other elements. These labels (sometimes called "keywords"), are purely for display - they cannot be changed at runtime by the user. Text fields are displayed in a fixed position on the screen.

Text fields can also contain literals, lines, icons, and other static elements. They can contain any alphanumeric characters, but may not begin with an underscore (_) or a question mark (?). If you use a text as a label for a checkbox or radio button, it must have the same object name as the checkbox or radio button it accompanies.

If your text consists of more than one word, use underscore characters as separators. This enables the system to recognize that the different words in fact belong together. The system interprets spaces as separators between two different text fields.

Text fields can be translated. They then appear in the user's logon language.

At runtime, you can change the size (visible length) of a text field and the display attributes Bright and Invisible. To do this, use the fields SCREEN-LENGTH, SCREEN-INTENSIFIED, and SCREEN-INVISIBLE (or SCREEN-ACTIVE).

You can create text fields in either of the following ways:
Directly in the layout editor, by placing a text field object in the work area and entering the text in the Object text attribute.
By using the accompanying text of a data element from the ABAP Dictionary.

When you use fields from ABAP Dictionary structures on the screen, the system normally displays the data element text as well as the template for the input/output fields on the screen.

You can make text fields invisible at runtime.

If you make an object invisible that is enclosed in a box, the box is not displayed either.

At PBO, the system table with the line type SCREEN is initialized by the runtime environment, and filled with the static attributes from the Screen Painter.

To hide a text field at runtime, you modify the system table. Use LOOP AT SCREEN. ... MODIFY SCREEN
ENDLOOP.

To make a text field invisible, use SCREEN-INVISIBLE = 1 or SCREEN-ACTIVE = 0.

To ensure that the field TEXTFIELD1 is not displayed on the screen, you can call a module in the PROCESS BEFORE OUTPUT processing block that sets the invisible attribute for that field.

To do this, set the contents of the field SCREEN-INVISIBLE to 0.

You can process the SCREEN table like an internal table with header line (LOOP AT SCREEN. … MODIFY SCREEN. ENDLOOP.)

The system does not support the statements LOOP AT SCREEN WHERE… and READ TABLE SCREEN.

A status icon is an output field that contains an icon. You choose the relevant icon at runtime. Icons allow you to indicate a status in your application. They are predefined in the system, and take up between two and four characters.

Status icons are special output fields that display icons. The system sets the attributes 'Output field' and '2 dimensional', and these cannot be changed. The default data format is CHAR.

You can change the Visible length, Intensified, and Invisible attributes of a status icon dynamically.

You can only define a status field in the graphical layout editor. A status field is an output field with an icon. You use them to display an icon, which you specify dynamically at runtime.

To assign an icon to an output field dynamically, use the function module ICON_CREATE. The internal length of the output field must be at least 13 (icon without text). To ensure that you can display quickinfos that might be longer, define the field with defined length 132 and visible length 2.

In the ABAP program, define a field with the same name as the screen field using the field TEXT from the structure ICONS.

You select the icon you want to display from the ABAP program. Before the screen is displayed, you need to find out the technical name of the icon. You do this by calling a module in the PBO event.

You retrieve the technical name of an icon using the function module ICON_CREATE. You must pass the name of the icon you want to display to the function module. You can also pass a text to be displayed with the icon. The function module returns the technical name of the icon.

For further details about this function module, refer to its documentation.

Group boxes enclose a selection of elements that belong together (for example, a group of fields or a radio button group). They are purely display elements, and help the user to identify which elements on the screen belong together in a group.

You can use group boxes to make sure that all fields within a box have the same context menu assigned to them. For further information, refer to the Context Menus on Screens unit.

Group boxes may have a title.

You can change the Visible length and Invisible attributes using the system table SCREEN.

A group box may contain other screen objects.

At runtime, if the box contains only invisible elements and the screen attribute Runtime compression is set, the box itself is not displayed.

You define a group box in the layout editor. The object must have a name, and you may also assign a heading to the box.

You can change the group box text dynamically. To do this, you should activate the output field attribute and create a global data field in the ABAP program with the same name. Because the Screen Painter field and the program field have the same name, any changes to the field contents will be immediately visible on the screen (similarly to input/output fields).

Output objects are for improving the layout of your screens.

Text fields allow you to label input/output fields. In this case, you should use the same name for the text field as for the input/output field. If you deactivate the input/output field, the text label is then automatically deactivated as well.

Status icons allow you to provide the user with a quick graphical overview of information.

Group boxes allow you to make a group of fields that logically belong together. Runtime compression ensures that empty boxes cannot be displayed.

Static texts on a screen can be translated, so that they appear on the screen in the language in which the user is logged on. To make dynamically-assigned text accessible to translators, you must use text elements in your ABAP programs.

No comments:

Blog Archive