Skip to Content
author's profile photo Former Member
Former Member

Display of push button in the application tool bar in an ALV report

Hello everyone,

Query:

Is it possible to display a custom push button in the application tool bar while displaying an ALV report(1st one)?

On pressing this custom push button will I be able to display another ALV report(2nd one) based on the selection made on the current ALV report(1st one)?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Posted on Oct 18, 2006 at 05:53 AM

    Yeah, its very much possible to add a custom pushbutton on the toolbar through GUI Status. That is you have to create a custom menu bar for your program where you may attach a button.

    The second functionality is also possible by catching the SELFIELD event for ALV on the click of the pushbutton.

    Regards,

    Amit

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 07:16 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 18, 2006 at 07:18 AM

    hi,

    chk this sample standard pgm.

    BCALV_EDIT_05 This example shows how to use checkboxes within an ALV Grid Control. You learn:

    (1) how to define a column for editable checkboxes for an attribute of your list

    (2) how to evaluate the checked checkboxes

    (3) how to switch between editable and non-editable checkboxes

    rgds

    anver

    if hlped pls mark points

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 18, 2006 at 08:07 AM

    hi,

    we can do that.

    for that you need to populate the event structure with USERCOMMAND and SET_PF_STATUS formnames.

    In set_pf_status form ...endform write set pf-status.

    define the buttons in menupainter with OKCODES.

    in form USERCOMMAND capture the OKCODES and do whatever you want .

    dont forget to pass the event structure to GRID/LIST DISPLAY FM of ALV.

    REGARDS,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2006 at 04:22 AM

    Hiii..

    I have written a sample code for You

    ..

    <b>"Call the below FunctionModule For Displaying The List

    " And see the bolded line in the Below FunctionModule

    " STANDARD_02 and USER_COMMAND are the subroutine Names</b>

    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

    EXPORTING

    • I_INTERFACE_CHECK = ' '

    • I_BYPASSING_BUFFER =

    • I_BUFFER_ACTIVE = ' '

    i_callback_program = sy-repid

    <b>i_callback_pf_status_set = 'STANDARD_02'</b>

    <b> i_callback_user_command = 'USER_COMMAND '</b>

    i_structure_name = 'ZST_SCARR'

    is_layout = is_layout

    it_fieldcat = gt_fieldcat[]

    • IT_EXCLUDING =

    • IT_SPECIAL_GROUPS =

    • IT_SORT =

    • IT_FILTER =

    • is_sel_hide = is_sel_hide

    • I_DEFAULT = 'X'

    • I_SAVE = ' '

    • IS_VARIANT =

    it_events = e03_lt_events[]

    • IT_EVENT_EXIT =

    • is_print = t

    • IS_REPREP_ID =

    • I_SCREEN_START_COLUMN = 0

    • I_SCREEN_START_LINE = 0

    • I_SCREEN_END_COLUMN = 0

    • I_SCREEN_END_LINE = 0

    • IR_SALV_LIST_ADAPTER =

    • IT_EXCEPT_QINFO =

    • I_SUPPRESS_EMPTY_DATA = ABAP_FALSE

    • IMPORTING

    • E_EXIT_CAUSED_BY_CALLER =

    • ES_EXIT_CAUSED_BY_USER =

    TABLES

    t_outtab = it_scarr

    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.

    *----


    • FORM PF_STATUS_SET

    **----


    <b>" Here Set A Button In Application Toolbar Using PF- Status</b>

    FORM standard_02 USING extab TYPE slis_t_extab.

    SET PF-STATUS 'STANDA02' EXCLUDING extab.

    ENDFORM. "STANDARD_02

    &----


    *& Form USER_COMMAND

    &----


    • text

    ----


    • -->R_UCOMM text

    • -->RS_SELFIELDtext

    ----


    FORM user_command USING r_ucomm LIKE sy-ucomm

    rs_selfield TYPE slis_selfield.

    CASE r_ucomm.

    <b> "menubutton with functioncode GOTO's Action</b>

    WHEN 'GOTO'.

    READ TABLE it_scarr INDEX rs_selfield-tabindex. "cursorposit.

    IF sy-subrc = 0.

    WRITE:/ it_scarr-carrid,

    / it_scarr-carrname.

    ENDCASE.

    ENDFORM. "USER_COMMAND<b></b>

    Hope it helps..

    Regards,

    Simy

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2006 at 04:52 AM

    You should copy the 'STANDARD' GUI status from program SAPLKKBL using transaction SE90 >Programming SubObjects> Gui Status.

    Execute this transaction to get to next screen. select status using checkbox. click on GUI Status --> Copy.

    Enter your Z program name and the name you what for this status - you can keep it as 'STANDARD' to be simple.

    Then you can edit the new status to add or delete buttons. This will also bring in the standard SAP ALV functionality such as sorting/subtotaling etc...

    When you call 'REUSE_ALV_GRID_DISPLAY' make sure you pass it the new status name.

    an example of one of mine:

    call function 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = 'ZSDBOLST_REPORT'

    i_callback_pf_status_set = 'STANDARD' <----


    i_callback_user_command = 'USER_COMMAND'

    i_structure_name = 'I_BOLACT'

    i_grid_title = 'BOL Action Report'(031)

    is_layout = gs_layout

    it_fieldcat = gt_fieldcat[]

    i_save = 'A'

    is_variant = v_variant

    TABLES

    t_outtab = i_bolact

    EXCEPTIONS

    program_error = 1

    others = 2.

                                                                                                                                  • Form Set_pf_status

                                                                                                                                  • Notes: Called by FM REUSE_ALV_GRID_DISPLAY

                                                                                                                                                                                                                                                                  FORM set_pf_status USING rt_extab TYPE slis_t_extab.

                                                                                                                                                                                                                                                                  SET PF-STATUS 'ZSTANDARD'.

                                                                                                                                                                                                                                                                  ENDFORM. "Set_pf_status

                                                                                                                                                                                                                                                                  Best Regards,

                                                                                                                                                                                                                                                                  Vibha

                                                                                                                                                                                                                                                                  *Please mark all the helpful answers

                                                                                                                                                                                                                                                                Add a comment
                                                                                                                                                                                                                                                                10|10000 characters needed characters exceeded

                                                                                                                                                                                                                                                                Before answering

                                                                                                                                                                                                                                                                You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
                                                                                                                                                                                                                                                                You must be Logged in to submit an answer.

                                                                                                                                                                                                                                                                Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.