What is the button to change the variant in alv?
can u tell me is there any button to change the variant in alv?. what is tanscation varient in report , hw it will used.
The ALV Grid Control is a tool with which you can output non-hierarchical lists in a
standardized format. The list data is displayed as a table on the screen.
The ALV Grid Control offers a range of interactive standard list functions that users need
frequently (find, sort, filter, calculate totals and subtotals, print, print preview, send list,
export list (in different formats), and so on. These functions are implemented in the
proxy object class. You as the programmer have the possibility to turn off functions not
needed. In most cases the implementations of the standard functions provided by the
control are sufficient. However, if required, you can adjust these implementations to
meet application-specific needs.
You can add self-defined functions to the toolbar, if necessary.
The ALV Grid Control allows users to adjust the layout of lists to meet their individual
requirements (for example, they can swap columns, hide columns, set filters for the
data to be displayed, calculate totals, and so on). The settings (list customizing) made
by a specific user are called a display variant. Display variants can be saved on a userspecific
or on a global basis. If such display variants exist for a list, they can be offered
to the user for selection. If a display variant is set as the default variant, the associated
list is always displayed based on the settings of this variant.
3. Use of Field Catalog is to determines the technical properties & add formating information of the column.
6. all the definition of internal table, structure, constants are declared in a type-pool called SLIS.
5. Form user_command using r_ucomm like sy-ucomm rs_selfield type slis_selfield.
Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length.
In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output.
The report output can contain up to 90 columns in the display with the wide array of display options.
The commonly used ALV functions used for this purpose are;
Purpose of the above Functions are differ not all the functions are required in all the ALV Report.
But either no.7 or No.8 is there in the Program.
How you call this function in your report?
After completion of all the data fetching from the database and append this data into an Internal Table. say I_ITAB.
Then use follwing function module.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
I_CALLBACK_PROGRAM = 'Prog.name'
I_STRUCTURE_NAME = 'I_ITAB'
I_DEFAULT = 'X'
I_SAVE = 'A'
T_OUTTAB = I_ITAB.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC .
ENDFORM. " GET_FINAL_DATA
The object F_IT_ALV has a field, the activity ACTVT, which can
contain four permitted values: 01, 02, 03 and 70. Each of the
activities 01, 02 and 70 controls the availability of particular
functions (in the menu and the toolbar) of the ALV line item list:
a) 01: "Settings -> Display variant -> Save..."
b) 02: "Settings -> Display variant -> Current..." and
"Settings -> Display variant -> Current header rows "
c) 70: "Settings -> Display variant -> Administration..."
Activity 03 corresponds to the minimum authorization, which is the
most restricted one: The user can only select layouts which have
been configured already. In particular, all of the other functions
named above are inactive with activity 03.
Now if you want to permit a user to change the column selection and
the headers as well as to save the layout thus created, for example,
but if you do not want to permit the user to administrate the
layouts, you grant him or her the authorization for activities 01
Check this link it will be mosty usefull for u
Reward all helpfull answers