Saturday, October 11, 2008

SAP Header and Footer Areas in SAP Netweaver Managing ALV Output Areas

You are able to design the areas above and below the ALV output using various elements. To do this, you use design objects.

You can use as many elements of different element types as you want in order to form a design object. Then you display it at your desired position.

All classes and methods for the design object are found in the system in the package SALV_FORM_ELEM.

Element Types and Layout Forms

You use elements of the following element types for your design object:

· Header element (header info)

· Text element with or without label (text label)

· Action information

The elements only differ in appearance. No functions are linked with the various element types.

These elements can be arranged within your design object. To do this, choose between two forms of layout:

· Single element

You generate an element and display it in the required position.

· Row-type layout

You arrange as many elements as you want in a row, one after the other.

· Table-type layout

You arrange as many elements as you want in rows and columns.

You are able to combine the two layout forms with one another as you wish, that is, you can insert rows into a table and vice versa.

Context Nodes TOP_OF_LIST and END_OF_LIST

The ALV component provides the two context nodes TOP_OF_LIST and END_OF_LIST. Each contains an attribute CONTENT. These context nodes hold the data of your design objects for the header and footer areas of the ALV output.

You define context mapping to a node with the same name in the context of your application and set the attribute CONTEXT of your context node to your design object.

Setting Up a Design Object

Proceed as follows to set up a design object for the header and footer areas:

· Map the context nodes TOP_OF_LIST and END_OF_LIST of the ALV component to the context of your application (see Context Mapping).

· Generate a design object. To do this, use either the row-type or the table-type layout. You insert the required elements into this layout (see Creating Design Objects and Elements).

· Where required, you make various settings for the elements (see Design Object Settings).

· Set the design object as a value of the attribute CONTENT in the context node.

Showing and Hiding Design Objects

By default, the design object for the header area and the design object for the footer header are both shown. You can hide and show these two design objects separately. You use the methods of the interface class IF_SALV_WD_TABLE_SETTINGS for this (implementing class CL_SALV_WD_CONFIG_TABLE).

Methods for Showing/Hiding Design Objects

Function

Method

Show or hide the design object for the header area

SET_TOP_OF_LIST_VISIBLE

Check whether the design object for the header area is shown or hidden

GET_TOP_OF_LIST_VISIBLE

Show or hide the design object for the footer area

SET_END_OF_LIST_VISIBLE

Check whether the design object for the footer area is shown or hidden

GET_END_OF_LIST_VISIBLE

No comments:

Archive