Skip to Content
0
Former Member
Sep 17, 2007 at 01:13 PM

multiple selection of e_ucomm in ALV Grid toolbar

343 Views

Dear SAP friends,

I have created HR report.

On the selection screen the User enters some initial data and ALV Grid get displayed.

In event Handle_toolbar the program adds a custom button to standard ALV grid toolbar named "ABSENCE/ATTENDANCE".

In event handle_menu_button the program adds functions to this button.

Then in event handle_user_command depending on the function selected "e_ucomm" the program repopulates the ALV Grid.

METHOD handle_toolbar.
* Append a separator to standard toolbar
    CLEAR gs_toolbar.
    gs_toolbar-butn_type = 3.
    APPEND gs_toolbar TO e_object->mt_toolbar.

    CLEAR gs_toolbar.

    gs_toolbar-function  = 'ABSENCE/ATTENDANCE'.
    gs_toolbar-icon      = icon_position_hr.
    gs_toolbar-quickinfo = 'Absence/Attendance Type'.
    gs_toolbar-butn_type = 2.               " 2-Menu type, 0-single button type
    gs_toolbar-disabled  = space.

    APPEND gs_toolbar TO e_object->mt_toolbar.
  ENDMETHOD.                    "handle_toolbar
*---------------------------------------------------------------------
  METHOD handle_menu_button.
* Handle own menubuttons
    IF e_ucomm = 'ABSENCE/ATTENDANCE'.

     LOOP AT it_aa INTO it_aa_ln.
       MOVE it_aa_ln-type TO w-fcode.

      CONCATENATE   it_aa_ln-type '=' it_aa_ln-text
        INTO w-text
          SEPARATED BY SPACE.
      CALL METHOD e_object->add_function
        EXPORTING
          fcode = w-fcode
          text  = w-text.
     ENDLOOP.

    ENDIF.
  ENDMETHOD.                    "handle_menu_button
*---------------------------------------------------------------------
  METHOD handle_user_command.
    MOVE e_ucomm TO w-abstype.
    PERFORM abs_att USING w-abstype.
  ENDMETHOD.                    "handle_user_command

Is there a way to select more than one line or e_ucomm in other words at a time?

I would like to give my user a choice of let's say one report with three types of absences at a time rather than three reports with one type each.

Thanks,

Tatyana