Checkbox problem in ALV toolbar

Hello all,
I hv added a checkbox in my alv toolbar using classes.
i.e. MOVE 'NO_DEFECTS' TO ls_toolbar-function.
      MOVE 'No Defects' TO ls_toolbar-quickinfo.
      MOVE 'No Defects' TO ls_toolbar-text.
      MOVE 5 TO ls_toolbar-butn_type.
      MOVE ' ' TO ls_toolbar-disabled.
      APPEND ls_toolbar TO e_object->mt_toolbar.
Alv is displaying in one subscreen.
My problem is my checkbox is displaying as a button instead of a check box and also i want to know how can i check whether my checkbox is active or not.
I want to disable some buttons in the alv toolbar based on this checkbox.
Thanks in advance.
regards,
Lokesh

Hi,
To disable the buttons in the toolbar, In the ALV events exclude the fcodes of the buttons you want to disable and pass it to the
to the program like the below statement
  set pf-status 'STDPOPBX_FULLSCREEN' excluding lt_extab
                          of program 'SAPLKKBL'.
To use the check box pass the ls_toolbar-ICON as ICON_WD_CHECK_BOX.
Regards,
Kranthi

Similar Messages

  • ALV-Toolbar : Control the &LOCAL& Buttons

    Hi, all
    I have the following problem with ALV-Toolbar.
    If I use editable ALV-Grid Control, I get in the toolbar new buttons such as DELETE_ROW or UNDO. This buttons don’t trigger any events of the class CL_GUI_ALV_GRID.
    If I look at Function Code of such buttons in the Table mt_toolbar they are quiet similar. All of them have &LOCAL&……. 
    How could I control  this buttons  with my program .
    Many thanks for your help
    Vladimir Golovtchiner

    Hello Anand,
    Thank you for your answers.
    I thought that these buttons are belonged  to Front-End.
    I hope that ALV-Grid is an OCX. Or not? If it is an OCX-Object, is it possible to communicate with it?
    I have no any idea now, how to solve that, but I could explain to you – why I need to handle these buttons.
    I use an editable Grid of CL_GUI_ALV_GRID. For the last two columns I use Drag and Drop to move data from the pre-last column to the last column. It work properly until the following situation:
    For example I  have two rows in a Grid. I place the cursor to the last row and press the button “COPY_ROW” two times ( I have 4 rows in a Grid now). Immediately after that I try to do Drag&Drop at the last row (4th) from the Grid. As I drop the cursor on the last cell of the last row I get always the result in the last cell of the 2nd row ( the last row before I insert two rows).
    It doesn’t matter how many rows I had or how many rows I inserted to the Grid. It happens also in the middle of the Grid not only at the end.
    After the first Drag&Drop it begins to work properly. 
    I debugged the handler of Drag&Drop and I saw that the Drag&Drop object has in the structure E_ROW each time the number of the last row before insertion. I forced the update of backend in the handle of “on Drag” event with CHECK_CHANGED_DATA before I create the Drag&Drop object and passed the Drag&Drop handle to the internal table. It didn’t work.
    That is why I thought that I should do this update after each insertion or deletion with these buttons.
    In other words – I don’t want to change the functionality of these buttons I want to add something before.
    Best regards
    Vladimir Golovtchiner

  • Add a button choice on alv toolbar in wda

    Hello Experts,
    I want add a button choice on alv toolbar. I already insert the choice button indeed I see the button correctly.
    Now I want insert the list of action with the following code:
    <<
    >>
    With this code my web-interface retuns this message: "500 SAO INTERNAL SERVER ERROR. ERROR ACCESS via null object reference not possible. (termination rabax_state)". The dump is in "cl_wdr_utilities=>construct_mime_url".
    Do you have any ideas? Do you have any examples?
    Thanks in advance.
    Best Regards,
    Marino

    Hello,
    the problem isn't "the line set_image_source". The problem was the order, the correct order is:
    <<
    CREATE OBJECT lr_button_choice.
         lr_button_choice->set_image_source( 'ICON_CHANGE' ).    "#EC *
         lr_button_choice->set_text( value = 'Modifica' ).
         lr_button_choice->set_tooltip( value = 'Modifica Attributi').
    CREATE OBJECT lr_menu_action_item
           EXPORTING
             id = 'MOD_NOTE'." TYPE REF TO cl_salv_wd_menu_action_item.
         lr_menu_action_item->set_text( 'Note').
         lr_button_choice->add_choice( EXPORTING  value = lr_menu_action_item ).
         CREATE OBJECT lr_menu_action_item
           EXPORTING
             id = 'MOD_CONTO'." TYPE REF TO cl_salv_wd_menu_action_item.
         lr_menu_action_item->set_text( 'Conto').
         lr_button_choice->add_choice( EXPORTING  value = lr_menu_action_item ).
         lr_function = wd_this->salv_incassi->if_salv_wd_function_settings~create_function( id = 'MOD')."creating the function for alv button
         lr_function->set_editor( lr_button_choice ).
    >>
    Thanks very much.
    Best Regards,
    Marino

  • ALV Toolbar Runtime error

    Hi
          i am enhancing one report.i just added some fields like standard price,special procurement,safety stock.i'm displaying the
    report in ALV.my problem is report displaying is fine.but when i click any ALV toolbar buttons like export to local file,print preview.before enhancement,ALV tool bar is working fine.it is showing the runtime error like "The statement strlen(obj) the argument 'obj' can only take a character type data obj.in this case,the operand 'ob' has the non character type".i am unabale to find where exactly error is occuring.. when i start debugger in runtime error 'the cursor going to 'gs_out-hlplen = strlen( <field> ).when i click this one is is showing my standard price value of the first material in ALV like '3367.44'.can anyone suggest on this issue.
    Thanks
    Arjun

    Hi PranavJeeth,
                             this is my field catalog.i'm just showing one field.
                   PERFORM set_field USING:
                          FIELD   SHORT TEXT   LONG TEXT             OUTLEN  TYP FMT SUM HID
                          'STPRS' 'STD.PRICE ' 'STANDARD PRICE      ' '00011'    'P'   ' '        ' '     ' ',
    FORM set_field USING pv_fieldname TYPE c
                         pv_descr_s   TYPE c
                         pv_descr_m   TYPE c
                         pv_length    TYPE c
                         pv_inttype   TYPE c
                         pv_format    TYPE c
                         pv_sum       TYPE c
                         pv_hide      TYPE c.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = pv_fieldname.
      gw_fieldcat-seltext_s = pv_descr_s.
      gw_fieldcat-seltext_m = pv_descr_m.
      gw_fieldcat-outputlen = pv_length.
      gw_fieldcat-inttype   = pv_inttype.
      gw_fieldcat-no_out    = pv_hide.
    CASE pv_format.
    *-- Prices must have corresponding currency for format purposes
      If no currency field is needed (fixed currency), use
      GW_FIELDCAT-CURRENCY instead of GW_FIELDCAT-CFIELDNAME
        WHEN 'P'.                           " prices
          gw_fieldcat-currency   = 'MYR'.
          gw_fieldcat-do_sum     = pv_sum.
                                               when i excute report is ok.but when we clcik on alv toolbar runtime error occuring.when i run debugger,the code like this
    if gs_fc-tech_form ne 99.
    gs_out-hlplen = strlen( <field> ).
    endif.
       when i click on field the values like this
         <field> = 100
         gs_fc-tech_form  = 90.
                 please suggest on this issue.

  • Problem in ALV report

    Hi Friends,
    I have the following 2 problems in ALV report
    1) Logo is not getting displayed in the report.
    2) When i click on the Purchase order number in the report  the interactive report is not working,i am not able to see report of First interactive level.
    can you help it out friends.
    Thanks and regards
    Dinesh
    REPORT  YSDBALV1
    tables: ekko , ekpo .
    type-pools: slis .
    Table for Display Header
    data:i_header type slis_t_listheader with header line.
    *Fieldcat Declaration
    data:fieldcatalog type slis_T_fieldcat_alv  WITH HEADER LINE.
    *Table of Events
    data:i_event type slis_t_event with header line .
    For Layout
    data:i_layout type slis_layout_alv .
    data: text(30) .
    *Internal Table Declaration
    data: begin of it_final occurs 0 ,
          ebeln like ekko-ebeln ,           "Purchasing Document No.
          bedat like ekko-bedat ,           "Purchasing Document Date
          matnr like ekpo-matnr ,           "Material No.
          netwr like ekpo-netwr ,         "Net Order Value in PO Currancy
          meins like ekpo-meins ,           "UOM
          chk(1) ,
          light(1) ,
          change like ekpo-menge ,
          end of it_final .
    **select option Declaration
    selection-screen begin of block block.
    select-options: s_ebeln for ekko-ebeln  .
    selection-screen end of block block .
    selection-screen begin of block block1 .
    parameters:grid radiobutton group r .
    parameters:list radiobutton group r .
    selection-screen end of block block1 .
    at selection screen
    at selection-screen .
    select single * from ekko where ebeln in s_ebeln .
    if sy-subrc <> 0 .
       message e000(8I) WITH 'No Data Exists' .
    endif .
    start-of-selection .
    if grid = 'X' .
    perform get_data .
    perform event using i_event[] .
    perform field using fieldcatalog[] .
    perform layout using i_layout .
    perform grid_display .
    endif .
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    form get_data .
    *DATA Retrieval from tables
    SELECT EKKO~EBELN
           EKKO~BEDAT
           EKPO~EBELP
           EKPO~MATNR
           EKPO~NETWR
           EKPO~MEINS
           EKPO~MENGE
           EKPO~BPRME
           INTO CORRESPONDING FIELDS OF  table IT_FINAL
           FROM EKKO INNER JOIN EKPO ON EKKOEBELN = EKPOEBELN
           WHERE EKKO~EBELN IN S_EBELN.
           APPEND IT_FINAL.
    endform.                    " get_data
    *Getting the Event for Top of Page display.
    *&      Form  event
          text
         -->P_I_event[]  text
    form event  using    p_i_event type slis_t_event.
      clear p_i_event .
      refresh p_i_event .
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
       I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = p_i_event
    EXCEPTIONS
       LIST_TYPE_WRONG       = 1
       OTHERS                = 2
    read table p_i_event with key name = slis_ev_top_of_page into i_event.
          if sy-subrc = 0.
                 move 'TOP_OF_PAGE_PO' to i_event-form.
                 modify p_i_event from i_event index sy-tabix transporting form.
          endif.
          clear i_event.
    endform.                    " event
    *Display Top-of –Page Details and Logo
    form top_of_page_po .
           clear i_header .
           refresh i_header .
           write sy-datum to text.
           i_header-typ = 'H'.
           i_header-info = 'PURCHASE OREDER DETAILS'.
           append i_header.
          *Logo Display
          CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
                 EXPORTING
                     it_list_commentary       = i_header[]
                     I_LOGO                   = 'ENJOYSAPLOGO'.
    endform .
    *Field Catalog Append
    *&      Form  field
          text
         -->P_fieldCATALOG[]  text
    form field using  p_fieldcatalog type slis_t_fieldcat_alv.
         clear fieldcatalog.
          fieldcatalog-fieldname   = 'EBELN'.
          fieldcatalog-seltext_m   = 'Purchase Order No'.
          fieldcatalog-col_pos     = 1.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'BEDAT'.
          fieldcatalog-seltext_m   = 'PO Date'.
          fieldcatalog-col_pos     = 2.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'MATNR'.
          fieldcatalog-seltext_m   = 'Material No'.
          fieldcatalog-col_pos     = 4.
          fieldcatalog-outputlen   = 20.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'NETWR'.
          fieldcatalog-seltext_m   = 'Net Value '.
          fieldcatalog-col_pos     = 5.
          fieldcatalog-outputlen   = 20.
          fieldcatalog-do_sum = 'X'.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'MEINS'.
          fieldcatalog-seltext_m   = 'Units'.
          fieldcatalog-col_pos     = 6.
          fieldcatalog-outputlen   = 4.
          append fieldcatalog .
          clear fieldcatalog.
    endform.                    " field
    *&      Form  layout
          text
    form layout  using    p_i_layout TYPE SLIS_LAYOUT_ALV .
    i_layout-zebra  = 'X'.
        i_layout-lights_fieldname = 'LIGHT'.
        i_layout-lights_tabname = 'IT_FINAL'.
        i_layout-box_fieldname = 'CHK'.
        i_layout-box_tabname  = 'IT_FINAL'.
        i_layout-edit = ' '.
    endform.
    *To display Buttons in the MENU BAR if needed
    FORM SET_PO_PF_STATUS USING  P_I_EXTAB TYPE
                     SLIS_T_EXTAB.
                     SET PF-STATUS 'MENUPO'.
      ENDFORM.
    *Event for Interactive display of ALV report
    form USER_COMMAND  using r_ucomm like sy-ucomm
                             rs_selfield type slis_selfield .
      if r_ucomm = '&IC1'.
      READ TABLE IT_FINAL  index   rs_selfield-tabindex.
      write:/ IT_FINAL-ebeln.
      endif.
    endform .
    *Parameters of FM  REUSE_ALV_GRID_DISPLAY
    *&      Form  grid_display
          text
    -->  p1        text
    <--  p2        text
    form grid_display .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM                = SY-REPID
       I_CALLBACK_PF_STATUS_SET          = 'SET_PO_PF_STATUS'
        I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
        IS_LAYOUT                         = I_LAYOUT
        IT_FIELDCAT                       = FIELDCATALOG[]
        IT_EVENTS                         = I_EVENT[]
      TABLES
        t_outtab                          = IT_FINAL.
    endform.                    " grid_display

    *& Report  YSDBALV1
    REPORT  YSDBALV1.
    tables: ekko , ekpo .
    type-pools: slis .
    Table for Display Header
    data:i_header type slis_t_listheader with header line.
    *Fieldcat Declaration
    data:fieldcatalog type slis_T_fieldcat_alv WITH HEADER LINE.
    *Table of Events
    data:i_event type slis_t_event with header line ,
         wa_event type line of slis_t_event.
    For Layout
    data:i_layout type slis_layout_alv .
    data: text(30) .
    *Internal Table Declaration
    data: begin of it_final occurs 0 ,
    ebeln like ekko-ebeln , "Purchasing Document No.
    bedat like ekko-bedat , "Purchasing Document Date
    matnr like ekpo-matnr , "Material No.
    netwr like ekpo-netwr , "Net Order Value in PO Currancy
    meins like ekpo-meins , "UOM
    chk(1) ,
    light(1) ,
    change like ekpo-menge ,
    end of it_final .
    **select option Declaration
    selection-screen begin of block block.
    select-options: s_ebeln for ekko-ebeln .
    selection-screen end of block block .
    selection-screen begin of block block1 .
    parameters:grid radiobutton group r .
    parameters:list radiobutton group r .
    selection-screen end of block block1 .
    at selection screen
    at selection-screen .
    select single * from ekko where ebeln in s_ebeln .
    if sy-subrc <> 0 .
    message e000(8I) WITH 'No Data Exists' .
    endif .
    start-of-selection .
    if grid = 'X' .
    perform get_data .
    perform event using i_event[] .
    perform field using fieldcatalog[] .
    perform layout using i_layout .
    perform grid_display .
    endif .
    *& Form get_data
    text
    --> p1 text
    <-- p2 text
    form get_data .
    *DATA Retrieval from tables
    SELECT EKKO~EBELN
    EKKO~BEDAT
    EKPO~EBELP
    EKPO~MATNR
    EKPO~NETWR
    EKPO~MEINS
    EKPO~MENGE
    EKPO~BPRME
    INTO CORRESPONDING FIELDS OF table IT_FINAL
    FROM EKKO INNER JOIN EKPO ON EKKOEBELN = EKPOEBELN
    WHERE EKKO~EBELN IN S_EBELN.
    APPEND IT_FINAL.
    endform. " get_data
    *Getting the Event for Top of Page display.
    *& Form event
    text
    -->P_I_event[] text
    form event using p_i_event type slis_t_event.
    clear p_i_event .
    refresh p_i_event .
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    I_LIST_TYPE = 0
    IMPORTING
    ET_EVENTS = p_i_event.
    EXCEPTIONS
    LIST_TYPE_WRONG = 1
    OTHERS = 2.
    read table p_i_event with key name = slis_ev_top_of_page into wa_event.
    if sy-subrc = 0.
    move 'TOP_OF_PAGE_PO' to i_event-form.
    modify p_i_event from i_event index sy-tabix transporting form.
    endif.
    clear i_event.
    endform. " event
    *Display Top-of –Page Details and Logo
    form top_of_page_po .
    clear i_header .
    refresh i_header .
    write sy-datum to text.
    i_header-typ = 'H'.
    i_header-info = 'PURCHASE OREDER DETAILS'.
    append i_header.
    *Logo Display
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = i_header[]
    I_LOGO = 'ENJOYSAP_LOGO'.
    endform .
    *Field Catalog Append
    *& Form field
    text
    -->P_fieldCATALOG[] text
    form field using p_fieldcatalog type slis_t_fieldcat_alv.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'EBELN'.
    fieldcatalog-seltext_m = 'Purchase Order No'.
    fieldcatalog-col_pos = 1.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'BEDAT'.
    fieldcatalog-seltext_m = 'PO Date'.
    fieldcatalog-col_pos = 2.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'MATNR'.
    fieldcatalog-seltext_m = 'Material No'.
    fieldcatalog-col_pos = 4.
    fieldcatalog-outputlen = 20.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'NETWR'.
    fieldcatalog-seltext_m = 'Net Value '.
    fieldcatalog-col_pos = 5.
    fieldcatalog-outputlen = 20.
    fieldcatalog-do_sum = 'X'.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'MEINS'.
    fieldcatalog-seltext_m = 'Units'.
    fieldcatalog-col_pos = 6.
    fieldcatalog-outputlen = 4.
    append fieldcatalog .
    clear fieldcatalog.
    endform. " field
    *& Form layout
    text
    form layout using p_i_layout TYPE SLIS_LAYOUT_ALV .
    i_layout-zebra = 'X'.
    i_layout-lights_fieldname = 'LIGHT'.
    i_layout-lights_tabname = 'IT_FINAL'.
    i_layout-box_fieldname = 'CHK'.
    i_layout-box_tabname = 'IT_FINAL'.
    i_layout-edit = ' '.
    endform.
    *To display Buttons in the MENU BAR if needed
    FORM SET_PO_PF_STATUS USING P_I_EXTAB TYPE
    SLIS_T_EXTAB.
    SET PF-STATUS 'MENUPO'.
    ENDFORM.
    *Event for Interactive display of ALV report
    form USER_COMMAND using r_ucomm like sy-ucomm
    rs_selfield type slis_selfield .
    if r_ucomm = '&IC1'.
    READ TABLE IT_FINAL index rs_selfield-tabindex.
    set parameter id 'VL1' field it_final-ebeln.
    call transaction 'ME23N'.
    endif.
    endform .
    *Parameters of FM REUSE_ALV_GRID_DISPLAY
    *& Form grid_display
    text
    --> p1 text
    <-- p2 text
    form grid_display .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    I_CALLBACK_PF_STATUS_SET = 'SET_PO_PF_STATUS'
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    IS_LAYOUT = I_LAYOUT
    IT_FIELDCAT = FIELDCATALOG[]
    IT_EVENTS = I_EVENT[]
    TABLES
    t_outtab = IT_FINAL.
    endform. " grid_display
    Regards,
    Rusidar S.

  • Checkbox field in ALV for REUSE_ALV_GRID_DISPLAY

    how to handle Checkbox field in ALV for REUSE_ALV_GRID_DISPLAY????
    For example Alv has displayed 400 entries if user checks 4 entries and wants to donwload only those 4 entries from ALV using Copy to local file option then how should it be done. please provide some help...

    REPORT  YHRMR_LTC_TAXABLE NO STANDARD PAGE HEADING LINE-SIZE 120.
    TYPE-POOLS: SLIS.
    Start of Data Declaration                                            *
    DATA: G_PLVAR               TYPE PLVAR.
    DATA: P_MONTH               TYPE TFMATAGE.
    DATA: TOTAL_NO              TYPE I.
    DATA: TOTAL_NO_SUM          TYPE I.
    DATA: COUNT_15              TYPE I.
    DATA: COUNT_15_SUM          TYPE I.
    DATA: COUNT_LTC             TYPE I.
    DATA: COUNT_LTC_SUM         TYPE I.
    DATA: COUNT_ERROR_IT15      TYPE I.
    DATA: COUNT_ERROR_IT15_SUM  TYPE I.
    DATA: COUNT_ERROR_LTC       TYPE I.
    DATA: COUNT_ERROR_LTC_SUM   TYPE I.
    DATA: COUNT_ENTRY_IT15      TYPE I.
    DATA: COUNT_ENTRY_IT15_SUM  TYPE I.
    --LOCAL TABLE TYPE--
    DATA: T_DATA_LTC     LIKE YHRMT_LTC OCCURS 0 WITH HEADER LINE.
    DATA: T_DATA_LTC_NEW LIKE YHRMT_LTC OCCURS 0 WITH HEADER LINE.
    DATA: T_PA0015 LIKE PA0015 OCCURS 0 WITH HEADER LINE.
    DATA: T_P0015 LIKE PA0015 OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF T_FINAL OCCURS 0,
          CHECK_BOX(1),
          MANDT        TYPE MANDT,
          PERNR        TYPE PERSNO,
          ABKRS        TYPE ABKRS,
          PERSK        TYPE PERSK,
          WAGETYPE     TYPE LGART,
          LTCSTART     TYPE YAJAHR,
          LTCEND       TYPE YYAJAHR,
          FLAG         TYPE YCHAR1,
          SEQNR        TYPE SEQNR,
          LEVSTART     TYPE URBEG,
          LEVEND       TYPE BDATU_052R,
          PAYDATE      TYPE YBEGDA,
          AMOUNTPAY    TYPE AMUNT,
          TAXYR        TYPE PHK_TAXYR,
          DOCUNO       TYPE YCHAR20,
          DOCUDATE     TYPE YENDDA,
          VOUCHNO      TYPE YCHAR20,
          APDATE       TYPE BPS_APPDA,
          CANCEL_MOD   TYPE YCANCELMOD,
          LTC_IND      TYPE ATZH1,
          APPL_TAG     TYPE YAPPTAG,
          CANCEL_DATE  TYPE AEDTM,
          CANCEL_USER  TYPE AENAM,
          LASTCHANGE   TYPE AEDTM,
          USERNAME     TYPE AENAM,
          END OF T_FINAL.
    DATA: BEGIN OF T_PA0001 OCCURS 0,
          PERNR LIKE PA0001-PERNR,
          ABKRS LIKE PA0001-ABKRS,
          END OF T_PA0001.
    --Message Part Declaration--
    DATA: BEGIN OF T_SUCCESS OCCURS 0,
          PERNR       TYPE PERSNO,
          MESSAGE(50) TYPE C,
          END OF T_SUCCESS.
    DATA: BEGIN OF T_ERROR OCCURS 0,
          PERNR       TYPE PERSNO,
          MESSAGE(50)  TYPE C,
          END OF T_ERROR.
    --TABLE TYPE OF SLIS TYPE-GROUP--
    DATA: G_FLD TYPE SLIS_T_FIELDCAT_ALV,
          G_EV TYPE SLIS_T_EVENT,
          G_SORT TYPE SLIS_T_SORTINFO_ALV,
          G_LST TYPE SLIS_T_LISTHEADER.
    DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
          GD_LAYOUT    TYPE SLIS_LAYOUT_ALV,
          I_EVENTS TYPE SLIS_T_EVENT,
          GD_REPID     LIKE SY-REPID.
    --STRUCTURE TYPE OF SLIS TYPE-GROUP--
    DATA: L_EV TYPE SLIS_ALV_EVENT.
    CONSTANTS : C_PF TYPE SLIS_FORMNAME VALUE 'PF_STATUS_SET',
                C_UCOM TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
    *---- Start Change by Bibek/Shankar Dated : 12-03-2008 via cmr no : J/08/03/062/1.
    DATA: L_ENDDATE   LIKE SY-DATUM.
    *---- End   Change by Bibek/Shankar Dated : 12-03-2008 via cmr no : J/08/03/062/1.
    End of Data Declaration                                              *
    Start of Selection screen Parameters                                 *
    SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-002.
    *START CHANGE BY SHAYARI ON 18.02.2008, CMR No.:- J/08/02/323
    PARAMETERS:P_ABKRS LIKE PA0001-ABKRS OBLIGATORY.
    *END CHANGE BY SHAYARI ON 18.02.2008,  CMR No.:- J/08/02/323
    *START CHANGE BY BIBEk Dt : 06.03.2008, CMR No.:- J/08/03/062/1
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    SELECTION-SCREEN COMMENT 1(78) TEXT-006 FOR FIELD P_LES.
    PARAMETER P_LES RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN END OF LINE.
    *END CHANGE BY BIBEk Dt : 06.03.2008, CMR No.:- J/08/03/062/1
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    SELECTION-SCREEN COMMENT 1(78) TEXT-003 FOR FIELD P_ONE.
    PARAMETER P_ONE RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    SELECTION-SCREEN COMMENT 1(78) TEXT-004 FOR FIELD P_TWO.
    PARAMETER P_TWO  RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    SELECTION-SCREEN COMMENT 1(78) TEXT-005 FOR FIELD P_MORE.
    PARAMETER P_MORE RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK A.
    End of Selection screen Parameters                                   *
    *Get Plan Version
    CALL FUNCTION 'RH_GET_PLVAR'
      IMPORTING
        PLVAR = G_PLVAR.
    PERFORM CLEAR.
    CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
      EXPORTING
        IV_DATE                   = SY-DATUM
    IMPORTING
      EV_MONTH_BEGIN_DATE       =
        EV_MONTH_END_DATE         = L_ENDDATE.
    SELECT *
      FROM YHRMT_LTC
      INTO TABLE T_DATA_LTC
    WHERE FLAG   = '1'
       AND WAGETYPE = '1640'
       AND LEVEND LE L_ENDDATE
       AND PAYDATE GE '20080101'.
    If SY-SUBRC <> 0.
    MESSAGE I398(00) with 'No Records to display '.
    ENDIF.
    DELETE T_DATA_LTC WHERE LEVEND = '00000000'.
    *START CHANGE BY BIBEk Dt : 06.03.2008, CMR No.:- J/08/03/062/1
    *For Less Than One Month from Leave End Date
    IF P_LES = 'X'.
      LOOP AT T_DATA_LTC.
        CLEAR P_MONTH.
        CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
          EXPORTING
            BEG_DA   = T_DATA_LTC-LEVEND
            END_DA   = SY-DATUM
          IMPORTING
            NO_MONTH = P_MONTH.
        IF P_MONTH LT '1'.
          T_FINAL-MANDT       =  T_DATA_LTC-MANDT.
          T_FINAL-PERNR       =  T_DATA_LTC-PERSONNELNO.
          T_FINAL-PERSK       =  T_DATA_LTC-PERSK.
          T_FINAL-WAGETYPE    =  T_DATA_LTC-WAGETYPE.
          T_FINAL-LTCSTART    =  T_DATA_LTC-LTCSTART.
          T_FINAL-LTCEND      =  T_DATA_LTC-LTCEND.
          T_FINAL-FLAG        =  T_DATA_LTC-FLAG.
          T_FINAL-SEQNR       =  T_DATA_LTC-SEQNR.
          T_FINAL-LEVSTART    =  T_DATA_LTC-LEVSTART.
          T_FINAL-LEVEND      =  T_DATA_LTC-LEVEND.
          T_FINAL-PAYDATE     =  T_DATA_LTC-PAYDATE.
          T_FINAL-AMOUNTPAY   =  T_DATA_LTC-AMOUNTPAY.
          T_FINAL-TAXYR       =  T_DATA_LTC-TAXYR.
          T_FINAL-DOCUNO      =  T_DATA_LTC-DOCUNO.
          T_FINAL-DOCUDATE    =  T_DATA_LTC-DOCUDATE.
          T_FINAL-VOUCHNO     =  T_DATA_LTC-VOUCHNO.
          T_FINAL-APDATE      =  T_DATA_LTC-APDATE.
          T_FINAL-CANCEL_MOD  =  T_DATA_LTC-CANCEL_MOD.
          T_FINAL-LTC_IND     =  T_DATA_LTC-LTC_IND.
          T_FINAL-APPL_TAG    =  T_DATA_LTC-APPL_TAG.
          T_FINAL-CANCEL_DATE =  T_DATA_LTC-CANCEL_DATE.
          T_FINAL-CANCEL_USER =  T_DATA_LTC-CANCEL_USER.
          T_FINAL-LASTCHANGE  =  T_DATA_LTC-LASTCHANGE.
          T_FINAL-USERNAME    =  T_DATA_LTC-USERNAME.
          APPEND T_FINAL.
          CLEAR  T_FINAL.
        ENDIF.
      ENDLOOP.
    *For One Month from Leave End Date
    ELSEIF P_ONE = 'X'.
      LOOP AT T_DATA_LTC.
        CLEAR P_MONTH.
        CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
          EXPORTING
            BEG_DA   = T_DATA_LTC-LEVEND
            END_DA   = SY-DATUM
          IMPORTING
            NO_MONTH = P_MONTH.
        IF P_MONTH EQ '1' AND P_MONTH LT '2'.
          T_FINAL-MANDT       =  T_DATA_LTC-MANDT.
          T_FINAL-PERNR       =  T_DATA_LTC-PERSONNELNO.
          T_FINAL-PERSK       =  T_DATA_LTC-PERSK.
          T_FINAL-WAGETYPE    =  T_DATA_LTC-WAGETYPE.
          T_FINAL-LTCSTART    =  T_DATA_LTC-LTCSTART.
          T_FINAL-LTCEND      =  T_DATA_LTC-LTCEND.
          T_FINAL-FLAG        =  T_DATA_LTC-FLAG.
          T_FINAL-SEQNR       =  T_DATA_LTC-SEQNR.
          T_FINAL-LEVSTART    =  T_DATA_LTC-LEVSTART.
          T_FINAL-LEVEND      =  T_DATA_LTC-LEVEND.
          T_FINAL-PAYDATE     =  T_DATA_LTC-PAYDATE.
          T_FINAL-AMOUNTPAY   =  T_DATA_LTC-AMOUNTPAY.
          T_FINAL-TAXYR       =  T_DATA_LTC-TAXYR.
          T_FINAL-DOCUNO      =  T_DATA_LTC-DOCUNO.
          T_FINAL-DOCUDATE    =  T_DATA_LTC-DOCUDATE.
          T_FINAL-VOUCHNO     =  T_DATA_LTC-VOUCHNO.
          T_FINAL-APDATE      =  T_DATA_LTC-APDATE.
          T_FINAL-CANCEL_MOD  =  T_DATA_LTC-CANCEL_MOD.
          T_FINAL-LTC_IND     =  T_DATA_LTC-LTC_IND.
          T_FINAL-APPL_TAG    =  T_DATA_LTC-APPL_TAG.
          T_FINAL-CANCEL_DATE =  T_DATA_LTC-CANCEL_DATE.
          T_FINAL-CANCEL_USER =  T_DATA_LTC-CANCEL_USER.
          T_FINAL-LASTCHANGE  =  T_DATA_LTC-LASTCHANGE.
          T_FINAL-USERNAME    =  T_DATA_LTC-USERNAME.
          APPEND T_FINAL.
          CLEAR  T_FINAL.
        ENDIF.
      ENDLOOP.
    *For Two Month from Leave End Date
    ELSEIF P_TWO = 'X'.
      LOOP AT T_DATA_LTC.
        CLEAR P_MONTH.
        CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
          EXPORTING
            BEG_DA   = T_DATA_LTC-LEVEND
            END_DA   = SY-DATUM
          IMPORTING
            NO_MONTH = P_MONTH.
        IF P_MONTH EQ '2' AND P_MONTH LT '3'.
          T_FINAL-MANDT       =  T_DATA_LTC-MANDT.
          T_FINAL-PERNR       =  T_DATA_LTC-PERSONNELNO.
          T_FINAL-PERSK       =  T_DATA_LTC-PERSK.
          T_FINAL-WAGETYPE    =  T_DATA_LTC-WAGETYPE.
          T_FINAL-LTCSTART    =  T_DATA_LTC-LTCSTART.
          T_FINAL-LTCEND      =  T_DATA_LTC-LTCEND.
          T_FINAL-FLAG        =  T_DATA_LTC-FLAG.
          T_FINAL-SEQNR       =  T_DATA_LTC-SEQNR.
          T_FINAL-LEVSTART    =  T_DATA_LTC-LEVSTART.
          T_FINAL-LEVEND      =  T_DATA_LTC-LEVEND.
          T_FINAL-PAYDATE     =  T_DATA_LTC-PAYDATE.
          T_FINAL-AMOUNTPAY   =  T_DATA_LTC-AMOUNTPAY.
          T_FINAL-TAXYR       =  T_DATA_LTC-TAXYR.
          T_FINAL-DOCUNO      =  T_DATA_LTC-DOCUNO.
          T_FINAL-DOCUDATE    =  T_DATA_LTC-DOCUDATE.
          T_FINAL-VOUCHNO     =  T_DATA_LTC-VOUCHNO.
          T_FINAL-APDATE      =  T_DATA_LTC-APDATE.
          T_FINAL-CANCEL_MOD  =  T_DATA_LTC-CANCEL_MOD.
          T_FINAL-LTC_IND     =  T_DATA_LTC-LTC_IND.
          T_FINAL-APPL_TAG    =  T_DATA_LTC-APPL_TAG.
          T_FINAL-CANCEL_DATE =  T_DATA_LTC-CANCEL_DATE.
          T_FINAL-CANCEL_USER =  T_DATA_LTC-CANCEL_USER.
          T_FINAL-LASTCHANGE  =  T_DATA_LTC-LASTCHANGE.
          T_FINAL-USERNAME    =  T_DATA_LTC-USERNAME.
          APPEND T_FINAL.
          CLEAR  T_FINAL.
        ENDIF.
      ENDLOOP.
    *For More than Two Month from Leave End Date
    ELSEIF P_MORE = 'X'.
      LOOP AT T_DATA_LTC.
        CLEAR P_MONTH.
        CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
          EXPORTING
            BEG_DA   = T_DATA_LTC-LEVEND
            END_DA   = SY-DATUM
          IMPORTING
            NO_MONTH = P_MONTH.
        IF P_MONTH GT '2' .
          T_FINAL-MANDT       =  T_DATA_LTC-MANDT.
          T_FINAL-PERNR       =  T_DATA_LTC-PERSONNELNO.
          T_FINAL-PERSK       =  T_DATA_LTC-PERSK.
          T_FINAL-WAGETYPE    =  T_DATA_LTC-WAGETYPE.
          T_FINAL-LTCSTART    =  T_DATA_LTC-LTCSTART.
          T_FINAL-LTCEND      =  T_DATA_LTC-LTCEND.
          T_FINAL-FLAG        =  T_DATA_LTC-FLAG.
          T_FINAL-SEQNR       =  T_DATA_LTC-SEQNR.
          T_FINAL-LEVSTART    =  T_DATA_LTC-LEVSTART.
          T_FINAL-LEVEND      =  T_DATA_LTC-LEVEND.
          T_FINAL-PAYDATE     =  T_DATA_LTC-PAYDATE.
          T_FINAL-AMOUNTPAY   =  T_DATA_LTC-AMOUNTPAY.
          T_FINAL-TAXYR       =  T_DATA_LTC-TAXYR.
          T_FINAL-DOCUNO      =  T_DATA_LTC-DOCUNO.
          T_FINAL-DOCUDATE    =  T_DATA_LTC-DOCUDATE.
          T_FINAL-VOUCHNO     =  T_DATA_LTC-VOUCHNO.
          T_FINAL-APDATE      =  T_DATA_LTC-APDATE.
          T_FINAL-CANCEL_MOD  =  T_DATA_LTC-CANCEL_MOD.
          T_FINAL-LTC_IND     =  T_DATA_LTC-LTC_IND.
          T_FINAL-APPL_TAG    =  T_DATA_LTC-APPL_TAG.
          T_FINAL-CANCEL_DATE =  T_DATA_LTC-CANCEL_DATE.
          T_FINAL-CANCEL_USER =  T_DATA_LTC-CANCEL_USER.
          T_FINAL-LASTCHANGE  =  T_DATA_LTC-LASTCHANGE.
          T_FINAL-USERNAME    =  T_DATA_LTC-USERNAME.
          APPEND T_FINAL.
          CLEAR  T_FINAL.
        ENDIF.
      ENDLOOP.
    ENDIF.
    ****Payroll Area Put
    SELECT PERNR ABKRS FROM PA0001
    INTO CORRESPONDING FIELDS OF TABLE T_PA0001
    FOR ALL ENTRIES IN T_FINAL
    WHERE PERNR = T_FINAL-PERNR
    AND ABKRS = P_ABKRS
    AND BEGDA LE SY-DATUM
    AND ENDDA GE SY-DATUM.
    LOOP AT T_FINAL.
      READ TABLE T_PA0001 WITH KEY PERNR = T_FINAL-PERNR.
      IF SY-SUBRC = 0.
        T_FINAL-ABKRS = T_PA0001-ABKRS.
        MODIFY T_FINAL.
        CLEAR  T_FINAL.
      ENDIF.
    ENDLOOP.
    CLEAR T_FINAL.
    DELETE T_FINAL WHERE ABKRS = ''.
    *Output Form ALV List
    PERFORM ALV.
    *&      Form  ALV
    FORM ALV .
      PERFORM BUILD_FIELDCATALOG.
      PERFORM BUILD_EVENT.
      PERFORM DISPLAY_DATA.
    ENDFORM.                    " ALV
    *&      Form  BUILD_FIELDCATALOG
    FORM BUILD_FIELDCATALOG .
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'PERNR'.
      FIELDCATALOG-SELTEXT_M   = 'Personnel number'.
      FIELDCATALOG-COL_POS     = 1.
      FIELDCATALOG-OUTPUTLEN   = 17.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'ABKRS'.
      FIELDCATALOG-SELTEXT_M   = 'Payroll Area'.
      FIELDCATALOG-COL_POS     = 2.
      FIELDCATALOG-OUTPUTLEN   = 17.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'LTCSTART'.
      FIELDCATALOG-SELTEXT_M   = 'LTC Start year'.
      FIELDCATALOG-COL_POS     = 3.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'LTCEND'.
      FIELDCATALOG-SELTEXT_M   = 'LTC End year'.
      FIELDCATALOG-COL_POS     = 4.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'LEVSTART'.
      FIELDCATALOG-SELTEXT_M   = 'Start of leave'.
      FIELDCATALOG-COL_POS     = 5.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'LEVEND'.
      FIELDCATALOG-SELTEXT_M   = 'End of leave'.
      FIELDCATALOG-COL_POS     = 6.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'AMOUNTPAY'.
      FIELDCATALOG-SELTEXT_M   = 'Amount'.
      FIELDCATALOG-DO_SUM      = 'X'.
      FIELDCATALOG-COL_POS     = 7.
      FIELDCATALOG-OUTPUTLEN   = 13.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'PAYDATE'.
      FIELDCATALOG-SELTEXT_M   = 'Payment Date'.
      FIELDCATALOG-COL_POS     = 8.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'APPL_TAG'.
      FIELDCATALOG-SELTEXT_M   = 'Application Tag '.
      FIELDCATALOG-COL_POS     = 9.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
    *Check Box Field Add
      CLEAR GD_LAYOUT.
      GD_LAYOUT-BOX_FIELDNAME = 'CHECK_BOX'.
      GD_LAYOUT-BOX_TABNAME = 'T_FINAL'.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_EVENT
    FORM BUILD_EVENT .
    *Event Handler
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE     = 0
        IMPORTING
          ET_EVENTS       = G_EV
        EXCEPTIONS
          LIST_TYPE_WRONG = 1
          OTHERS          = 2.
      IF SY-SUBRC <> 0.
      ELSE.
        READ TABLE G_EV INTO L_EV WITH KEY NAME = SLIS_EV_PF_STATUS_SET.
        IF SY-SUBRC = 0.
          MOVE C_PF TO L_EV-FORM.
          MODIFY G_EV FROM L_EV INDEX SY-TABIX TRANSPORTING FORM.
        ENDIF.
        READ TABLE G_EV INTO L_EV WITH KEY NAME = SLIS_EV_USER_COMMAND.
        IF SY-SUBRC = 0.
          MOVE C_UCOM TO L_EV-FORM.
          MODIFY G_EV FROM L_EV INDEX SY-TABIX TRANSPORTING FORM.
        ENDIF.
      ENDIF.
    ENDFORM.                    " BUILD_EVENT
    *&      Form  DISPLAY_DATA
    FORM DISPLAY_DATA .
      GD_REPID = SY-REPID.
      CLEAR I_EVENTS. REFRESH I_EVENTS.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM       = GD_REPID
          I_CALLBACK_PF_STATUS_SET = C_PF
          I_CALLBACK_USER_COMMAND  = C_UCOM
          IS_LAYOUT                = GD_LAYOUT
          IT_FIELDCAT              = FIELDCATALOG[]
          IT_EVENTS                = G_EV
        TABLES
          T_OUTTAB                 = T_FINAL.
    ENDFORM.                    " DISPLAY_DATA
          FORM PF_STATUS_SET                                            *
    FORM PF_STATUS_SET USING RX_TAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'LTC'.
    ENDFORM.                    "PF_STATUS_SET
          FORM USER_COMMAND                                             *
    FORM USER_COMMAND USING R_UCOM LIKE SY-UCOMM
                            RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOM.
        WHEN 'POST'.
          PERFORM POST_IT15_LTC_TABLE.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    *&      Form  POST_IT15_LTC_TABLE
    FORM POST_IT15_LTC_TABLE .
    ENDFORM.                    " POST_IT15_LTC_TABLE
    *&      Form  clear
    FORM CLEAR .
      CLEAR   T_DATA_LTC.
      REFRESH T_DATA_LTC.
      CLEAR   T_DATA_LTC_NEW.
      REFRESH T_DATA_LTC_NEW.
      CLEAR   T_FINAL.
      REFRESH T_FINAL.
      CLEAR   T_PA0015.
      REFRESH T_PA0015.
      CLEAR   T_SUCCESS.
      REFRESH T_SUCCESS.
      CLEAR   T_ERROR.
      REFRESH T_ERROR.
      CLEAR G_PLVAR.
      CLEAR P_MONTH.
      CLEAR COUNT_15.
      CLEAR COUNT_15_SUM.
      CLEAR COUNT_LTC.
      CLEAR COUNT_LTC_SUM.
      CLEAR TOTAL_NO.
      CLEAR TOTAL_NO_SUM.
      CLEAR COUNT_ERROR_IT15.
      CLEAR COUNT_ERROR_IT15_SUM.
      CLEAR COUNT_ERROR_LTC.
      CLEAR COUNT_ERROR_LTC_SUM.
      CLEAR COUNT_ENTRY_IT15.
      CLEAR COUNT_ENTRY_IT15_SUM.
    ENDFORM.                    " clear

  • Add on custom button to ALV toolbar in std tcode ME51N, ME52N and ME53N.

    Hi All,
    I have the requirement to add on the custom button to ALV toolbar in ITEM OVERVIEW for standard transaction ME51N, ME52N and ME53N. Does anyone know what enhancement point or user exit i should apply and how i can add on the custom button?
    Thanks.

    There are no user exits or badi's for COOIS. You may have to make copy of the PPIO_ENTRY to ZPPIO_ENTRY including all the varians without changing their names like copy SAP&COOIS to SAP&COOIS. Create a T-Code ZCOOIS and replace COOIS in variant SAP&COOIS to ZCOOIS not in the name of the variant but in the field "Check Authorization for".
    The PF-Status is found in the include LCOISOUTPUTF16 which is located in the function group COISOUTPUT you may have to copy that too. Finally you need to copy SAPLCOISOUTPUT with its GUI status GENERAL and add your custom button there.

  • ALV Toolbar related Query

    Hi,
    When using FM 'REUSE_ALV_GRID_DISPLAY'
    Exporting Parameters : I_CALLBACK_PF_STATUS_SET 
    in SET PF Status Creating additional Buttons.
    In ALV Report output addition  additional buttons are coming
    but Standard ALV Toolbar are missing like Sort Assending ,Descending,Total,Subtotal,
    Layouts.
    Please give any Suggestions for Standard toolbar as well as additional buttons to display
    by using FM 'REUSE_ALV_GRID_DISPLAY'.
    Thanks,
    Manish

    Hi,
    Check this subroutine in example program :
    BCALV_TEST_FULLSCREEN_CALLS
    form f01_event_pf_status_set using rt_extab type slis_t_extab.
      set pf-status 'STANDARD_FULLSCREEN' excluding rt_extab.
    endform.                   " f01_event_pf_status_set
    regards,
    Advait

  • Menu Button in ALV toolbar (multiple choices for a button)

    Hi abapers,
    I would like to have a button with multiple choices in the toolbar;
    at the moment I have created a menu button with just one function.
    Here is my code:
    CLASS lcl_event_receiver (Definition)
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
                IMPORTING e_object e_interactive.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    CLASS lcl_event_receiver (Implementation)
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_toolbar.
        DATA: ls_toolbar  TYPE stb_button.
    *Separator
        CLEAR ls_toolbar.
        MOVE 3 TO ls_toolbar-butn_type.
        APPEND ls_toolbar TO e_object->mt_toolbar.
    *Button
        CLEAR ls_toolbar.
        MOVE 1 TO ls_toolbar-butn_type.
        MOVE 'EDIT' TO ls_toolbar-function.
        MOVE icon_change TO ls_toolbar-icon.
        MOVE ' Modifica'(l02) TO ls_toolbar-text.
        MOVE ' ' TO ls_toolbar-disabled.
        MOVE 'Modifica' TO ls_toolbar-quickinfo.
        APPEND ls_toolbar TO e_object->mt_toolbar.
      ENDMETHOD.                    "handle_toolbar
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION

    hi,
    check this code and reward me if it helps you..
    TYPE-POOLS : slis,icon.
    *Structure declaration for tcodes
    TYPES : BEGIN OF ty_table,
            tcode TYPE tcode,
            pgmna TYPE progname,
            END OF ty_table.
    *Structure for tocde text
    TYPES : BEGIN OF ty_itext,
            tcode TYPE tcode,
            ttext TYPE ttext_stct,
            sprsl TYPE sprsl,
            END OF ty_itext.
    *Structure for output display
    TYPES : BEGIN OF ty_output,
            tcode TYPE tcode,
            pgmna TYPE progname,
            ttext TYPE ttext_stct,
           END OF ty_output.
    *internal table and work area declarations
    DATA : it_table TYPE STANDARD TABLE OF ty_table INITIAL SIZE 0,
           it_output TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
           it_ittext TYPE STANDARD TABLE OF ty_itext INITIAL SIZE 0,
           wa_table TYPE ty_table,
           wa_output TYPE ty_output,
           wa_ittext TYPE ty_itext.
    *Class definition for ALV toolbar
    CLASS:      lcl_alv_toolbar   DEFINITION DEFERRED.
    *Declaration for toolbar buttons
    DATA : ty_toolbar TYPE stb_button.
    Data declarations for ALV
    DATA: c_ccont TYPE REF TO cl_gui_custom_container,   "Custom container object
          c_alvgd         TYPE REF TO cl_gui_alv_grid,   "ALV grid object
          it_fcat            TYPE lvc_t_fcat,            "Field catalogue
          it_layout          TYPE lvc_s_layo,            "Layout
          c_alv_toolbar    TYPE REF TO lcl_alv_toolbar,           "Alv toolbar
          c_alv_toolbarmanager TYPE REF TO cl_alv_grid_toolbar_manager.  "Toolbar manager
    *Initialization event
    INITIALIZATION.
    *Start of selection event
    START-OF-SELECTION.
    *Subroutine to get values from tstc table
      PERFORM fetch_data.
    *subroutine for alv display
      PERFORM alv_output.
          CLASS lcl_alv_toolbar DEFINITION
          ALV event handler
    CLASS lcl_alv_toolbar DEFINITION.
      PUBLIC SECTION.
    *Constructor
        METHODS: constructor
                   IMPORTING
                     io_alv_grid TYPE REF TO cl_gui_alv_grid,
    *Event for toolbar
        on_toolbar
           FOR EVENT toolbar
           OF  cl_gui_alv_grid
           IMPORTING
             e_object.
    ENDCLASS.                    "lcl_alv_toolbar DEFINITION
          CLASS lcl_alv_toolbar IMPLEMENTATION
          ALV event handler
    CLASS lcl_alv_toolbar IMPLEMENTATION.
      METHOD constructor.
      Create ALV toolbar manager instance
        CREATE OBJECT c_alv_toolbarmanager
          EXPORTING
            io_alv_grid      = io_alv_grid.
       ENDMETHOD.                    "constructor
      METHOD on_toolbar.
      Add customized toolbar buttons.
      variable for Toolbar Button
          ty_toolbar-icon      =  icon_generate.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button1'.
          APPEND ty_toolbar TO e_object->mt_toolbar.
          ty_toolbar-icon      =  icon_voice_output.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button2'.
           APPEND ty_toolbar TO e_object->mt_toolbar.
         ty_toolbar-icon      =  icon_phone.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button3'.
           APPEND ty_toolbar TO e_object->mt_toolbar.
         ty_toolbar-icon      =  icon_mail.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button4'.
           APPEND ty_toolbar TO e_object->mt_toolbar.
       ty_toolbar-icon      =  icon_voice_input.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button5'.
         APPEND ty_toolbar TO e_object->mt_toolbar.
      Call reorganize method of toolbar manager to
      display the toolbar
         CALL METHOD c_alv_toolbarmanager->reorganize
          EXPORTING
            io_alv_toolbar = e_object.
       ENDMETHOD.                    "on_toolbar
    ENDCLASS.                    "lcl_alv_toolbar IMPLEMENTATION
    *&      Form  fetch_data
          text
    -->  p1        text
    <--  p2        text
    FORM fetch_data .
    Select the tcodes upto 200 rows from TSTC
       SELECT   tcode
               pgmna
               FROM tstc
               INTO CORRESPONDING FIELDS OF TABLE it_table
               UP TO 200 ROWS
               WHERE dypno NE '0000'.
    *Select the tcode textx
       IF it_table[] IS NOT INITIAL.
         SELECT ttext
               tcode
               sprsl
               FROM tstct
               INTO CORRESPONDING FIELDS OF TABLE it_ittext
               FOR ALL ENTRIES IN it_table
               WHERE tcode = it_table-tcode
               AND sprsl = 'E'.
       ENDIF.
    Apppending the data to the internal table of ALV output
       LOOP AT it_table INTO wa_table.
        wa_output-tcode = wa_table-tcode.
        wa_output-pgmna = wa_table-pgmna.
       For texts
        READ TABLE it_ittext INTO wa_ittext WITH KEY tcode = wa_table-tcode.
        wa_output-ttext = wa_ittext-ttext.
         APPEND wa_output TO it_output.
        CLEAR wa_output.
       ENDLOOP.
       ENDFORM.                    " fetch_data
    *&      Form  alv_output
          text
    -->  p1        text
    <--  p2        text
    FORM alv_output .
    *Calling the ALV
      CALL SCREEN 0600.
      ENDFORM.                    " alv_output
    Calling the ALV screen with custom container
    On this statement double click  it takes you to the screen painter SE51.Enter the attributes
    *Create a Custom container and name it CC_CONT and OK code as OK_CODE.
    *Save check and Activate the screen painter.
    Now a normal screen with number 600 is created which holds the ALV grid. PBO of the actual screen , Here we can give a title and *customized menus
    *&      Module  STATUS_0600  OUTPUT
          text
    MODULE status_0600 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0600  OUTPUT
    calling the PBO module ALV_GRID.
    *&      Module  ALV_GRID  OUTPUT
          text
    MODULE alv_grid OUTPUT.
    *create object for custom container
      CREATE OBJECT c_ccont
           EXPORTING
              container_name = 'CC_CONT'.
    *create object of alv grid
      CREATE OBJECT c_alvgd
          EXPORTING
              i_parent = c_ccont.
    create ALV event handler
      CREATE OBJECT c_alv_toolbar
        EXPORTING
          io_alv_grid = c_alvgd.
    Register event handler
      SET HANDLER c_alv_toolbar->on_toolbar FOR c_alvgd.
    Fieldcatalogue for ALV
       PERFORM alv_build_fieldcat.
    ALV attributes FOR LAYOUT
      PERFORM alv_report_layout.
       CHECK NOT c_alvgd IS INITIAL.
    Call ALV GRID
       CALL METHOD c_alvgd->set_table_for_first_display
        EXPORTING
          is_layout                     = it_layout
        CHANGING
          it_outtab                     = it_output
          it_fieldcatalog               = it_fcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 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.
    ENDMODULE.                 " ALV_GRID  OUTPUT
    *&      Form  alv_build_fieldcat
          text
         <--P_IT_FCAT  text
    FORM alv_build_fieldcat.
       DATA lv_fldcat TYPE lvc_s_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '1'.
      lv_fldcat-fieldname = 'TCODE'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 8.
      lv_fldcat-scrtext_m = 'TCODE'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
       lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '2'.
      lv_fldcat-fieldname = 'PGMNA'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'PROGNAME'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '3'.
      lv_fldcat-fieldname = 'TTEXT'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 60.
      lv_fldcat-scrtext_m = 'Description'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
    ENDFORM.                    " alv_build_fieldcat
    *&      Form  alv_report_layout
          text
         <--P_IT_LAYOUT  text
    FORM alv_report_layout.
       it_layout-cwidth_opt = 'X'.
       it_layout-zebra = 'X'.
    ENDFORM.                    " alv_report_layout
    PAI module of the screen created. In case we use an interactive ALV or
    *for additional functionalities we can create OK codes
    *and based on the user command we can do the coding.
    *&      Module  USER_COMMAND_0600  INPUT
          text
    MODULE user_command_0600 INPUT.
    ENDMODULE.                 " USER_COMMAND_0600  INPUT
    thanks,
    gupta

  • Add a button choice on alv toolbar in wd4a

    Hy everyone i've to add a button choice on alv toolbar. I create a node 'MY_TOOLBAR_FUNCTIONS' where add node and attributes to bind in external mapping in function_elements of alv interface controller.For button_choice I made a node 'CHOICE' and attribute 'WA_VALUE' type string. But the application dumps when create object lr_choice ; the error is WebDynpro Exception: IDs Can Only Contain Characters of Syntactical Character Set .
    May you help me? Thanks in advance.
    data:  ls_choice TYPE ig_componentcontroller=>element_choice,
              nd_choice TYPE REF TO if_wd_context_node,
    nd_choice = nd_my_functions->get_child_node( name = wd_this->wdctx_choice ).
      el_choice = nd_choice->get_element(  ).
    ls_choice-wa_value = '01'.
      APPEND ls_choice TO lt_choice.
      nd_choice->bind_table( lt_choice ).
      DATA:lr_button_choice TYPE REF TO cl_salv_wd_fe_button_choice.
      DATA:lr_choice TYPE REF TO cl_salv_wd_menu_action_item.
      lr_function = l_value->if_salv_wd_function_settings~create_function_right( id = 'MYBUTTONCHOICE' ).
      CREATE OBJECT lr_button_choice.
              EXPORTING
                sel_action_item_elementname = 'CHOICE.WA_VALUE'.
      lr_button_choice->set_text( value = 'Filter' ).
      lr_button_choice->set_tooltip( value = 'Filter').
      lr_button_choice->set_sel_action_itm_elementname( 'CHOICE.WA_VALUE' ).
      CREATE OBJECT lr_choice
        EXPORTING
          id = ls_CHOICE-WA_VALUE.
      lr_choice->set_text( 'Esito Positivo' ).
      lr_choice->set_image_source( value = 'ICON_GREEN_LIGHT').
      lr_button_choice->add_choice( lr_choice ).
      lr_function->set_editor( lr_button_choice ).

    in   CREATE OBJECT lr_choice the object id have to refer to name of node.
      CREATE OBJECT lr_choice
         EXPORTING
           id = 'CHOICE'.

  • I have a problem with ALV Grid User Command?

    Hi Experts,
    I have a problem with ALV GRID User Command.
    I am calling TCODE IW33 (Order Display) from the ALV output at first time by selecting an order. But, User command is calling IW33 Initial screen with blank value of order. Even I checked in debugging the value what I selected is passing properly, but once that screen (IW33 Initial) displays, value doesn't appear. Then, Manually, I  created another session and gone to TCODE IW33 and displayed an order. After that I came out from that order. Then again run my ALV program and selected another order, now order is displaying, but not what I selected current order instead of displaying previous order what I just displayed manually. If I selected any other order, system will display the same order what I dislayed manually.
    Here is my code.
    FORM user_command_alv  USING u_ucomm TYPE sy-ucomm
                           us_self_field TYPE slis_selfield.
    CASE u_ucomm.
    WHEN '&IC1'.
    READ TABLE it_final INDEX us_self_field-tabindex INTO wa_final.
            WHEN 'ORDER'.
              IF NOT wa_final-order IS INITIAL.
                SET PARAMETER ID 'COK' FIELD wa_final-order.
                CALL TRANSACTION 'IW33' AND SKIP FIRST SCREEN.
              ENDIF.
    endform.
    PARAMETER ID 'COK'  also the standard one.
    Could you please help me out, Where I did wrong?
    If I select any order, that order only should display.
    Thanks in advance.
    Regards,
    Sarayu.
    Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:33 PM

    hi,
    Please check it once the Paramater ID is 'ANR' for IW33 order number.
    Hope this may help.
    Regards,
    Sravanthi

  • Problem with ALV grid in edit mode

    Hello, gurus!
    I have a problem with ALV-grid. Sometimes when I call F4 help for a cell, data is inserted in a different cell.  And when I call check_changed_data method, my internal table (passed to ALV-control in set_table_for_first_display) does not updates properly. In what can be a problem?
    Thanks,
    Mikhail

    Hi Prabhu,
    MODULE pbo_100 OUTPUT.
      SET PF-STATUS 'MAIN100'.
      title_of_report = text-010.
      SET TITLEBAR '0100' WITH title_of_report.
      DATA: g_event_receiver TYPE REF TO lcl_event_handler.
      IF z_custom_container IS INITIAL .
        CREATE OBJECT z_custom_container
          EXPORTING
            container_name = 'ALV_ZAC'.
        CREATE OBJECT alv_grid
          EXPORTING
            i_parent = z_custom_container.
        g_repid = sy-repid.
        gs_variant-report = g_repid.
        x_save = 'A'.
        PERFORM check_alv_grid_fields.
        ps_layout-cwidth_opt = 'X'.
        ps_layout-edit = 'X'.
        CALL METHOD alv_grid->set_ready_for_input
          EXPORTING
            i_ready_for_input = '1'.
    *    CALL METHOD alv_grid->register_edit_event
    *      EXPORTING
    *        i_event_id = cl_gui_alv_grid=>mc_evt_enter.
        APPEND   s_list_rec   to it_list_rec.
        CALL METHOD alv_grid->set_table_for_first_display
          EXPORTING
            is_layout       = ps_layout
            is_variant      = gs_variant
            i_save          = x_save
          CHANGING
            it_fieldcatalog = pt_fieldcat
            it_outtab       = it_list_rec[].
        CALL METHOD alv_grid->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_enter.
        CALL METHOD alv_grid->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_modified.
    ENDIF.
    FORM check_alv_grid_fields .
      DATA: ls_fcat LIKE LINE OF pt_fieldcat.
    REFRESH pt_fieldcat .
    CLEAR: ps_layout, ls_fcat.
      ls_fcat-fieldname = 'VBELN'.
      ls_fcat-ref_field = 'VBELN'. ls_fcat-ref_table =  'LIPS'. " .
      ls_fcat-outputlen = 9.
    *  ls_fcat-datatype   = 'CHAR'.
    *  ls_fcat-inttype    = 'C'.
      APPEND  ls_fcat TO pt_fieldcat.
      CLEAR: ls_fcat.
      ls_fcat-fieldname = 'ERDAT'.
      ls_fcat-ref_field = 'ERDAT'. ls_fcat-ref_table = 'LIPS'.
      ls_fcat-outputlen = 9.
    *  ls_fcat-f4availabl = 'X' .
    *  ls_fcat-datatype   = 'DATS'.
    *  ls_fcat-inttype    = 'D'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR: ls_fcat.
    ENDFORM.                    " check_alv_grid_fields
    FORM save_p .
      CLEAR l_valid.
      CALL METHOD alv_grid->check_changed_data
        IMPORTING
          e_valid = l_valid.
      IF l_valid IS INITIAL.
        CALL FUNCTION 'POPUP_TO_INFORM'
          EXPORTING
            titel = text-i01
            txt1  = text-i02
            txt2  = text-i03
            txt3  = text-i04.
      ELSE.
        i_dat_reg = zrumm_prr-cdprr.
        CLEAR is_temp_otc.
        freshit i_prrpus_fax.
        freshit i_list2_ot.
        LOOP AT it_list_rec INTO s_list_rec.
          MOVE-CORRESPONDING s_list_rec TO i_list2_ot.
          i_list2_ot-fgrup = 'RECE'.
          i_list2_ot-prrnu = i_num_prr.
          APPEND i_list2_ot.
          MOVE-CORRESPONDING s_list_rec TO i_prrpus_fax.
          APPEND i_prrpus_fax.
        ENDLOOP.
      ENDIF.
    Edited by: Mikhail Sarychev on Mar 16, 2011 6:41 AM
    Edited by: Mikhail Sarychev on Mar 16, 2011 6:49 AM
    Edited by: Mikhail Sarychev on Mar 16, 2011 6:49 AM

  • Background task problem with alv grid display

    Hello !
    I have a problem when executing my program in background.
    In foreground I have no problem, my ALV appears. In the background I have a dump.
    The current ABAP program "SAPLKKBL" had to be terminated because one of the statements could not be executed.
    I use the function module 'REUSE_ALV_GRID_DISPLAY'
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
            i_callback_program      = gd_repid
            i_callback_user_command = 'F533_USER_COMMAND'
            is_layout               = gd_layout
            it_fieldcat             = fieldcatalog[]
            it_special_groups       = i_fgroup[]
            i_save                  = 'X'
            it_sort                 = gd_sort
            i_buffer_active         = ' '
            i_callback_pf_status_set = 'F534_SET_PF_STATUS'
         TABLES
            t_outtab                = mytab
         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.
    I don't understand where the problem is. Please help me.
    Thank you.

    I love replying to old threads:
    Try this link
    http://scn.sap.com/people/prashant.patil12/blog/2007/02/20/displaying-alv-grid-in-background-job

  • How to add a dropdown box in an ALV  toolbar??

    hi,
       i have a requirement where i need to add a dropdown box in my ALV Toolbar. To be precise next to the export button in my ALV.
    Plz help me on this, thanks.

    Hi Frank,
    I am providing the some peice of code which will be helpful to you.
    Adding the DropDown list to the ALV toolbar:
    lr_functions ?= wd_this->r_table.
    lr_function = lr_functions->create_function( 'MYDROPDOWNBYINDEX' ).
    create object lr_dropdown_by_idx
    exporting
    texts_elementname = 'DROPDOWNBYINDEX.VALUE'.
    lr_dropdown_by_idx->set_label_text( 'MYDROPDOWNBYINDEX' ).
    lr_function->set_editor( lr_dropdown_by_idx ).
    Providing the values to that DropDown:
    Here in my example DROPDOWNBYINDEX.VALUE is the context attrubute. And i write the Supply function for that node as follows:
    data:
    lt_dropdownbyindex type if_componentcontroller=>elements_dropdownbyindex,
    ls_dropdownbyindex type if_componentcontroller=>element_dropdownbyindex.
    ls_dropdownbyindex-value = 'Nothing'. "#EC NOTEXT
    append ls_dropdownbyindex to lt_dropdownbyindex.
    ls_dropdownbyindex-value = 'ActionDropdownByIndex'. "#EC NOTEXT
    append ls_dropdownbyindex to lt_dropdownbyindex.
    node->bind_table( lt_dropdownbyindex ).
    For reference you can refer the WD component SALV_WD_TEST_TABLE_TOOLBR which holds the same code
    Hope this will help you. Reward points if it helps.
    Cheers,
    Darshna.

  • How to create multiple buttons in ALV Toolbar in Webdynpro ABAP

    Hi all,
    I am trying to create multiple buttons in Webdynpro  ALV toolbar, please go through the code.
    What happening is, second button is replacing the first one.
    DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
       lo_cmp_usage =   wd_this->wd_cpuse_alv_table( ).
       IF lo_cmp_usage->has_active_component( ) IS INITIAL.
         lo_cmp_usage->create_component( ).
       ENDIF.
       DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
       lo_interfacecontroller =   wd_this->wd_cpifc_alv_table( ).
        DATA lv_value TYPE REF TO cl_salv_wd_config_table.
       lv_value = lo_interfacecontroller->get_model(
       DATA lr_buttonui1 TYPE REF TO cl_salv_wd_fe_button.
       DATA lr_buttonui2 TYPE REF TO cl_salv_wd_fe_button.
       DATA button1 TYPE REF TO cl_salv_wd_function.
       DATA button2 TYPE REF TO cl_salv_wd_function.
    **First button
       CREATE OBJECT lr_buttonui1.
       lr_buttonui1->set_text('Button')."setting the text of the button on alv toolbar
       button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON')."creating the function for alv button
       button1->set_editor( lr_buttonui1 ).
    **Second button
       CREATE OBJECT lr_buttonui2.
         lr_buttonui2->set_text('Button1')."setting the text of the button on alv toolbar
       button2 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON' )."creating the function for alv button
       button2->set_editor( lr_buttonui2 ).
    How can I overcome this??
    Thanks
    Eshwar

    Hi Eshwar,
    The button Ids are same for both the buttons in your code. You need to change it as BUTTON1, BUTTON2.
    **First button
       CREATE OBJECT lr_buttonui1.
       lr_buttonui1->set_text('Button')."setting the text of the button on alv toolbar
       button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON1')."creating the function for alv button
       button1->set_editor( lr_buttonui1 ).
    **Second button
       CREATE OBJECT lr_buttonui2.
         lr_buttonui2->set_text('Button1')."setting the text of the button on alv toolbar
       button2 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON2' )."creating the function for alv button
       button2->set_editor( lr_buttonui2 ).

Maybe you are looking for

  • Function used in view definition is called multiple times

    I am trying to write a view that boils down to the following statement: SELECT val, val FROM ( SELECT SYS_GUID() val FROM dual Against my expectation, this calls SYS_GUID() twice, resulting in two different values for val. I've written it here as inl

  • Istheir any way by which i can MODIFY the Primary Set of Books option inSOB

    Hi, Is thier any way , to change the primary/reporting set of books option , which is enabled in MULTIPLE REPORTING CURRENCY TAB in "Set of Books" winow in Financial applications. Once defined , I was not able to change the option. Rgds

  • Motion graphics

    Hi there, I have a 1160 ( height in pixels ) and a 640 ( width in pixels ) texture of an asphalt road that I made. I need to have this appear as if the road is moving. Is there a way in photoshop with motion graphics to accomplish this? Is there a wa

  • OS4  update and connect to itunes

    I have the latest version of itunes on my computer. I tried to update the software on my 3rd gen ipod touch to the OS4. Computer restarted automatically (presumably after install, but I wasn't watching it the whole time). Now my computer and itunes w

  • Q10 bbm and skype, tango

    Hi, I just acquired a Q10 . it doesnt allow me to use the bbm. it says the associated email address i give is incorrect or temporary error of server??  also i am unable to download skype or tango to it? can aomeone pls help? thank you!