Showing posts with label SAP Managing ALV Output Areas. Show all posts
Showing posts with label SAP Managing ALV Output Areas. Show all posts

Saturday, October 11, 2008

SAP Netweaver Managing ALV Output Areas

Purpose

Web Dynpro for ABAP or Web Dynpro for ABAP (WD4A, WDA) is the SAP standard UI technology for developing Web applications in the ABAP environment. It consists of a runtime environment and a graphical development environment with special Web Dynpro tools that are integrated in the ABAP Workbench (SE80).

Web Dynpro offers the following advantages for application developers:

The use of declarative and graphical tools significantly reduces the implementation effort

Web Dynpro supports a structured design process

Strict separation between layout and business data

Reuse and better maintainability by using components

The layout and navigation is easily changed using the Web Dynpro tools

Stateful applications are supported – that is, if the page is changed and the required data remains intact so that you can access it at any time throughout the entire application context.

Note that stateless applications are not possible.

Automatic data transport using data binding

Automatic input check

User interface accessibility is supported

Full integration in the reliable ABAP development environment

The concept of Web Dynpro ABAP is identical with Web Dynpro Java and offers more or less the same functions.

The documentation for Web Dynpro for ABAP is divided into the following main sections:

Documentation Structure

Section

Content

Web Dynpro for ABAP Configuration

Configuration settings in the system

Web Dynpro Architecture

Platform-independent information about Web Dynpro

Introduction to the terminology

Web Dynpro ABAP: Development in Detail

Basics

Cross-component programming

Dynamic programming

Further concepts

Web Dynpro ABAP Administration

Web Dynpro trace tool

ICM tracing

HTTP browser tracing

Logging

Tutorials

Introductory tutorials using the example of a flight information application.

Security Aspects in Web Dynpro for ABAP

ICF and logon procedures

Reference

Overview of the tools contained in ABAP Workbench

UI elements

Classes and interfaces

FAQ

FAQs, problem cases, reactions and solutions

You can find information about which browsers SAP supports for Web Dynpro ABAP under http://service.sap.com/pam. See also SAP Notes 981710 and 1001411.

Integration

You can integrate a Web Dynpro ABAP application as a favorite into your Easy Access menu: Creating Favorites.

You can define a Web Dynpro ABAP application as a parameter transaction: Creating Parameter Transactions for Web Dynpro Applications.

Restrictions

Previous UI technologies, such as ITS, cannot be used in combination with the new technology in Web Dynpro ABAP.

If you want to integrate an ITS-based application into a Web Dynpro ABAP application, use the Link UI element or an exit/suspend plug (see also Display an Interface View) in a WDA application.

For more information on limitations for Web Dynpro ABAP, see SAP Note 1098009.

Additional Information

For more information about Web Dynpro ABAP, see the SDN:

The Web Dynpro ABAP Knowledge Center is a collection of information about various aspects of Web Dynpro ABAP.

A large number of Web Dynpro colleagues from around the world participate in the Web Dynpro forum, providing input on Web Dynpro ABAP questions.

In Web Dynpro ABAP Wiki you can find material from the Web Dynpro forum FAQs, HowTos, and other frequently referenced materials, useful links, tips, and so on.

In the Web Dynpro weblogs, you can find all blogs published to date on the topic of Web Dynpro (ABAP and Java). Here there are also excellent demonstration videos about diverse Web Dynpro ABAP topics.

If creating an error message for Web Dynpro ABAP in component BC-WD-ABA, see the checklist in Note 938809.

SAP Netweaver ALV Output Header

By default, the ALV output has no header. You can generate a header and display it above the ALV output. The header can have the following parts:

· Text

· Graphic

· Tooltip

You can make the following settings for the header of the ALV output:

· Generate, get, and delete a header object

· Set wording for header

· Set graphic path for header

· Set position of graphic for header

· Set wording for tooltip

Generating, Getting, and Deleting a Header Object

The header of the ALV output is an instance of the class CL_SALV_WD_HEADER. To generate or delete the object, use the methods of the interface class IF_SALV_WD_TABLE_SETTINGS (implementing class CL_SALV_WD_CONFIG_TABLE).

Methods for Creating, Getting, and Deleting Header Objects

Function

Method

Generate header object

CREATE_HEADER

Get header object

GET_HEADER

Delete header object

DELETE_HEADER

Setting Wording for Headers

The header of the ALV output has the type STRING. To define the header, use methods of the class CL_SALV_WD_HEADER.

Methods for Wording of Headers

Function

Method

Set wording for header

SET_TEXT

Get wording for header

GET_TEXT

Setting Graphic Paths for Headers

You can display any graphic in the header of your ALV output as long as it is suitable for the Web Dynpro environment (see Structure linkHandling Web Icons). To define the path or ID of the graphic file, use the methods of the class CL_SALV_WD_HEADER.

Methods for Graphic File Paths

Function

Method

Set path or ID for graphic

SET_IMAGE_SOURCE

Get path or ID for graphic

GET_IMAGE_SOURCE

Setting Position of Graphics for Headers

You can choose whether the graphic displayed in the header is placed before or after the header text. To do this, use the methods of the class CL_SALV_WD_HEADER.

Methods for Placing Graphics in Headers

Function

Method

Set position within header

SET_IMAGE_FIRST

Get position within header

GET_IMAGE_FIRST

Setting Wording for Tooltip

The tooltip of the header becomes visible when the user places the cursor over the header of an ALV output. To specify the wording of the tooltip, use the methods of the class CL_SALV_WD_HEADER.

Methods for Header Tooltip

Function

Method

Set wording for tooltip

SET_TOOLTIP

Get wording for tooltip

GET_TOOLTIP

SAP Fields in SAP Netweaver

You primarily use field objects in two situations:

You want to apply standard ALV functions (ALV services) to the ALV output before it is displayed (see Predefining Standard ALV Functions).

You want to assign properties to the cells of a field that are defined for another field (see Assigning Properties to Columns and Cells).

You can also make the following settings for field objects:

Get Field Object

Get Field Name

Note

You cannot create new fields or delete existing fields.

Getting Field Objects

To make the required settings for a field, you must first get the instance of the field. You can decide whether you address a specific field object by its name or get all field objects simultaneously so you can handle them one after another. In both cases, you use the methods of interface class IF_SALV_WD_FIELD_SETTINGS (implementing class CL_SALV_WD_CONFIG_TABLE).

Methods for Getting Field Objects

Function

Method

Get single field object

GET_FIELD

Get all field objects

GET_FIELDS

Getting Field Names

To get the name of the current field instance, you use class CL_SALV_WD_FIELD.

Method for Getting Field Names

Function

Method

Get field name

GET_FIELDNAME

SAP Columns

Depending on how you got the ALV configuration model, there is either just one, identically named column object for each attribute of your context node, or there is no column object (see Getting the ALV Configuration Model). If there is no column object, you must create the column objects needed for your required display of the ALV output separately.

You can make the following settings for column objects:

Get a column object

Get the technical name for a column

Create and delete column a object

Set up a column header (see Column Headers)

Change the position of a column (see Position of Columns)

More Information

For information about specifying the appearance of a column, see the sections in Appearance of ALV Output.

For information about filtering, sorting, and aggregating columns, see Predefining ALV Standard Functions.

Getting a Column Object

To make the required settings for a column, you first have to get the instance of the column. You can decide whether you address a specific column object by its name or whether you want to get all column objects at once so that you can handle them one after another. In both cases, you use the methods of interface class IF_SALV_WD_COLUMN_SETTINGS to do this (implementing class CL_SALV_WD_CONFIG_TABLE).

Methods for Getting Column Objects

Function

Method

Get individual column object

GET_COLUMN

Get all column objects

GET_COLUMNS

Getting the Technical Name for a Column

To get the name of the current column instance, you use class CL_SALV_WD_COLUMN.

Method for Getting the Technical Name of a Column

Function

Method

Get technical name

GET_ID

Creating and Deleting Column Objects

If, when getting the ALV configuration model, you specified that the system is not to generate column objects, you need to generate the column objects required for displaying the ALV data in your application.

All columns for which a column object exists are displayed to the user in a column set. If you do not want a column to appear in the user’s column set, you have to delete the corresponding column object.

When you create a column object, you enter its technical name. This name must match the name of an attribute in the context node of your application.

To create or delete a column object, you use the methods of interface class IF_SALV_WD_COLUMN_SETTINGS (implementing class CL_SALV_WD_CONFIG_TABLE).

Methods for Creating and Deleting Column Objects

Function

Method

Create a column object

CREATE_COLUMN

Delete a column object

DELETE_COLUMN

Delete all column objects

DELETE_COLUMNS

SAP Column Headers in SAP Netweaver Managing ALV Output Areas

By default, each column in the ALV output has a column header. You do not therefore have to create the relevant objects first.

You can change column headers. In doing so, you can set up the following components:

Text

Graphic

Tooltip

You can make the following settings for the column header:

Create, get, and delete the object for the column header

Specify the wording of the column header

Specify the path of the graphic in the column header

Specify the position of the graphic in the column header

Specify the wording of the tooltip

Information About Standard Column Headers

Standard column headers contain text only. The wording used depends on the context node attribute:

If the attribute has no DDIC reference:

By default, the system uses the technical name of the attribute as the column header.

If the attribute has a DDIC reference:

The system assigns column headers as follows:

If field labels have been defined for the DDIC data element, the system uses the short text of the DDIC data element as the column header.

If no field labels have been defined, the system uses the technical name of the DDIC data element as the column header.

Getting, Creating, and Deleting Objects for Column Headers

The column header of a column in your ALV output is an instance of class CL_SALV_WD_COLUMN_HEADER. A column header object can exist for every column object.

To get, create, or delete a column header object, you use the methods of class CL_SALV_WD_COLUMN.

Methods for Getting, Creating, and Deleting Column Headers

Function

Method

Get column header object

GET_HEADER

Create column header object

CREATE_HEADER

Delete column header object

DELETE_HEADER

Specifying the Wording of the Column Header

You can specify the text to be displayed as the column header. You have the following options:

You can enter user-defined text.

You can enter a separate DDIC data element whose field label is to be used as the column header.

For a DDIC relationship, you first of all enter the DDIC data element that returns the wording of the column header. You do this using method SET_PROP_DDIC_BINDING_ELEMENT. You make the following entries:

Column header or tooltip

The text from the DDIC is to be used here as the column header.

Name of the DDIC data element

If you do not make any further entries, the short text of the DDIC data element is used. You can also use the heading, medium text, or long text of the DDIC data element. You do this using method SET_PROP_DDIC_BINDING_FIELD.

If you enter user-defined text as the column header, you must use this method to explicitly deactivate the DDIC relationship.

To specify the wording of the column header, you use the methods of class CL_SALV_WD_COLUMN_HEADER.

Methods for the Wording of Column Headers

Function

Method

Specify any text as the column header

Explicitly deactivate DDIC relationship

SET_TEXT

SET_PROP_DDIC_BINDING_FIELD

Get the wording for the column header

GET_TEXT

Specify the DDIC data element whose field label is to be used as the column header

SET_PROP_DDIC_BINDING_ELEMENT

Get the name of the DDIC data element

GET_ PROP_DDIC_BINDING_ELEMENT

Specify the type of field label to be used as the column header

SET_ PROP_DDIC_BINDING_FIELD

Get the type of field label to be used as the column header

GET_ PROP_DDIC_BINDING_FIELD

Line Breaks in Column Headers

By default, the system does not add line breaks in the column header. The width of the column is therefore determined by the length of the text in the column header. You can specify that line breaks are to be permitted in the column header. If the column header contains characters that permit line breaks (such as spaces or hyphens) and the column is not wide enough, the system can spread the text across multiple lines. To do this, you use the methods of class CL_SALV_WD_COLUMN_HEADER.

Methods for Line Breaks in Column Headers

Function

Method

Set line breaks

SET_HEADER_TEXT_WRAPPING

Determine whether line breaks are set in the column header

GET_HEADER_TEXT_WRAPPING

Specifying the Path of the Graphic in the Column Header

You can display any graphic in a column header as long as it is suitable for the Web Dynpro environment (see Handling Web Icons). To specify the path or ID of the graphic file, you use the methods of class CL_SALV_WD_COLUMN_HEADER.

Methods for Specifying Paths of Graphic Files

Function

Method

Specify path or ID for graphic

SET_IMAGE_SOURCE

Get path or ID for graphic

GET_IMAGE_SOURCE

Specifying the Position of the Graphic in the Column Header

You can choose whether the graphic you display in a column header is to be placed before or after the text for the column header. To do this, you use the methods of class CL_SALV_WD_COLUMN_HEADER.

Methods for Positioning Graphics in Headers

Function

Method

Specify position within header

SET_IMAGE_FIRST

Get position within header

GET_IMAGE_FIRST

Specifying the Wording of the Tooltip

The tooltip of a column header is displayed when the user places the cursor over the column header.

You can specify the text to be displayed as the tooltip. You have the following options:

You can enter any text.

You can enter a separate DDIC data element whose field label is to be used as the tooltip.

For a DDIC relationship, you first of all enter the DDIC data element that returns the wording of the tooltip. You do this using method SET_PROP_DDIC_BINDING_ELEMENT. You make the following entries:

Column header or tooltip

The text from the DDIC is to be used here for the tooltip.

Name of the DDIC data element

If you do not make any further entries, the short text of the DDIC data element is used. You can also use the heading, medium text, or long text of the DDIC data element. You do this using method SET_PROP_DDIC_BINDING_FIELD.

If you enter user-defined text as the tooltip, you must explicitly deactivate the DDIC relationship using this method.

To specify the wording of the tooltip, you use the methods of class CL_SALV_WD_COLUMN_HEADER.

Methods for the Wording of Tooltips

Function

Method

Specify any text as the tooltip

Explicitly deactivate DDIC relationship

SET_TOOLTIP

SET_PROP_DDIC_BINDING_FIELD

Get the wording for the tooltip

GET_TOOLTIP

Specify the DDIC data element whose field label is to be used as the tooltip

SET_PROP_DDIC_BINDING_ELEMENT

Get the name of the DDIC data element

GET_ PROP_DDIC_BINDING_ELEMENT

Specify the type of field label to be used as the tooltip

SET_ PROP_DDIC_BINDING_FIELD

Get the type of field label to be used as the tooltip

GET_ PROP_DDIC_BINDING_FIELD

SAP Position of Columns

By default, all columns are arranged in the same order as the attributes in the context node of your application. You can change the order of columns. You can do this in the following ways:

By changing the position number

By fixing columns

You can also specify whether the user is allowed to fix columns.

For information on the sequence of hierarchy columns, see Table as Hierarchy.

Changing the Position Number

Every column is automatically assigned the position number 0 initially. You can change the position of a column by changing this position number. The position number does not have to be unique.


Columns with the position number 0 are always left-justified. This means that if you want to align a column to the left, you must give all other columns a higher position number the column in question.

You can also use negative numbers as position numbers. This means that you can give a single column an appropriate position number without changing the 0 of all the other columns.

To change the position number of a column, you use the methods of class CL_SALV_WD_COLUMN.

Methods for Changing the Position Number

Function

Method

Set position number

SET_POSITION

Get position number

GET_POSITION

Fixing a Column

You can fix columns. This has the following effects:

You move the column in question to the edge of the ALV output.

The column can then no longer be moved when scrolling sideways with the horizontal paginators.

When fixing a column, you specify whether the column is to be fixed to the left-hand side or the right-hand side of the ALV output.

In this way, you can create up to three blocks of columns:

The columns fixed to left, the columns that are not fixed, and the columns fixed to right.

You can also change the position number of a column to fix its position (see above). This allows you to arrange all columns of a block according to their position numbers.

To fix columns, you use the methods of class CL_SALV_WD_COLUMN.

Methods for Fixing Columns

Function

Method

Fix column

SET_FIXED_POSITION

Check whether a column is fixed and where it is fixed

GET_FIXED_POSITION

Allowing the Fixing of Columns

You can specify whether the user is allowed to fix individual columns. You specify this separately for fixing to the right edge or to the left edge. In the Settings dialog box, a UI element is displayed by means of which the user can specify the number of fixed columns.

To allow the fixing of columns, you use the methods of interface class IF_SALV_WD_STD_FUNCTIONS (implementing class CL_SALV_WD_TABLE):

Methods for Allowing the Fixing of Columns

Function

Method

Allow the fixing of columns to the left edge of the ALV output

SET_FIXED_COLS_LEFT_ALLOWED

Check whether the user is allowed to fix columns to the left edge of the ALV output

IS_FIXED_COLS_LEFT_ALLOWED

Allow the fixing of columns to the right edge of the ALV output

SET_FIXED_COLS_RIGHT_ALLOWED

Check whether the user is allowed to fix columns to the right edge of the ALV output

IS_FIXED_COLS_RIGHT_ALLOWED

SAP Footer and Paginators in SAP Netweaver Managing ALV Output Areas

The ALV output has its own footer that always contains the vertical paginators and optionally contains the horizontal paginators too.

You can make the following settings for the footer and paginators:

· Show or hide the footer

· Show horizontal paginators

· Scroll horizontally and vertically

Further Information

· For information on defining the number of visible rows and columns, see Size of ALV Output, Columns, and Cells.

· For information on the difference between scrollable and fixed columns, see Position of Columns.

Showing/Hiding the Footer

The ALV output normally has too many entries to display at once. The user cannot use the scroll bars to view the invisible entries - instead, he or she must use the paginators in the footer to navigate to the required location.

If your ALV output contains a lot of data records, you must make sure that you provide paginators for the user: You show the footer containing the paginators.

You can define whether the footer containing the paginators is visible, and when it is visible:

· Never

Even if entries are hidden in the invisible area, the footer is not shown.

· Always

Even when all entries are visible at any time, the footer is shown. In this case, the paginators are deactivated.

· Only when required

The footer is only visible if there are more rows and columns than can be displayed in the ALV output.

To show or hide the footer, use the methods of the interface class IF_SALV_WD_TABLE_SETTINGS (implementing class CL_SALV_WD_CONFIG_TABLE).

Methods for Showing the Footer

Function

Method

Show footer

SET_FOOTER_VISIBLE

Check whether the footer is shown

GET_FOOTER_VISIBLE

Showing Horizontal Paginators

By default, all columns marked as visible are displayed. The user may have to navigate to the required location using the horizontal scroll bar of the browser window. The horizontal paginators are hidden.

You can define how many scrollable columns are visible at once, thereby determining the width of the ALV output. The user requires the paginators in order to move the invisible columns into the visible area. This is because he or she cannot use the scroll bar for this.

The vertical paginators are always visible, regardless of the number of visible rows you choose.

However, the horizontal paginators are only visible if you define the number of scrollable columns. If you set this number high enough for all columns to be visible, the paginators are deactivated.

To define the number of visible columns and thereby determine whether to show or hide the paginators, use the methods of the interface class IF_SALV_WD_TABLE_SETTINGS (implementing class CL_SALV_WD_CONFIG_TABLE).

Methods for Showing Horizontal Paginators

Function

Method

Define number of scrollable columns

SET_SCROLLABLE_COL_COUNT

Get number of scrollable columns

GET_SCROLLABLE_COL_COUNT

Scrolling Horizontally and Vertically

The user requires the pushbuttons of the paginators in order to move invisible columns or rows into the visible area of the ALV output. He or she can also use the input fields of the paginators to enter the row or column to be displayed as the first visible row or column in the ALV output.

You can use the ALV configuration model to define which row or column is displayed first regardless of whether the footer is shown.

Note

To specify the first row, use the index of the row. To specify the first column, use the technical name of the column.

To scroll to the required column or row in the ALV output, use the methods of the interface class IF_SALV_WD_TABLE_SETTINGS (implementing class CL_SALV_WD_CONFIG_CLASS).

Methods for Horizontal and Vertical Scrolling

Function

Method

Specify row to be displayed as the first row

SET_FIRST_VISIBLE_ROW

Get row to be displayed as the first row

GET_FIRST_VISIBLE_ROW

Specify column to be displayed as the first column

SET_FIRST_VISIBLE_SCROLL_COL

Get column to be displayed as the first column

GET_FIRST_VISIBLE_SCROLL_COL

Archive