Button in ALV Report

Hi All,
I want to know how to create a button in alv report .
Please respond to my query.
Thanks and Regards,
Aman

hi aman,
u can try this example:
where i have a created a button:
*& Report  Z_GURU_ALV_EVENT01                                          *
report  z_guru_alv_event01                      .
tables: mara, makt.
type-pools slis.
data: begin of imara occurs 0,
        matnr like mara-matnr,
        ernam like mara-ernam,
        ersda like mara-ersda,
      end of imara.
data: begin of imakt occurs 0,
        matnr like mara-matnr,
        spras like makt-spras,
        maktx like makt-maktx,
      end of imakt.
data: ffc type slis_t_fieldcat_alv,
      ievents type slis_t_event with header line,
      iievent type slis_t_event with header line.
select-options: s_matnr for mara-matnr.
initialization.
call function 'REUSE_ALV_EVENTS_GET'
exporting
   i_list_type           = 0
importing
   et_events             = ievents[]
EXCEPTIONS
  LIST_TYPE_WRONG       = 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.
read table ievents with key name = slis_ev_top_of_page.
ievents-form = 'TOPP'.
modify ievents transporting form where name = slis_ev_top_of_page.
clear ievents.
read table ievents with key name = slis_ev_user_command.
ievents-form = 'USR_COM'.
modify ievents transporting form where name = slis_ev_user_command.
clear ievents.
read table ievents with key name = slis_ev_pf_status_set.
ievents-form = 'PFSTAT'.
modify ievents transporting form where name = slis_ev_pf_status_set.
clear ievents.
call function 'REUSE_ALV_EVENTS_GET'
exporting
   i_list_type           = 0
importing
   et_events             = iievent[]
EXCEPTIONS
  LIST_TYPE_WRONG       = 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.
read table iievent with key name = slis_ev_pf_status_set.
iievent-form = 'PFSTAT'.
modify iievent transporting form where name = slis_ev_pf_status_set.
clear iievent.
read table iievent with key name = slis_ev_user_command.
iievent-form = 'USERCOM'.
modify iievent transporting form where name = slis_ev_user_command.
clear iievent.
start-of-selection.
select matnr ernam ersda from mara into table imara where matnr
in s_matnr.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
   i_program_name               = sy-repid
   i_internal_tabname           = 'IMARA'
  I_STRUCTURE_NAME             =
  I_CLIENT_NEVER_DISPLAY       = 'X'
   i_inclname                   = sy-repid
  I_BYPASSING_BUFFER           =
  I_BUFFER_ACTIVE              =
  changing
    ct_fieldcat                  = ffc
EXCEPTIONS
  INCONSISTENT_INTERFACE       = 1
  PROGRAM_ERROR                = 2
  OTHERS                       = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
  I_INTERFACE_CHECK                 = ' '
  I_BYPASSING_BUFFER                = ' '
  I_BUFFER_ACTIVE                   = ' '
   i_callback_program                = sy-repid
  I_CALLBACK_PF_STATUS_SET          = ' '
  I_CALLBACK_USER_COMMAND           = ' '
   i_callback_top_of_page            = 'ALV_BACKGROUND'
  I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
   i_callback_html_end_of_list       = 'ALV_BACKGROUND'
  I_STRUCTURE_NAME                  =
   i_background_id                   = 'ALV_BACKGROUND'
  I_GRID_TITLE                      =
  I_GRID_SETTINGS                   =
  IS_LAYOUT                         =
   it_fieldcat                       = ffc
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
  IT_SORT                           =
  IT_FILTER                         =
  IS_SEL_HIDE                       =
  I_DEFAULT                         = 'X'
  I_SAVE                            = ' '
  IS_VARIANT                        =
   it_events                         = ievents[]
  IT_EVENT_EXIT                     =
  IS_PRINT                          =
  IS_REPREP_ID                      =
  I_SCREEN_START_COLUMN             = 0
  I_SCREEN_START_LINE               = 0
  I_SCREEN_END_COLUMN               = 0
  I_SCREEN_END_LINE                 = 0
  IT_ALV_GRAPHICS                   =
  IT_HYPERLINK                      =
  IT_ADD_FIELDCAT                   =
  IT_EXCEPT_QINFO                   =
  I_HTML_HEIGHT_TOP                 =
  I_HTML_HEIGHT_END                 =
IMPORTING
  E_EXIT_CAUSED_BY_CALLER           =
  ES_EXIT_CAUSED_BY_USER            =
  tables
    t_outtab                          = imara
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 topp.
data: it_top type slis_t_listheader,"”having s , h ,a
       wa type slis_listheader.
      IT_SPEC TYPE SLIS_T_SPECIALCOL_ALV,
      WA1 TYPE SLIS_SPECIALCOL_ALV.
wa-typ = 'H'.
wa-info = 'RELIANCE GLOBAL SERVICES' .
append wa to it_top.
clear wa.
wa-typ = 'S'.wa-key = 'NO:23'.
wa-info = 'TRIPLICANE HIGH ROAD'.
append wa to it_top.
clear wa.
wa-typ = 'S'.
wa-info = 'TRIPLICANE'.
append wa to it_top.
clear wa.
wa-typ = 'A'.
wa-info = 'sample'.
append wa to it_top.
clear wa.
call function 'REUSE_ALV_COMMENTARY_WRITE'
   exporting
     it_list_commentary       = it_top
    i_logo                   = 'ENJOYSAP_LOGO'
   I_END_OF_LIST_GRID       =
   I_ALV_FORM               =
endform.
form usr_com using r_ucomm type sy-ucomm r_selfield type slis_selfield.
case r_ucomm.
when 'CANC'.
leave to screen 0.
endcase.
data: ff type slis_t_fieldcat_alv.
data: v_vbeln(18) type n.
v_vbeln = r_selfield-value.
select matnr spras maktx
from makt into table imakt
up to 10 rows
where matnr = v_vbeln.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
   i_program_name               = sy-repid
   i_internal_tabname           = 'IMAKT'
  I_STRUCTURE_NAME             =
  I_CLIENT_NEVER_DISPLAY       = 'X'
   i_inclname                   = sy-repid
  I_BYPASSING_BUFFER           =
  I_BUFFER_ACTIVE              =
  changing
    ct_fieldcat                  = ff
EXCEPTIONS
  INCONSISTENT_INTERFACE       = 1
  PROGRAM_ERROR                = 2
  OTHERS                       = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
  I_INTERFACE_CHECK                 = ' '
  I_BYPASSING_BUFFER                = ' '
  I_BUFFER_ACTIVE                   = ' '
   i_callback_program                = sy-repid
  I_CALLBACK_PF_STATUS_SET          = ' '
  I_CALLBACK_USER_COMMAND           = ' '
  I_CALLBACK_TOP_OF_PAGE            = ' '
  I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
  I_CALLBACK_HTML_END_OF_LIST       = ' '
  I_STRUCTURE_NAME                  =
  I_BACKGROUND_ID                   = ' '
  I_GRID_TITLE                      =
  I_GRID_SETTINGS                   =
  IS_LAYOUT                         =
   it_fieldcat                       = ff
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
  IT_SORT                           =
  IT_FILTER                         =
  IS_SEL_HIDE                       =
  I_DEFAULT                         = 'X'
  I_SAVE                            = ' '
  IS_VARIANT                        =
   it_events                         = iievent[]
  IT_EVENT_EXIT                     =
  IS_PRINT                          =
  IS_REPREP_ID                      =
  I_SCREEN_START_COLUMN             = 0
  I_SCREEN_START_LINE               = 0
  I_SCREEN_END_COLUMN               = 0
  I_SCREEN_END_LINE                 = 0
  I_HTML_HEIGHT_TOP                 = 0
  I_HTML_HEIGHT_END                 = 0
  IT_ALV_GRAPHICS                   =
  IT_HYPERLINK                      =
  IT_ADD_FIELDCAT                   =
  IT_EXCEPT_QINFO                   =
  IR_SALV_FULLSCREEN_ADAPTER        =
IMPORTING
  E_EXIT_CAUSED_BY_CALLER           =
  ES_EXIT_CAUSED_BY_USER            =
  tables
    t_outtab                          = imakt
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.
endform. "USR_COM
form pfstat using extab type slis_t_extab.
set pf-status 'STD' excluding extab.
endform. " pfstat
form usercom using rucom type sy-ucomm rselfield type slis_selfield.
case rucom.
when 'CANC'.
leave to screen 0.
endcase.
data: ffc type slis_t_fieldcat_alv,
      v_matnr(18) type n.
v_matnr = rselfield-value.
select matnr ernam ersda from mara into table imara
where matnr = v_matnr.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
   i_program_name               = sy-repid
   i_internal_tabname           = 'IMARA'
  I_STRUCTURE_NAME             =
  I_CLIENT_NEVER_DISPLAY       = 'X'
   i_inclname                   = sy-repid
  I_BYPASSING_BUFFER           =
  I_BUFFER_ACTIVE              =
  changing
    ct_fieldcat                  = ffc
EXCEPTIONS
  INCONSISTENT_INTERFACE       = 1
  PROGRAM_ERROR                = 2
  OTHERS                       = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
  I_INTERFACE_CHECK                 = ' '
  I_BYPASSING_BUFFER                = ' '
  I_BUFFER_ACTIVE                   = ' '
   i_callback_program                = sy-repid
  I_CALLBACK_PF_STATUS_SET          = ' '
  I_CALLBACK_USER_COMMAND           = ' '
  I_CALLBACK_TOP_OF_PAGE            = ' '
  I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
  I_CALLBACK_HTML_END_OF_LIST       = ' '
  I_STRUCTURE_NAME                  =
  I_BACKGROUND_ID                   = ' '
  I_GRID_TITLE                      =
  I_GRID_SETTINGS                   =
  IS_LAYOUT                         =
   it_fieldcat                       = ffc
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
  IT_SORT                           =
  IT_FILTER                         =
  IS_SEL_HIDE                       =
  I_DEFAULT                         = 'X'
  I_SAVE                            = ' '
  IS_VARIANT                        =
   it_events                         = iievent[]
  IT_EVENT_EXIT                     =
  IS_PRINT                          =
  IS_REPREP_ID                      =
  I_SCREEN_START_COLUMN             = 0
  I_SCREEN_START_LINE               = 0
  I_SCREEN_END_COLUMN               = 0
  I_SCREEN_END_LINE                 = 0
  IT_ALV_GRAPHICS                   =
  IT_HYPERLINK                      =
  IT_ADD_FIELDCAT                   =
  IT_EXCEPT_QINFO                   =
  I_HTML_HEIGHT_TOP                 =
  I_HTML_HEIGHT_END                 =
IMPORTING
  E_EXIT_CAUSED_BY_CALLER           =
  ES_EXIT_CAUSED_BY_USER            =
  tables
    t_outtab                          = imara
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.
endform.

Similar Messages

  • Information button in ALV report

    Information button in ALV report is not working. any suggestion

    I have copied standard tool bar from standard program.During debugging, I have found that function code is defferent. Then I changed function code according to that.

  • Control User Specific button in ALV report

    Hi,
    Can anybody please suggest me how to control "USER SPECIFIC" button in ALV report layout using authorization object. I mean if you can tell me which authorization object is responsible to control the "USER SPECIFIC" button.

    additional info to what Lakshmi already said:-
    normally the restrictions for saving layouts/display variants are done at 2 levels:
    1) The developer of an ALV list first predetermines the authorization in the 'i_save' parameter within the code.
    I_SAVE = ' '     -
    layouts cannot be saved
    I_SAVE = 'A'   -
    user-specific and cross-user layouts can be saved
    I_SAVE = 'X'   --- cross-user layouts can be saved
    I_SAVE = 'U'  ---  user-specific layouts can be saved
    2) The second level comes to us restriciting the S_ALV_LAYO which gives access to users to save global layouts if I_SAVE for that particular transaction is A or X.
    for example, a report has I_SAVE= 'A', which means
    it will allow to save  User-specific  layouts without any restrictions.
    and if user has S_ALV_LAYO then he can save both User-Specific and Global Layouts(variants).
    it would be better to keep this object separate.

  • How to give  push button in alv report  output

    hi,
    my requirement is that , i have to give push button in alv report output(item level) not in application toolbar, i am using reuse_alv_grid_display FM, can any body provide me sample code
    regards,
    siva kumar

    have a look at this thread, also has a sample report at the end from Uwe Schieferstein.
    [button on alv list|How to add and program a pushbutton on ALV grid line;
    seems not to work try this:
    How to add and program a pushbutton on ALV grid line
    Edited by: Micky Oestreich on May 15, 2008 10:20 PM

  • Add buttons in ALV Report output

    Dear Friends,
    I am developing one ALV report in PP moule for calculating Shelf Life. The output is coming properly in ALV.
      But my additional requirement is ADD coustomise buttons in ALV Reports.
    Please give me an idea how can I insert buttons in my alv report?
    Thanks & Regards
    Vasu

    Hi vasu,
    consider the code given below.
          FORM F4200_PF_STATUS_SET                                      *
    FORM f4200_pf_status_set USING i_extab TYPE slis_t_extab.
      REFRESH i_extab.
      PERFORM f4210_exclude_fcodes CHANGING i_extab.
    The PF status is an exact copy of the PF status 'STANDARD' of program
    SAPLSALV but with command 'CHNG' added to it.
      SET PF-STATUS 'ZSOM_STANDARD' EXCLUDING i_extab.
    ENDFORM.
    *&      Form  f4210_exclude_fcodes
    FORM f4210_exclude_fcodes USING i_extab TYPE slis_t_extab.
      DATA: ws_fcode TYPE slis_extab.
      CLEAR ws_fcode.
      ws_fcode = '&EB9'.            " Call up Report.
      APPEND ws_fcode TO i_extab.
      ws_fcode = '&ABC'.            " ABC Analysis.
      APPEND ws_fcode TO i_extab.
      ws_fcode = '&NFO'.            " Info Select.
      APPEND ws_fcode TO i_extab.
      ws_fcode = '&LFO'.            " Information.
      APPEND ws_fcode TO i_extab.
    ENDFORM.                    " f4210_exclude_fcodes
    *&      Form  f4300_user_command
    FORM f4300_user_command USING ucomm LIKE sy-ucomm
                                             selfield TYPE slis_selfield.
      CASE ucomm.
        WHEN '&IC1'.                              "Double Click line Item
          READ TABLE i_data INDEX selfield-tabindex.
          IF i_data-qmnum NE space.
            SET PARAMETER ID 'IQM' FIELD i_data-qmnum.
            CALL TRANSACTION 'IW52' AND SKIP FIRST SCREEN.
            CLEAR ucomm.
          ENDIF.
        WHEN 'CHNG'.                          " Change Notification Icon
          READ TABLE i_data INDEX selfield-tabindex.
          IF i_data-qmnum NE space.
            SET PARAMETER ID 'IQM' FIELD i_data-qmnum.
            CALL TRANSACTION 'IW52' AND SKIP FIRST SCREEN.
          CLEAR ucomm.
          ENDIF.
      ENDCASE.
      CLEAR ucomm.
    ENDFORM.                    " f4300_user_command
    EXPLANATION
    In this program, first we created a PF status (ZSOM_STANDARD), which was an exact copy of STANDARD of program SAPLSALV through transaction SE41 (Menu Painter). Then we added another button to it,with a new fcode called ‘CHNG’.  After this this we set this PF status instead of STANADRD.
    We initialize a third event USER_COMMAND and associate a form with it. In this form we can capture the function codes and write any functionality under it. If we write functionality for an existing fcode, then this gets precedence over the default functionality that might be associated with it.
    In this example, we capture a standard fcode ‘&IC1’ that is nothing but double clicking a line of the report.  We are capturing the notification number of that line and calling transaction IW52 with it. We are also doing the same when a user clicks on the new ‘Change Notification’ button.
    When the user clicks the “Back’ button in IW52, it comes back to the report.
    Please reward for the same.
    Message was edited by: Prakhar Saxena

  • How can we place a push button in ALV  report

    hi
    could anybody inform me
    how can we place a push button in ALV  report
    thanx
    regards
    kals.

    Hi kals.
    please have a look at demoprogram
    SALV_DEMO_TABLE_FUNCTIONS
    BCALV_GRID_05
    Regards
    Bernd

  • How to create user defined button in alv report

    how to create user defined button in alv report
    thnks in advance.

    Hi,
    U can define it the the PF-STATUS ( Menu for ALV ).
    For that u have to define it in the EVENTCAT.
    form z_eventcat  using    p_i_eventcat type slis_t_event.
      data: i_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
        exporting
          i_list_type     = 0
        importing
          et_events       = p_i_eventcat
        exceptions
          list_type_wrong = 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.
      clear i_event.
      read table p_i_eventcat with key name = slis_ev_top_of_page into
      i_event.
      if sy-subrc = 0.
        move 'TOP_OF_PAGE' to i_event-form.
        append i_event to p_i_eventcat.
      endif.
      read table p_i_eventcat with key name = slis_ev_pf_status_set into i_event.
      if sy-subrc = 0.
        move 'SET_PF_STATUS' to i_event-form.
        append i_event to p_i_eventcat.
      endif.
      clear i_event.
      read table p_i_eventcat into i_event with key name = slis_ev_user_command .
      if sy-subrc = 0.
        move 'USER_COMMAND' to i_event-form.
        append i_event to p_i_eventcat.
      endif.
    And in the DISPLAY
    call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
         i_callback_program                = v_progname
         i_callback_pf_status_set          = 'SET_PF_STATUS'
         i_callback_user_command           = 'USER_COMMAND'
         i_callback_top_of_page            = 'TOP_OF_PAGE'
         i_grid_title                      = v_gridtitle
         i_save                            = 'A'
         is_layout                         = i_layout
         it_fieldcat                       = i_fieldcat[]
         it_sort                           = i_sortinfo
         it_events                         = i_eventcat
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        tables
          t_outtab                          = it_final
       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.
    *MENU SETTINGS.
    form set_pf_status using rt_extab type slis_t_extab.
      set pf-status 'ALV_MENU'.
    endform.                    "SET_PF_STATUS
    endform.                    " Z_EVENTCAT
    Now double click on ALV MENU nad u can create a button in the application bar.
    Regards,
    Pritha.

  • Radio button in alv report

    Hi experts,
    I am using radio buttons in alv report by using screen painter but error occurs in alv that screen doesn't exist in module.
    plz help me.

    Hi Ankita,
    check this program.
    *& Report ZALVGRID_WITH_RADIOBUTTONS
    *& This program shows how to realize radiobuttons in ALV grid lists
    *& using event HOTSPOT_CLICK.
    *& Screen 100:
    *& - Flow logic
    *& PROCESS BEFORE OUTPUT.
    *& MODULE PBO.
    *& PROCESS AFTER INPUT.
    *& MODULE PAI.
    *& - Screen elements: none
    *& - ok-code field -> gd_okcode
    *& GUI Status MAIN100:
    *& - F3 = 'BACK', Shift+F3 = 'EXIT', F12 = 'CANC'
    PROGRAM zalvgrid_with_radiobuttons.
    TYPE-POOLS: abap, icon. " INCLUDE . for releases < 6.20
    TYPES: BEGIN OF ty_s_sflight.
    INCLUDE TYPE sflight.
    TYPES: button1 TYPE iconname.
    TYPES: button2 TYPE iconname.
    TYPES: button3 TYPE iconname.
    TYPES: button4 TYPE iconname.
    TYPES: END OF ty_s_sflight.
    DATA:
    gt_sflight TYPE STANDARD TABLE OF ty_s_sflight,
    gs_layout TYPE lvc_s_layo,
    gt_fcat TYPE lvc_t_fcat.
    DATA:
    gd_okcode TYPE ui_func,
    go_docking TYPE REF TO cl_gui_docking_container,
    go_grid TYPE REF TO cl_gui_alv_grid.
    CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
    PUBLIC SECTION.
    CLASS-METHODS:
    handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
    IMPORTING
    e_row_id
    e_column_id
    es_row_no
    sender.
    ENDCLASS. "lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
    METHOD handle_hotspot_click.
    define local data
    FIELD-SYMBOLS:
    IS ASSIGNED ).
    Set all radio buttons "unselected"
    IS ASSIGNED ).
    Set selected radio button "selected".
    = icon_wd_radio_button.
    ENDIF.
    Force PAI followed by refresh of table display in PBO
    CALL METHOD cl_gui_cfw=>set_new_ok_code
    EXPORTING
    new_code = 'REFRESH'
    IMPORTING
    RC =
    ENDMETHOD. "handle_hotspot_click
    ENDCLASS. "lcl_eventhandler IMPLEMENTATION
    MAIN *
    START-OF-SELECTION.
    PERFORM select_data.
    PERFORM init_controls.
    PERFORM build_fieldcatalog.
    PERFORM set_layout.
    CALL METHOD go_grid->set_table_for_first_display
    EXPORTING
    i_structure_name = 'SFLIGHT'
    is_layout = gs_layout
    CHANGING
    it_fieldcatalog = gt_fcat
    it_outtab = gt_sflight.
    Link docking container to dynpro
    CALL METHOD go_docking->link
    EXPORTING
    repid = syst-repid
    dynnr = '0100'
    CONTAINER =
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 2
    lifetime_dynpro_dynpro_link = 3
    OTHERS = 4.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL SCREEN 100.
    END-OF-SELECTION.
    MODULE PBO OUTPUT *
    MODULE pbo OUTPUT.
    SET PF-STATUS 'MAIN100'.
    SET TITLEBAR 'MAIN100'.
    ENDMODULE. "PBO OUTPUT
    MODULE PAI INPUT *
    MODULE pai INPUT.
    Leave report
    CASE gd_okcode.
    WHEN 'BACK' OR
    'EXIT' OR
    'CANC'.
    SET SCREEN 0. LEAVE SCREEN.
    Refresh table display
    WHEN 'REFRESH'.
    PERFORM refresh_display.
    WHEN OTHERS.
    do nothing
    ENDCASE.
    CLEAR gd_okcode.
    ENDMODULE. "PAI INPUT
    *& Form BUILD_FIELDCATALOG
    text
    --> p1 text
    <-- p2 text
    FORM build_fieldcatalog .
    ALV List with Radio Buttons
    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
    © 2007 SAP AG 7
    define local data
    DATA:
    ls_fcat TYPE lvc_s_fcat.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
    I_BUFFER_ACTIVE =
    i_structure_name = 'ICON'
    I_CLIENT_NEVER_DISPLAY = 'X'
    I_BYPASSING_BUFFER =
    I_INTERNAL_TABNAME =
    CHANGING
    ct_fieldcat = gt_fcat
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    DELETE gt_fcat WHERE ( fieldname <> 'NAME' ).
    NOTE: field ICON-NAME has data element ICONNAME.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
    I_BUFFER_ACTIVE =
    i_structure_name = 'SFLIGHT'
    I_CLIENT_NEVER_DISPLAY = 'X'
    I_BYPASSING_BUFFER =
    I_INTERNAL_TABNAME =
    CHANGING
    ct_fieldcat = gt_fcat
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ TABLE gt_fcat INTO ls_fcat
    WITH KEY fieldname = 'NAME'.
    IF ( syst-subrc = 0 ).
    DELETE gt_fcat INDEX syst-tabix.
    ENDIF.
    ls_fcat-fieldname = 'BUTTON4'.
    ls_fcat-coltext = ls_fcat-fieldname.
    ls_fcat-icon = 'X'.
    ls_fcat-hotspot = 'X'.
    INSERT ls_fcat INTO gt_fcat INDEX 5.
    ls_fcat-fieldname = 'BUTTON3'.
    ls_fcat-coltext = ls_fcat-fieldname.
    INSERT ls_fcat INTO gt_fcat INDEX 5.
    ls_fcat-fieldname = 'BUTTON2'.
    ls_fcat-coltext = ls_fcat-fieldname.
    INSERT ls_fcat INTO gt_fcat INDEX 5.
    ls_fcat-fieldname = 'BUTTON1'.
    ls_fcat-coltext = ls_fcat-fieldname.
    INSERT ls_fcat INTO gt_fcat INDEX 5.
    Renumbering of the columns
    LOOP AT gt_fcat INTO ls_fcat.
    ls_fcat-col_pos = syst-tabix.
    MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
    ENDLOOP.
    ENDFORM. " BUILD_FIELDCATALOG
    *& Form SELECT_DATA
    text
    --> p1 text
    <-- p2 text
    FORM select_data .
    define local data
    DATA:
    ls_sflight TYPE ty_s_sflight.
    SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_sflight.
    ls_sflight-button1 = icon_wd_radio_button. " selected radiobutton
    ls_sflight-button2 = icon_wd_radio_button_empty.
    ls_sflight-button3 = icon_wd_radio_button_empty.
    ls_sflight-button4 = icon_wd_radio_button_empty.
    Alternatively: create icons using function module 'ICON_CREATE'
    on SAP releases where these icons are not available.
    MODIFY gt_sflight FROM ls_sflight
    TRANSPORTING button1 button2 button3 button4
    WHERE ( carrid IS NOT INITIAL ).
    ENDFORM. " SELECT_DATA
    *& Form INIT_CONTROLS
    text
    --> p1 text
    <-- p2 text
    FORM init_controls .
    CHECK ( go_docking IS NOT BOUND ).
    ALV List with Radio Buttons
    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
    © 2007 SAP AG 9
    Create docking container
    CREATE OBJECT go_docking
    EXPORTING
    parent = cl_gui_container=>screen0
    REPID =
    DYNNR =
    SIDE = DOCK_AT_LEFT
    EXTENSION = 50
    STYLE =
    LIFETIME = lifetime_default
    CAPTION =
    METRIC = 0
    ratio = 90
    NO_AUTODEF_PROGID_DYNNR =
    NAME =
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 2
    create_error = 3
    lifetime_error = 4
    lifetime_dynpro_dynpro_link = 5
    OTHERS = 6.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Size of container = full screen size
    CALL METHOD go_docking->set_extension
    EXPORTING
    extension = 99999
    EXCEPTIONS
    cntl_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.
    Create ALV grid instance
    CREATE OBJECT go_grid
    EXPORTING
    I_SHELLSTYLE = 0
    I_LIFETIME =
    i_parent = go_docking
    I_APPL_EVENTS = space
    I_PARENTDBG =
    I_APPLOGPARENT =
    I_GRAPHICSPARENT =
    I_NAME =
    I_FCAT_COMPLETE = SPACE
    EXCEPTIONS
    error_cntl_create = 1
    error_cntl_init = 2
    error_cntl_link = 3
    error_dp_create = 4
    OTHERS = 5.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Set event handler for event HOTSPOT_CLICK
    SET HANDLER:
    lcl_eventhandler=>handle_hotspot_click FOR go_grid.
    ENDFORM. " INIT_CONTROLS
    *& Form REFRESH_DISPLAY
    Refresh table display after switching the radiobuttons
    --> p1 text
    <-- p2 text
    FORM refresh_display .
    define local data
    DATA:
    ls_stable TYPE lvc_s_stbl.
    ls_stable-row = abap_true.
    ls_stable-col = abap_true.
    CALL METHOD go_grid->refresh_table_display
    EXPORTING
    is_stable = ls_stable
    I_SOFT_REFRESH =
    EXCEPTIONS
    finished = 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.
    ENDFORM. " REFRESH_DISPLAY
    *& Form SET_LAYOUT
    Set layout for ALV list
    --> p1 text
    <-- p2 text
    FORM set_layout .
    CLEAR: gs_layout.
    gs_layout-cwidth_opt = abap_true. " optimize column width
    gs_layout-zebra = abap_true.
    ENDFORM. " SET_LAYOUT
    Regards,
    Prasanth
    Reward if helpful

  • How to create a radio button in ALV Reports

    Hi all,
    Best wishes to all..
    Kindly reply me to this question... that is "How to create a radio button in ALV Report"
    Thanks and Regards
    Anjali

    HI
    here is an example :
    PROGRAM ZUS_SDN_BCALV_GRID_DEMO_2.
    Based on: BCALV_GRID_DEMO.
    TYPE-POOLS: icon.
    TYPES: BEGIN OF ty_s_sflight.
    INCLUDE TYPE sflight.
    TYPES: button1    TYPE lvc_emphsz.
    TYPES: button2    TYPE lvc_emphsz.
    TYPES: button3    TYPE lvc_emphsz.
    TYPES: button4    TYPE lvc_emphsz.
    TYPES: END OF ty_s_sflight.
    DATA:
      gt_sflight    TYPE STANDARD TABLE OF ty_s_sflight,
      gt_fcat       TYPE lvc_t_fcat.
    DATA: ok_code LIKE sy-ucomm,
         gt_sflight TYPE TABLE OF sflight,
          g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
          grid1  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container.
          CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA:
          md_cnt    TYPE i.
        CLASS-METHODS:
          handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
            IMPORTING
              e_row_id
              e_column_id
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
          CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_hotspot_click.
    define local data
        FIELD-SYMBOLS:
          <ls_entry>    TYPE ty_s_sflight,
          <ld_fld>      TYPE ANY.
        READ TABLE gt_sflight ASSIGNING <ls_entry> INDEX es_row_no-row_id.
        CHECK ( <ls_entry> IS ASSIGNED ).
      Set all radio buttons "unselected"
        <ls_entry>-button1 =  icon_wd_radio_button_empty.
        <ls_entry>-button2 =  icon_wd_radio_button_empty.
        <ls_entry>-button3 =  icon_wd_radio_button_empty.
        <ls_entry>-button4 =  icon_wd_radio_button_empty.
        ASSIGN COMPONENT e_column_id-fieldname OF STRUCTURE <ls_entry>
                                                  TO <ld_fld>.
        IF ( <ld_fld> IS ASSIGNED ).
        Set selected radio button "selected".
          <ld_fld> = icon_wd_radio_button.
        ENDIF.
      Force PAI followed by refresh of table display in PBO
        CALL METHOD cl_gui_cfw=>set_new_ok_code
          EXPORTING
            new_code = 'DUMMY'
         IMPORTING
           RC       =
      ENDMETHOD.                    "handle_hotspot_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
          MAIN                                                          *
      PERFORM select_data.
      CALL SCREEN 100.
          MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
      SET PF-STATUS 'MAIN100'.
      IF g_custom_container IS INITIAL.
        CREATE OBJECT g_custom_container
               EXPORTING container_name = g_container.
        CREATE OBJECT grid1
               EXPORTING i_parent = g_custom_container.
        PERFORM build_fieldcatalog.
        CALL METHOD grid1->set_table_for_first_display
         EXPORTING
           i_structure_name = 'SFLIGHT'
          CHANGING
            it_fieldcatalog  = gt_fcat
            it_outtab        = gt_sflight.
      Set event handler for event TOOLBAR
        SET HANDLER:
          lcl_eventhandler=>handle_hotspot_click FOR grid1.
      else.
        CALL METHOD grid1->refresh_table_display
         EXPORTING
           IS_STABLE      =
           I_SOFT_REFRESH =
          EXCEPTIONS
            FINISHED       = 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.
      ENDIF.
    ENDMODULE.                    "PBO OUTPUT
          MODULE PAI INPUT                                              *
    MODULE pai INPUT.
      to react on oi_custom_events:
      CALL METHOD cl_gui_cfw=>dispatch.
      CASE ok_code.
        WHEN 'EXIT'.
          PERFORM exit_program.
        WHEN OTHERS.
        do nothing
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                    "PAI INPUT
          FORM EXIT_PROGRAM                                             *
    FORM exit_program.
    CALL METHOD G_CUSTOM_CONTAINER->FREE.
    CALL METHOD CL_GUI_CFW=>FLUSH.
      LEAVE PROGRAM.
    ENDFORM.                    "EXIT_PROGRAM
    *&      Form  BUILD_FIELDCATALOG
          text
    -->  p1        text
    <--  p2        text
    FORM build_fieldcatalog .
    define local data
      DATA:
        ls_fcat        TYPE lvc_s_fcat,
        ls_hype        TYPE lvc_s_hype.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
        I_BUFFER_ACTIVE              =
          i_structure_name             = 'LVC_S_FCAT'
        I_CLIENT_NEVER_DISPLAY       = 'X'
        I_BYPASSING_BUFFER           =
        I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      DELETE gt_fcat WHERE ( fieldname <> 'EMPHASIZE' ).
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
        I_BUFFER_ACTIVE              =
          i_structure_name             = 'SFLIGHT'
        I_CLIENT_NEVER_DISPLAY       = 'X'
        I_BYPASSING_BUFFER           =
        I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE gt_fcat INTO ls_fcat
           WITH KEY fieldname = 'EMPHASIZE'.
      IF ( syst-subrc = 0 ).
        DELETE gt_fcat INDEX syst-tabix.
      ENDIF.
      ls_fcat-fieldname = 'BUTTON4'.
      ls_fcat-icon    = 'X'.
      ls_fcat-hotspot = 'X'.
      INSERT ls_fcat INTO gt_fcat INDEX 4.
      ls_fcat-fieldname = 'BUTTON3'.
      INSERT ls_fcat INTO gt_fcat INDEX 4.
      ls_fcat-fieldname = 'BUTTON2'.
      INSERT ls_fcat INTO gt_fcat INDEX 4.
      ls_fcat-fieldname = 'BUTTON1'.
      INSERT ls_fcat INTO gt_fcat INDEX 4.
      LOOP AT gt_fcat INTO ls_fcat.
        ls_fcat-col_pos = syst-tabix.
        MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
      ENDLOOP.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  SELECT_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM select_data .
    define local data
      DATA:
        ls_sflight    TYPE ty_s_sflight.
      SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_sflight.
      ls_sflight-button1 = icon_wd_radio_button.
      ls_sflight-button2 = icon_wd_radio_button_empty.
      ls_sflight-button3 = icon_wd_radio_button_empty.
      ls_sflight-button4 = icon_wd_radio_button_empty.
      MODIFY gt_sflight FROM ls_sflight
          TRANSPORTING button1 button2 button3 button4
        WHERE ( carrid IS NOT INITIAL ).
    ENDFORM.                    " SELECT_DATA
    Regards,
    Prasanth
    Reward all helpful answers

  • How to get GUI Status(Push Buttons) in ALV Report

    Hi Friends
    I have a requirement in a way that:
    Once selection-screen was processed,an ALV report has to come and above the ALV List,I need a custom GUI Status(4 Push Button) with Push Buttons Logic.
    Once I had clicks on thesse push button,I need to display one more ALV List and above this List,again I need a custom GUI Status(2 Push Buttons) with Push Buttons Logic.
    Can anyone throw some light how we can achieve this.
    Thanks for your cooperation!
    Regards,
    Madisetty

    data: rt_extab type slis_t_extab,
            g_ucomm like sy-ucomm ,
            g_selfield type slis_selfield.
    form alv_display .
      call function 'REUSE_ALV_LIST_DISPLAY'
         exporting
         i_callback_program             = g_repid
         i_callback_pf_status_set       = 'PF_STATUS'
         i_callback_user_command        = 'USER_COMM'
           it_fieldcat                    = it_fldcat
          tables
            t_outtab                       = it_final1
      perform pf_status using rt_extab.
      perform user_comm using g_ucomm g_selfield .
    endform.  
    form pf_status  using    p_rt_extab.
      set pf-status 'PF_STATUS' excluding p_rt_extab.
    endform.
    form user_comm  using    p_ucomm like sy-ucomm
                             p_selfield type slis_selfield.
      data: l_row type i.
      case  p_ucomm.
        when 'DISPLAY_PO'.
          loop at it_final1 into wa_final1.
            if wa_final1-sel eq 'X' .
              l_row = l_row + 1.
            endif.
            if l_row gt 1.
              message e004.
            endif.
            clear wa_final1.
          endloop.
          p_selfield-fieldname = 'SEL'.
          read table it_final1 into wa_final1 index p_selfield-tabindex .
          set parameter id 'BES' field wa_final1-ebeln.
          call transaction 'ME23N'.
      endcase.
    endform.
    *create user interface for gui status by double clicking on 'PF_STATUS'.
    *Check the above sample code .

  • How to add button in ALV report (Class method )?

    Hello experts,
    I have developed one ALV report using classes.
    I want to add one more  button on the report like already is there named DISPLQUA
    How ca i do that here?
    Following the code of CLASS definition & implimentation
    CLASS lcl_handle_events DEFINITION.
      PUBLIC SECTION.
        METHODS:
          handle_on_user_command FOR EVENT added_function OF cl_salv_events
            IMPORTING e_salv_function.
    ENDCLASS.                    "lcl_handle_events DEFINITION
          CLASS lcl_handle_events IMPLEMENTATION
    CLASS lcl_handle_events IMPLEMENTATION.
      METHOD handle_on_user_command.
        CASE e_salv_function.
          WHEN 'DISPLQUA'.
            PERFORM show_quant_record.
         WHEN 'DISPQM03'.                                " Here i want to add button
           PERFORM display_quality_notification.
          WHEN OTHERS.
        ENDCASE.
      ENDMETHOD.                    "handle_on_user_command
    ENDCLASS.                    "lcl_handle_events IMPLEMENTATION

    HI Ronny.
    Code snippet for reference.
    CLASS LCL_EVENT_HANDLER DEFINITION .
      PUBLIC SECTION.
        METHODS :
    *--Toolbar control
          HANDLE_TOOLBAR FOR EVENT TOOLBAR
            OF CL_GUI_ALV_GRID IMPORTING E_OBJECT
                                         E_INTERACTIVE,
    ENDCLASS
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
    *--handle toolbar
      METHOD HANDLE_TOOLBAR.
    * append a separator to normal toolbar
        CLEAR G_TOOLBAR.
        G_TOOLBAR-BUTN_TYPE = 3.
        APPEND G_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
        CLEAR G_TOOLBAR.
        G_TOOLBAR-FUNCTION = 'SAVE'.
        G_TOOLBAR-ICON = ICON_SYSTEM_SAVE.
        G_TOOLBAR-BUTN_TYPE = 0.
        G_TOOLBAR-QUICKINFO = 'Save the Customer'(203).
        APPEND G_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
      ENDMETHOD.                    "HANDLE_TOOLBAR
    Hope this helps.
    Gary.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Apr 7, 2008 5:41 PM

  • Hide Change Layout Button in ALV report o/p for MB52 Tcode

    Hi,
    Is it possible to Hide Change Layout Button in ALV output for Report MB52 using authoriztaion.
    We have created a layout in which we are hiding some coloumns which the user should not see.
    But if the change layout button is active then the user can add those coloumns to output.
    Is this possible through authorizations. I want to avoid doing any chnages to the std sap program.
    Thanks & Regards,
    Fawaz

    Check the object S_ALV_LAYO

  • Push button in alv report

    Dear Experts,
             How to add pushbutton in alv report.....
    *& Report  ZTT_TEST_ALV
    REPORT  ZTT_TEST_ALV.
    *data declarations
    type-pools : SLIS.
    *  data : BEGIN OF wa_kna1,
    *                kunnr type kunnr,
    *                name1 type name1,
    *         end of wa_kna1,
    * it_kna1 like tABLE OF wa_kna1.
    data : begin of wa_mara,
      matnr type matnr,
      end of wa_mara,
      it_mara like table of wa_mara.
      data : it_fcat type slis_t_fieldcat_alv,
             wa_fcat like line of it_fcat.
    *selection screen
      SELECTION-SCREEN begin of block k with frame title text-001.
    *  select-OPTIONS : s_kunnr for wa_kna1-kunnr.
         select-OPTIONS : s_matnr for wa_mara-matnr.
      SELECTION-SCREEN end of block k.
    *select auery
    *SELECT kunnr name1 INTO table it_kna1 from kna1 where kunnr in s_kunnr.
    select matnr into table it_mara from mara where matnr in s_matnr.
    *for displaying fieldcatalog
      PERFORM fcat using '1' 'MATNR' 'material Number' 'C410' '20'.
    *  PERFORM fcat using '2' 'NAME1' 'Customer Name' 'C410' '36'.
    *for displaying output
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
    *   I_CALLBACK_PROGRAM                = ' '
       I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
    *   I_CALLBACK_USER_COMMAND           = ' '
    *   I_CALLBACK_TOP_OF_PAGE            = ' '
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
    *   I_STRUCTURE_NAME                  =
    *   I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      = 'Report for Customer Details'
    *   I_GRID_SETTINGS                   =
    *   IS_LAYOUT                         =
       IT_FIELDCAT                       = it_fcat[]
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS                 =
    *   IT_SORT                           =
    *   IT_FILTER                         =
    *   IS_SEL_HIDE                       =
    *   I_DEFAULT                         = 'X'
    *   I_SAVE                            = ' '
    *   IS_VARIANT                        =
    *   IT_EVENTS                         =
    *   IT_EVENT_EXIT                     =
    *   IS_PRINT                          =
    *   IS_REPREP_ID                      =
    *   I_SCREEN_START_COLUMN             = 0
    *   I_SCREEN_START_LINE               = 0
    *   I_SCREEN_END_COLUMN               = 0
    *   I_SCREEN_END_LINE                 = 0
    *   I_HTML_HEIGHT_TOP                 = 0
    *   I_HTML_HEIGHT_END                 = 0
    *   IT_ALV_GRAPHICS                   =
    *   IT_HYPERLINK                      =
    *   IT_ADD_FIELDCAT                   =
    *   IT_EXCEPT_QINFO                   =
    *   IR_SALV_FULLSCREEN_ADAPTER        =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
      TABLES
        t_outtab                          = it_mara.
    * 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.
    *CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    *  EXPORTING
    ****   I_INTERFACE_CHECK              = ' '
    ****   I_CALLBACK_PROGRAM             =
    ****   I_CALLBACK_PF_STATUS_SET       = ' '
    ****   I_CALLBACK_USER_COMMAND        = ' '
    ****   IS_LAYOUT                      =
    *   IT_FIELDCAT                    = it_fcat
    ****   IT_EXCLUDING                   =
    ****   IT_SPECIAL_GROUPS              =
    ****   IT_SORT                        =
    ****   IT_FILTER                      =
    ****   IS_SEL_HIDE                    =
    ****   I_SCREEN_START_COLUMN          = 0
    ****   I_SCREEN_START_LINE            = 0
    ****   I_SCREEN_END_COLUMN            = 0
    ****   I_SCREEN_END_LINE              = 0
    ****   I_DEFAULT                      = 'X'
    ****   I_SAVE                         = ' '
    ****   IS_VARIANT                     =
    ****   IT_EVENTS                      =
    ****   IT_EVENT_EXIT                  =
    ***    i_tabname_header               =
    ***    i_tabname_item                 =
    ****   I_STRUCTURE_NAME_HEADER        =
    ****   I_STRUCTURE_NAME_ITEM          =
    ***    is_keyinfo                     =
    ****   IS_PRINT                       =
    ****   IS_REPREP_ID                   =
    ****   I_BYPASSING_BUFFER             =
    ****   I_BUFFER_ACTIVE                =
    ****   IR_SALV_HIERSEQ_ADAPTER        =
    ****   IT_EXCEPT_QINFO                =
    ****   I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    **** IMPORTING
    ****   E_EXIT_CAUSED_BY_CALLER        =
    ****   ES_EXIT_CAUSED_BY_USER         =
    *  tables
    **    t_outtab_header                = it_
    *    t_outtab_item                  = it_kna1.
    **** 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  FCAT
    *       text
    *      -->P_0052   text
    *      -->P_0053   text
    *      -->P_0054   text
    form FCAT  using    fp_col_pos
                        fp_fieldname
                        fp_seltext_m
                        fp_emphasize
                        fp_outputlen..
    wa_fcat-col_pos = fp_col_pos.
    wa_fcat-fieldname = fp_fieldname.
    wa_fcat-seltext_m = fp_seltext_m.
    wa_fcat-emphasize = fp_emphasize.
    wa_fcat-outputlen = fp_outputlen.
    append wa_fcat to it_fcat.
    clear : wa_fcat.
    endform.                    " FCAT
    FORM SET_PF_STATUS                                         .
    SET PF-STATUS 'ZNEWSTATUS' .
    "Copy of 'STANDARD' pf_status from fgroup SALV
    endform.
    i need one push button in alv output display.
    Thanks and Regards,
    Thirukumaran. R

    HI THIRU TRY FOLLOWING CODES:
    *& Report  ZSAMPLE
    REPORT  ZSAMPLE.
    TABLES:MARA.
    TYPE-POOLS: SLIS.
    TYPES:BEGIN OF TY_ITAB,
          MATNR LIKE MARA-MATNR,
          ERSDA LIKE MARA-ERSDA,
          END OF TY_ITAB.
    DATA:ITAB TYPE STANDARD TABLE OF TY_ITAB WITH HEADER LINE.
    DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV,
              WA_FCAT TYPE SLIS_FIELDCAT_ALV,
              LAYOUT TYPE SLIS_LAYOUT_ALV,
              WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS:P_MATNR TYPE MARA-MATNR.
    SELECTION-SCREEN END OF BLOCK B1.
    START-OF-SELECTION.
      PERFORM FIELDCAT.
      LAYOUT-ZEBRA = 'X'.
      PERFORM OUTPUT.
    *&      Form  PF_STATUS
          text
         -->RT_EXTAB   text
    FORM PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'BUTT'.
    ENDFORM.                    "PF_STATUS
    *&      Form  PUSH_BUTT1
          text
         -->R_UCOMM      text
         -->RS_SELFIELD  text
    FORM GET USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN 'GET'.
          IF SY-SUBRC EQ 0.
            CALL TRANSACTION 'SE11'.
          ELSE.
          ENDIF.
        WHEN 'EXIT' OR 'CANCEL' .
          LEAVE PROGRAM.
      ENDCASE.
    ENDFORM.                                                    "PUSH_BUTT1
    *&      Form  FIELDCAT
          text
    -->  p1        text
    <--  p2        text
    FORM FIELDCAT .
      WA_FCAT-SELTEXT_L = 'Select'.
      WA_FCAT-COL_POS = '1'.
      WA_FCAT-FIELDNAME = 'CHECK'.
      WA_FCAT-CHECKBOX = 'X'.
      WA_FCAT-TABNAME = 'ITAB'.
      WA_FCAT-OUTPUTLEN =  '4'.
      WA_FCAT-INPUT(1) = 'X'.
    WA_FCAT-EDIT_MASK(1) = 'X'.
      WA_FCAT-EDIT(1) = 'X'.
      APPEND WA_FCAT TO FCAT.
      CLEAR WA_FCAT.
      WA_FCAT-SELTEXT_L = 'Material Number'.
      WA_FCAT-COL_POS = '2'.
      WA_FCAT-FIELDNAME = 'MATNR'.
      WA_FCAT-TABNAME = 'ITAB'.
      WA_FCAT-OUTPUTLEN =  '18'.
      APPEND WA_FCAT TO FCAT.
      CLEAR WA_FCAT.
      WA_FCAT-SELTEXT_L = 'Date'.
      WA_FCAT-COL_POS = '3'.
      WA_FCAT-FIELDNAME = 'ERSDA'.
      WA_FCAT-TABNAME = 'ITAB'.
      WA_FCAT-OUTPUTLEN =  '8'.
      APPEND WA_FCAT TO FCAT.
      CLEAR WA_FCAT.
    ENDFORM.                    " FIELDCAT
    *&      Form  OUTPUT
          text
    -->  p1        text
    <--  p2        text
    FORM OUTPUT .
      SELECT MATNR ERSDA FROM MARA
        INTO TABLE ITAB
        WHERE MATNR EQ  P_MATNR.
      IF SY-SUBRC EQ 0.
        PERFORM GRID.
      ELSE.
        MESSAGE 'No Records Found' TYPE 'I'.
      ENDIF.
    ENDFORM.                    " OUTPUT
    *&      Form  GRID
          text
    -->  p1        text
    <--  p2        text
    FORM GRID .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
       I_CALLBACK_PROGRAM              = SY-REPID
       I_CALLBACK_PF_STATUS_SET        = 'PF_STATUS'
       I_CALLBACK_USER_COMMAND         = 'GET'
       IS_LAYOUT                         = LAYOUT
         IT_FIELDCAT                     = FCAT
       I_DEFAULT                         = 'X'
        TABLES
          T_OUTTAB                          = ITAB.
    ENDFORM.                    " GRID
    REGARDS,
    SAKTHIVEL.VT

  • Summation button in ALV report is giving shortdump

    Dear All,
    I have developed a ALV report. The report is a simple ALV report (Using REUSE_ALV_GRID_DISPLAY). When I am pressing the summation button at the top, it is giving a shortdump. The reason I have found out is the no. of columns are very large (45 to 50). Can anyone suggest how to handle this situation?
    Best wishes,
    Atanu

    Hi atanu,
    then you can use DO_SUM = 'X' (for the field which you want to sum option) in the fieldcat , this will try to sum while display it self.i mean in list display it will show the totals also.
    then you need not to explicitly click on SUM button.
    Regards
    vijay

  • To disable the Application tool bar button in ALV report

    Hi Everyone,
    Iam using REUSE_ALV_GRID_DISPLAY to display ALV report.
    Now my requirement is to disable(I mean grey out) a application tool bar button.
    Thanks in advance
    Moderator message: please search for available information and try yourself before asking.
    locked by: Thomas Zloch on Sep 23, 2010 11:38 AM

    We can disable the buttons on the application toolbar as below.
    *To Exclude a few buttons from the Application tool bar
    data: it_excluding type slis_t_extab.
    data: wa_excluding type slis_extab.
    wa_excluding-fcode = '&OUP'.
    append wa_excluding to it_excluding.
    wa_excluding-fcode = '&ILT'.
    append wa_excluding to it_excluding.
    wa_excluding-fcode = '&ODN'.
    append wa_excluding to it_excluding.
    and in the FM.....
    call function 'REUSE_ALV_GRID_DISPLAY'
          exporting
            i_callback_program      = sy-repid
            i_callback_pf_status_set = 'ZPICK'
            is_layout               = itlayout
            i_callback_user_command =  'LIST1'
            i_grid_title            = <fs>
    *       i_callback_top_of_page  = ' '
            it_fieldcat             = itfieldcat[]
            it_excluding            = it_excluding
    But,no idea on how to disable the  whole application tool bar itself ?
    K.Kiran.

Maybe you are looking for

  • Please read this before you load SECURITY UPDATE 2010-006

    I've just spent 72 hours with frozen cursors and frozen screens - so far all directly related to security update 2010-006. After successfully using SuperDuper! to erase my Internal HD and load a 2+ week old system without security update 2010-006 I s

  • HT4061 my iPhone 4 just vibrates constantly and doesnt do anything else

    can anyone help my iphone started vibrating yesterday and wont do anything else all i get is a constant vibration untill the batteries dead

  • Can´t import artwork in itunes7

    I had not been able to create an itunes account, because I do not live in the countries where the store is currently open. Therefore, when I import music from CDs it does not import automatically artwork (one of the most desired features). What can I

  • Deploying Crystal Reports (CR for VS2010) to Windows Server 2008

    What do I need to deploy an ASP.NET web application built in VS2010 (.NET 4.0) to Windows Server 2008 Standard? One by one I've been fixing this issue and then that issue, trying to get this app deployed to our server. The latest issue is an event in

  • Backing up DVD install software to my HD?

    i just had to install iWork '09 due to some issue i am having in yosemite with pages and i am realizing i have fewer and fewer install DVD's while most of my install software is on my hard drive or on App Store. is there a way to back up these instal