2009 May 26 9:57 AM
Hi Friends,
Having an Internal table with 10 records. When using REUSE_ALV_GRID_DISPLAY,
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = L_REPID
IT_FIELDCAT = LIT_FIELDCATALOG[]
I_SAVE = 'A'
IS_VARIANT = WA_VARIANT_STX
I_DEFAULT = V_DEF
IT_SORT = T_SORT[]
IS_LAYOUT = WA_LAYOUT
TABLES
T_OUTTAB = W_DETAIL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.In output Application Toolbar contains buttons as 'Change Layout', 'Select Layout', 'Save Layout'.
While doing the same using DOCKING CONTAINER.
CALL METHOD g_alvgrid->set_table_for_first_display
EXPORTING
IS_VARIANT = WA_VARIANT_STX
I_SAVE = 'A'
I_DEFAULT = V_DEF
IS_LAYOUT = wa_layout
CHANGING
it_outtab = W_DETAIL
IT_FIELDCATALOG = LIT_FIELDCATALOG[]
IT_SORT = T_SORT[]
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.Only 'Change Layout' is getting displayed in output.
'Select Layout' and 'Save Layout' is missing.
I'm using 4.6C.
How to resolve this?
Regards,
Viji.
2009 May 26 10:44 AM
Hi,
Go through the Example Program BCALV_GRID_09 here you can find the all layout options.
Hi Friends,
Having an Internal table with 10 records. When using REUSE_ALV_GRID_DISPLAY,
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = L_REPID
IT_FIELDCAT = LIT_FIELDCATALOG[]
I_SAVE = 'A'
IS_VARIANT = WA_VARIANT_STX
I_DEFAULT = V_DEF
IT_SORT = T_SORT[]
IS_LAYOUT = WA_LAYOUT
TABLES
T_OUTTAB = W_DETAIL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.In output Application Toolbar contains buttons as 'Change Layout', 'Select Layout', 'Save Layout'.
While doing the same using DOCKING CONTAINER.
CALL METHOD g_alvgrid->set_table_for_first_display
EXPORTING
IS_VARIANT = WA_VARIANT_STX
I_SAVE = 'A'
I_DEFAULT = V_DEF
IS_LAYOUT = wa_layout
CHANGING
it_outtab = W_DETAIL
IT_FIELDCATALOG = LIT_FIELDCATALOG[]
IT_SORT = T_SORT[]
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.Only 'Change Layout' is getting displayed in output.
'Select Layout' and 'Save Layout' is missing.
I'm using 4.6C.
How to resolve this?
Regards,
Viji.
2009 May 26 10:01 AM
Add the Save layout and seelct layout buttons to the toolbar while using OO ALV
Example shown for Select All, Deselect All button being added to OO ALV
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_toolbar.
DATA: ls_toolbar TYPE stb_button.
READ TABLE e_object->mt_toolbar WITH KEY function = g_toolbar
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
CLEAR ls_toolbar.
MOVE 3 TO ls_toolbar-butn_type.
APPEND ls_toolbar TO e_object->mt_toolbar.
CLEAR ls_toolbar.
MOVE 'SELALL'
TO ls_toolbar-function.
MOVE icon_select_all TO ls_toolbar-icon.
MOVE 'Select All'
TO ls_toolbar-quickinfo.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
CLEAR ls_toolbar.
MOVE 3 TO ls_toolbar-butn_type.
APPEND ls_toolbar TO e_object->mt_toolbar.
CLEAR ls_toolbar.
MOVE 'DESELALL'
TO ls_toolbar-function.
MOVE icon_deselect_all TO ls_toolbar-icon.
MOVE 'Deselect All'
TO ls_toolbar-quickinfo.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDIF.
ENDMETHOD.
Hope this helps...
2009 May 26 10:23 AM
Hi,
Would like to know where exactly I have to add this part of code.
Shall I add this before the below code.
CALL METHOD g_alvgrid->set_table_for_first_display
EXPORTING
IS_VARIANT = WA_VARIANT_STX
I_SAVE = 'A'
I_DEFAULT = V_DEF
IS_LAYOUT = wa_layout
CHANGING
it_outtab = W_DETAIL
IT_FIELDCATALOG = LIT_FIELDCATALOG[]
IT_SORT = T_SORT[]
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4Regards,
Viji
2009 May 26 10:30 AM
You need to add it in the class Implementation
************************************************************************
LOCAL CLASS DEFINATION AND IMPLEMENTATION.
************************************************************************
Implementation to handle SELECTALL & DESELECTALL events
************************************************************************
*LOCAL CLASS DEFINATION AND IMPLEMENTATION.
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
ENDCLASS.
class lcl_event_receiver (Implementation)
CLASS lcl_event_receiver IMPLEMENTATION.
Here goes the code previously pasted by me...
And this class implementation and definition should come once the declaration of the codes are done..
i had written it after defining the Selection screen details.. You can do the same.. But i have added the Select All and Deselct All buttons...
You can add ur respective buttons in that part of the code
Hope this helps
2009 May 26 10:07 AM
Check the Drill Down option on Layout change button u will get all the options
save and select layout
2009 May 26 10:13 AM
Hi,
Thanks for your reply.
But the drill down option is not there.
Is there any other way to gt it done?
Regards,
Viji
2009 May 26 10:44 AM
Hi,
Go through the Example Program BCALV_GRID_09 here you can find the all layout options.
2009 May 26 1:07 PM
Hi Friends,
I forgot to pass REPORT name into IS_VARIANT.
This is the cause.
Regards,
Viji.
2010 May 10 1:11 PM
Hi,
Iam not getting SAVE option in the layout when i want to save the layout for future use.
g_mylayout-grid_title = 'PRT Availability Report'(t01).
*
DATA :ls_variant type disvariant.
ls_variant = 'YPPR_TEST' .
CALL METHOD g_alv_grid_0100->set_table_for_first_display
EXPORTING
i_structure_name = 'l_yypp0049_tab' "'g_matdata_tab'
is_variant = ls_variant
i_save = 'A'
i_default = 'X'
is_layout = g_mylayout
CHANGING
it_fieldcatalog = g_fieldcat_tab
it_outtab = l_yypp0049_tmp[].
Iam using the above code.
Pls help out here.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |