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

Displaying a Push button in the application toolbar for 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

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 05:46 AM

    Yes u can have pushbutton on application toolbar.

    You just have to use the new pf status in your report program.

    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.

    Have a look at below code for using the new status.

    TYPE-POOLS: slis.

    DATA: i_qmel LIKE qmel OCCURS 0.

    data v_repid type repid.

    SELECT * FROM qmel INTO TABLE i_qmel.

    v_repid = sy-repid.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    I_CALLBACK_PROGRAM = v_repid

    I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'

    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

    i_structure_name = 'QMEL'

    TABLES

    t_outtab = i_qmel

    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 set_pf_status using rt_extab type slis_t_extab.

    set pf-status 'TEST'.

    endform.

    FORM user_command USING ucomm LIKE sy-ucomm

    selfield TYPE slis_selfield.

    data lv_ucomm type sy-ucomm.

    lv_ucomm

    = sy-ucomm.

    CASE lv_ucomm.

    WHEN 'BUTTON'. "Double Click line Item

    **Write ur functinality here

    endcase.

    endform.

    Also have a look at below links.

    http://www.sap-basis-abap.com/abap/add-button-to-alv-toolbar-with-reuse-alv-list-display.htm

    ALV report

    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.