Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

what is the button to change the variant in alv?

Former Member
0 Kudos
1,457

Hi guys,

can u tell me is there any button to change the variant in alv?. what is tanscation varient in report , hw it will used.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
356

Use Transaction Variants to make fields Mandatory, Hidden or Display. Also applicable to screens and tabstrips.

You can hide unwanted screens and fields in any of the standard SAP programs without changing any of the standard programs. Additional features such as making the variant as default on the standard SAP transaction code is only available as of 4.6x.

  • Transaction SHD0 - Create a variant for the required transaction by changing the layout through hiding fields and screens.

  • Transaction SE93 - Create a variant transaction (e.g. for VA02 = ZVA02).

o Next allocate the transaction variant to this variant transaction.

  • In 4.6c, you can default your transaction variant as the standard variant. (SHD0 - Edit -> Activate/Deactivate as standard variant)

Regards,

Pavan

Check this link for the first question...

http://www.erpgenie.com/abap/controls/alvgrid.htm

Please check this link...

Message was edited by:

Pavan Pachimatla

3 REPLIES 3

Former Member
0 Kudos
357

Use Transaction Variants to make fields Mandatory, Hidden or Display. Also applicable to screens and tabstrips.

You can hide unwanted screens and fields in any of the standard SAP programs without changing any of the standard programs. Additional features such as making the variant as default on the standard SAP transaction code is only available as of 4.6x.

  • Transaction SHD0 - Create a variant for the required transaction by changing the layout through hiding fields and screens.

  • Transaction SE93 - Create a variant transaction (e.g. for VA02 = ZVA02).

o Next allocate the transaction variant to this variant transaction.

  • In 4.6c, you can default your transaction variant as the standard variant. (SHD0 - Edit -> Activate/Deactivate as standard variant)

Regards,

Pavan

Check this link for the first question...

http://www.erpgenie.com/abap/controls/alvgrid.htm

Please check this link...

Message was edited by:

Pavan Pachimatla

Former Member
0 Kudos
356

Hi Bharathi,

When the ALV is displayed there is a button 'Change Layout' which, when clicked, gives the user the option of changing the columns to be displayed in the ALV.

Regards,

Ravi

0 Kudos
356

Hi

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.

<b>2. REUSE_ALV_LIST_DISPLAY

REUSE_ALV_GRID_DISPLAY

REUSE_ALV_FIELDCATALOG_MERGE

REUSE_ALV_COMMENTARY_WRITE</b>

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.

7.fieldcat-fieldname

fieldcat-ref_fieldname

fieldcat-tabname

fieldcat-seltext_m

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;

<b>1. REUSE_ALV_VARIANT_DEFAULT_GET

2. REUSE_ALV_VARIANT_F4

3. REUSE_ALV_VARIANT_EXISTENCE

4. REUSE_ALV_EVENTS_GET

5. REUSE_ALV_COMMENTARY_WRITE

6. REUSE_ALV_FIELDCATALOG_MERGE

7. REUSE_ALV_LIST_DISPLAY

8. REUSE_ALV_GRID_DISPLAY

9. REUSE_ALV_POPUP_TO_SELECT</b>

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' 
EXPORTING 
I_CALLBACK_PROGRAM = 'Prog.name' 
I_STRUCTURE_NAME = 'I_ITAB' 
I_DEFAULT = 'X' 
I_SAVE = 'A' 
TABLES 
T_OUTTAB = I_ITAB. 
IF SY-SUBRC <> 0. 
WRITE: 'SY-SUBRC: ', SY-SUBRC . 
ENDIF. 
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

and 02.

Check this link it will be mosty usefull for u

http://www.sap-img.com/fu017.htm

Reward all helpfull answers

Regards

Pavan