You can make settings for a design object, each contained element, and, in the case of a table-type layout, for the individual columns.
Design Object Settings
You can make the following settings for a design object and for design object elements:
Settings for Row-Type Layout (CL_SALV_FORM_LAYOUT_FLOW)
Function | Method |
Move element within the layout | SET_ELEMENT |
Get number of elements in row-type layout | GET_ELEMENT_COUNT |
Set tooltip for design object | SET_TOOLTIP |
Get tooltip for design object | GET_TOOLTIP |
Settings for Table-Type Layout (CL_SALV_FORM_LAYOUT_GRID)
Function | Method |
Move element within the layout | SET_ELEMENT |
Append empty row (FLOW object) | ADD_ROW |
Get number of rows | GET_ROW_COUNT |
Show lines between columns and rows | SET_GRID_LINES |
Set tooltip for design object | SET_TOOLTIP |
Get tooltip for design object | GET_TOOLTIP |
Settings for Elements
You have quite similar functions available for the different element types:
Settings for Element Types
Function | Method | Class |
Set wording for element | SET_TEXT | CL_SALV_FORM_TEXT CL_SALV_FORM_LABEL CL_SALV_FORM_HEADER_INFO CL_SALV_FORM_ACTION_INFO |
Get wording for element | GET_TEXT | |
Set tooltip for element | SET_TOOLTIP | |
Get tooltip for element | GET_TOOLTIP | |
Set corresponding text element | SET_LABEL_FOR | CL_SALV_FORM_LABEL |
Get corresponding text element | GET_LABEL_FOR |
Width and Alignment in a Column
A column in the table-type layout of your design object is an object of the class CL_SALV_FORM_GRID_COLUMN. Whenever you create an element in your layout and enter a column that does not yet exist (for example, COLUMN = 2), one or more objects of this class are generated as appropriate. You can use the class CL_SALV_FORM_LAYOUT_GRID to create several column objects in one go.
Methods for a Column in a Table-Type Layout
Function | Method |
Get column | GET_COLUMN |
Create columns in table layout | SET_COLUMN_COUNT |
Get number of columns in table layout | GET_COLUMN_COUNT |
You can use the column object to define the width of the column and the alignment of elements in the column.
Methods for Width and Alignment
Function | Method |
Set width of column | SET_WIDTH |
Get width of column | GET_WIDTH |
Set horizontal alignment of elements | SET_H_ALIGN |
Get horizontal alignment of elements | GET_H_ALIGN |
Width and Alignment of a Single Element
You can define the width and alignment of elements individually. For technical reasons, you must determine whether the element is in a row-type or table-type layout:
· For a row-type layout, use the class CL_SALV_FORM_LAYOUT_DATA_FLOW
· For a table-type layout, use the class CL_SALV_FORM_LAYOUT_DATA_GRID
To change the layout data, first cast the element to one of these classes.
Methods for Layout Data of an Element
Function | Method |
Get layout data on the alignment and width of the element | GET_LAYOUT_DATA |
To define the width and alignment of the element, now use the methods of the casted classes:
Methods for the Width and Alignment of an Element
Function | Method |
Set width | SET_WIDTH |
Get width | GET_WIDTH |
Set horizontal alignment | SET_H_ALIGN |
Get horizontal alignment | GET_H_ALIGN |
No comments:
Post a Comment