05-26-2014 12:09 PM
Hi All,
I have developed an ALV report using Container.
I found that Standard tool bar buttons at top of Container are missing like sort ascending, sort descending, Summetion, Excel download, etc...
I want that even Standard tool bar buttons have to display for better options.
help me regarding this.
Regards,
Naresh.
05-26-2014 12:20 PM
05-26-2014 12:20 PM
05-26-2014 12:25 PM
Hi Naveen,
Data : gv_alvgrid TYPE REF TO cl_gui_alv_grid.
DATA: gv_ccontainer TYPE REF TO cl_gui_custom_container.
DATA: gv_custom_control_name TYPE scrfname VALUE 'CONT_ALV_OUTPUT'.
IF gv_alvgrid IS INITIAL.
*Creating custom container instance
CREATE OBJECT gv_ccontainer
EXPORTING
container_name = gv_custom_control_name.
*Creating ALV Grid instance
CREATE OBJECT gv_alvgrid
EXPORTING
i_parent = gv_ccontainer.
DATA : lv_disvariant TYPE disvariant.
lv_disvariant = sy-repid.
CALL METHOD gv_alvgrid->set_table_for_first_display
EXPORTING
is_variant = lv_disvariant
i_save = 'A'
is_layout = gs_layout
i_default = 'X'
* it_toolbar_excluding = ' '
CHANGING
it_outtab = gt_final
it_fieldcatalog = gt_fieldcat.
Regards,
Naresh.
05-26-2014 12:34 PM
Hi Naresh ,
You can append buttons to the button toolbar in the container and then bind the buttons to the event listener / receiver as follows:
http://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=117506242
This will handle all the events as per SAP definitions.
Hope this helps.
Regards,
Naveen
05-26-2014 12:43 PM
Hi Naveen,
Mistake is mine...
I am handling other's object, he has set no_toolbar = 'X' in layout.
that;s y it was missed.
i have removed it and able to get standard tool bar as required.
Regards,
Naresh.
05-26-2014 12:48 PM
Hi Naresh,
Nice to know problem is resolved.
Pl close the thread now.
Regards,
Naveen