Application Development and Automation 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: 
Read only

Save alv display variant

Former Member
0 Likes
1,631

Hi,

Im using FM REUSE_ALV_LIST_DISPLAY, and the user was able to modify the display report. However, the user cannot save the display variant.

Anything I missed?

Please help.

Thanks.

8 REPLIES 8
Read only

Former Member
0 Likes
970

DATA : l_layout TYPE disvariant.

l_layout-report = sy-repid.

l_layouth-zebra = 'X'.

CALL METHOD gr_alvgrid->set_table_for_first_display

EXPORTING

  • I_BUFFER_ACTIVE =

  • I_BYPASSING_BUFFER =

  • I_CONSISTENCY_CHECK =

i_structure_name = 'ZQM01'

is_variant = l_layout

i_save = 'A'

  • I_DEFAULT = 'X'

  • is_layout = gs_layout

  • IS_PRINT =

  • IT_SPECIAL_GROUPS =

  • IT_TOOLBAR_EXCLUDING =

  • IT_HYPERLINK =

  • IT_ALV_GRAPHICS =

  • IT_EXCEPT_QINFO =

CHANGING

it_outtab = gt_list[]

it_fieldcatalog = gt_fieldcat

  • IT_SORT =

  • IT_FILTER =

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Using OOP:

i had send you the sample code

&----


*& Form DISPLAY_ALV_REPORT

&----


  • Display report using ALV grid

----


form display_alv_report.

gd_repid = sy-repid.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = gd_repid

  • i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM

  • i_callback_user_command = 'USER_COMMAND'

  • i_grid_title = outtext

is_layout = gd_layout

it_fieldcat = fieldcatalog[]

  • it_special_groups = gd_tabgroup

  • IT_EVENTS = GT_XEVENTS

i_save = 'X'

  • is_variant = z_template

tables

t_outtab = it_ekko

exceptions

program_error = 1

others = 2.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

endform. " DISPLAY_ALV_REPORT

Please give me reward points...

Thanks

Murali Poli

Read only

Former Member
0 Likes
970

By specifying the param in FM REUSE_ALV_LIST_DISPLAY

    • i_save = 'A'

the variant can be saved.

Also check the link below for more info:

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

Read only

Former Member
0 Likes
970

Hi,

look at I_SAVE parameter

Read only

Former Member
0 Likes
970

Hi,

In the Function module, Juse comment I_SAVE and IS_VARIANT fields ..

Regards

Sudheer

Read only

0 Likes
970

Hi,

I already put the following parameters:

i_default = 'X'

i_save = 'A'

is_variant = d_variant

d_variant is blank. The program is in 4.0B. But STILL the variant cannot be saved.

Please help.

Thanks.

Tylen

Read only

uwe_schieferstein
Active Contributor
0 Likes
970

Hello

You have to provide the following IMPORTING parameters with values:

DATA:
  ls_variant   TYPE disvariant.

  ls_variant-report = syst-repid.  " Report displaying the ALV list
  ls_variant-handle = 'GRID'.      " unique ID if report contains multiple ALV list

is_variant = l_layout
i_save = 'A'  " User can save global and user-specific layouts

Regards

Uwe

Read only

0 Likes
970

Sorry, here is the corrected coding:


DATA:
  ls_variant   TYPE disvariant.
 
  ls_variant-report = syst-repid.  " Report displaying the ALV list
  ls_variant-handle = 'GRID'.      " unique ID if report contains multiple ALV list
 
is_variant = ls_variant
i_save = 'A'  " User can save global and user-specific layouts

Regards

Uwe

Read only

Former Member
0 Likes
970

hi,

try like this.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = 'ZALV_DS'

is_layout = st_layout

<b> i_save = 'A'</b>

it_fieldcat = t_fcat

it_events = t_eve

TABLES

t_outtab = itab

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

now u can sat the layout u want by setting->layout->change.

ANd make that layout default.

Hope it will b useful.

reward if useful.