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

adding push button which display hits in alv grid container

Former Member
0 Likes
1,069

Hi

I am using alv grid container.I am calling my alv list on a subscreen area, i have created alv container for that, Now i have to add 1 push button (no finctionality required) which will display number of records in ALv list,that is same like CL30N transaction output in ALV grid, to see the output in alv grid clicking on find in initial class application tool bar button.

Hi

I am using alv grid container.I am calling my alv list on a subscreen area, i have created alv container for that, Now i have to add 1 push button (no finctionality required) which will display number of records in ALv list,that is same like CL30N transaction output in ALV grid, to see the output in alv grid clicking on find in initial class application tool bar button.

3 REPLIES 3
Read only

Former Member
0 Likes
582

hi

refer

<b></b>

<b></b>

Read only

Former Member
0 Likes
582

1) Copy the standrad pf status and add an extra button in the new pf status.

2) pass this pf-status to the parameter.

I_CALLBACK_PF_STATUS_SET = '<Form name of the form which sets the pf status for your new-pfstatus>'

3) IN the user command, handle what should happen when you click that button.

case sy-ucomm.

when '<FCODE for button>'.

describe table itab lines v_lines.

concatenate 'No of records in itab' v_lines into v_text separated by space.

CALL FUNCTION 'POPUP_TO_INFORM'

EXPORTING

titel = 'Record Count'

txt1 = v_text

txt2 = ' '

txt3 = ' '

txt4 = ' '.

endcase.

REgards,

Ravi

Read only

Former Member
0 Likes
582

Hi,

you need to have local event handler toolbar and user_command.

like below..

*---------------------------------------------------------------------*
*       CLASS lcl_event_handler DEFINITION for second screen
*---------------------------------------------------------------------*
CLASS LCL_EVENT_HANDLER1 DEFINITION .
  PUBLIC SECTION .
    METHODS:
**User Command Handler
    HANDLE_USER_COMMAND FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
                                 IMPORTING E_UCOMM,

    HANDLE_TOOLBAR
        FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
            IMPORTING E_OBJECT E_INTERACTIVE.
ENDCLASS.                    "lcl_event_handler1 DEFINITION
*---------------------------------------------------------------------*
*       CLASS lcl_event_handler1 IMPLEMENTATION
*---------------------------------------------------------------------*
CLASS LCL_EVENT_HANDLER1 IMPLEMENTATION.
*Handle User Command
  METHOD HANDLE_USER_COMMAND.
    <b>PERFORM EVENT_UCOMM1 USING E_UCOMM.</b>
  ENDMETHOD.                    "user_command

  METHOD HANDLE_TOOLBAR.
    DATA: LS_TOOLBAR  TYPE STB_BUTTON.
* append a separator to normal toolbar
    CLEAR LS_TOOLBAR.
    MOVE 3 TO LS_TOOLBAR-BUTN_TYPE.
    APPEND LS_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
* append an icon to  save data
    CLEAR LS_TOOLBAR.
    MOVE 'SAVE' TO LS_TOOLBAR-FUNCTION.
    MOVE <b>ICON_SYSTEM_SAVE</b> TO LS_TOOLBAR-ICON.
    MOVE 'Save' TO LS_TOOLBAR-QUICKINFO.
    MOVE ' Save  '  TO LS_TOOLBAR-TEXT.
    MOVE ' '  TO LS_TOOLBAR-DISABLED.
    APPEND LS_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
    CLEAR LS_TOOLBAR.
* append a separator to normal toolbar
    CLEAR LS_TOOLBAR.
    MOVE 3 TO LS_TOOLBAR-BUTN_TYPE.
    APPEND LS_TOOLBAR TO E_OBJECT->MT_TOOLBAR.

  ENDMETHOD.                    "handle_toolbar
ENDCLASS.                    "lcl_event_handler1 IMPLEMENTATION


  CREATE OBJECT G_HANDLER.
<b>  SET HANDLER G_HANDLER->HANDLE_USER_COMMAND FOR G_GRID.
  SET HANDLER G_HANDLER->HANDLE_TOOLBAR FOR G_GRID.</b>

above code i am using the SAVE_ICON button. you can use your own icon.

and also in the perform you mentioned you have to handle the user command sy-ucomm and show the number of hits.

Regards

vijay