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: 

About Variants in ALV grid

Former Member
0 Kudos
823

Hi all,

I am displaying 4grids on a TAB Strip in ALV

i have created one variant for each grid(report)

But when i run the prog and press on F4 help for variant parameter, i am getting variants of all the grids

Is there any way to get only those variants related to a particular grid.

thanks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos
219

Hi,

Specify different variant handles for each of the four grids. Some thing like the following,

<b>ls_variant-report = <your program name>.</b>

****Set following handler different for each grid ****reference

****something like 'GRD1', 'GRD2' and so on..

<b>ls_variant-handle = <your grid handle 4 characters>.</b>

CALL METHOD ref_grid->set_table_for_first_display

EXPORTING

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

  • I_CONSISTENCY_CHECK =

  • I_STRUCTURE_NAME =

<b> is_variant = ls_variant</b>

i_save = 'A'

  • I_DEFAULT = 'X'

is_layout = ls_layout

  • IS_PRINT =

  • IT_SPECIAL_GROUPS =

  • it_toolbar_excluding =

  • IT_HYPERLINK =

  • IT_ALV_GRAPHICS =

  • IT_EXCEPT_QINFO =

CHANGING

it_outtab = lt_data

it_fieldcatalog = lt_fcat

  • IT_SORT =

  • IT_FILTER =

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

Hope this helps..

Sri

Message was edited by: Srikanth Pinnamaneni

8 REPLIES 8

former_member188685
Active Contributor
0 Kudos
219

Create Different Varainats...for different Grid.

Regards

vijay

former_member188685
Active Contributor
0 Kudos
219

While Calling specify the required variant.

regards

vijay

0 Kudos
219

hi ,

if u have gone through the question clearly we have already mentioned that variants are created for each grid separately

the real problem is

is there any way to show only those variants related to a grid when i call f4 help.

0 Kudos
219

Hi,

Ok, now I understand, then you can call function module LVC_VARIANT_F4 in POV module for the variant field..

And when you call it, you can specify the REPORT and HANDLE in the importing parameter IS_VARIANT..

I think in your case, if it is a Parameter in report then call the fm in AT SELECTION-SCREEN ON VALUE-REQUEST..

Hope this helps..

Sri

Message was edited by: Srikanth Pinnamaneni

kanthimathikris
Employee
Employee
0 Kudos
219

Try using this function module

REUSE_ALV_VARIANT_F4

Former Member
0 Kudos
220

Hi,

Specify different variant handles for each of the four grids. Some thing like the following,

<b>ls_variant-report = <your program name>.</b>

****Set following handler different for each grid ****reference

****something like 'GRD1', 'GRD2' and so on..

<b>ls_variant-handle = <your grid handle 4 characters>.</b>

CALL METHOD ref_grid->set_table_for_first_display

EXPORTING

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

  • I_CONSISTENCY_CHECK =

  • I_STRUCTURE_NAME =

<b> is_variant = ls_variant</b>

i_save = 'A'

  • I_DEFAULT = 'X'

is_layout = ls_layout

  • IS_PRINT =

  • IT_SPECIAL_GROUPS =

  • it_toolbar_excluding =

  • IT_HYPERLINK =

  • IT_ALV_GRAPHICS =

  • IT_EXCEPT_QINFO =

CHANGING

it_outtab = lt_data

it_fieldcatalog = lt_fcat

  • IT_SORT =

  • IT_FILTER =

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

Hope this helps..

Sri

Message was edited by: Srikanth Pinnamaneni

0 Kudos
219

Hi Sri,

Thank you very much

The hint solved my problem

once again a big thanks

Former Member
0 Kudos
219

Hi Sari,

Hope you need to specify a user defined variant and

Declare a variable for determining the saving options available to the user, and a structure for identifying a variant:

DATA: X_SAVE, "for Parameter I_SAVE

GS_VARIANT TYPE DISVARIANT.

"for Parameter IS_VARIANT

The structure of type DISVARIANT must contain the report ID as a minimum:

G_REPID = SY-REPID.

GS_VARIANT-REPORT = G_REPID.

Determine the saving options

X_SAVE = 'U'.

"variants can only be saved as user specific ones

Pass both variables using call set_table_for_first_display

Regards,

Sailaja