How to include tool bar in alv table?

Dear All,
    I want to know how to use tool bar in alv table? Is there any seperate interfaces available for it?
Thanks,
Gopi.

Hi,
1.To deactivate the Standard buttons:
Data: lr_config_table TYPE REF TO cl_salv_wd_config_table,
lo_value = lo_interfacecontroller->get_model( ).
lr_config_table ?= lo_value .
Wd_this->lr_config_table  ?= lo_value .
  lr_config_table->if_salv_wd_std_functions~set_edit_append_row_allowed( abap_false ).
  lr_config_table->if_salv_wd_std_functions~set_edit_insert_row_allowed( abap_false ).
  lr_config_table->if_salv_wd_std_functions~set_edit_delete_row_allowed( abap_false ).
2.To create the customized buttons:
Create the a method initilaze_buttons.
Data:lv_function_add_record_sap          TYPE REF TO cl_salv_wd_function,
      lv_button_add_record_sap             TYPE REF TO cl_salv_wd_fe_button,
       R_ALV_TABLE_COMP  type ref to CL_SALV_WD_CONFIG_TABLE.
r_alv_table_comp = wd_this->lr_config_table.
Generate Function Objects
lv_function_add_record_sap = wd_this->lr_config_table->if_salv_wd_function_settings~create_function( 'ADD_RECORD_SAP' ).
Generate Buttons
  CREATE OBJECT lv_button_add_record_sap.
  lv_button_add_record_sap->set_image_source( 'ICON_INSERT_ROW' ).
lv_button_add_record_sap->set_text( 'Add Record' ).
Assign Buttons to Functions
lv_function_add_record_sap->set_editor( lv_button_add_record_sap ).
Set positions of the buttons
  lv_function_add_record_sap->set_position( value = 1 ).
Set Alignment of the buttons
lv_function_add_record_sap->set_alignment( value = if_salv_wd_c_function_settings=>align_left ).
Call this method initilaze_buttons in WDDOINIT .
3.To find out which button is clicked an dhandling that function
A)Go to methods tab.
B)give the name of the method as on_button select the method type as Eventhandler.
In the event coulmn select the event ON_FUNCTION of the ALV comp.
METHOD on_button .
  DATA index  TYPE i.
  index = wd_this->sort_index .
  CASE r_param->id."r_param->id is importing paramter which comes automatically once u use the event handler
    WHEN 'DELETE_ROW'.  "Delete row
      wd_this->delete_row( )."methods you need to create and call them here.(your own customized button functionality
    WHEN 'ADD_RECORD_SAP'.
      wd_this->add_record_sap( ).
ENDCASE.
r_param->id holds the value which button is clicked.
Priya

Similar Messages

  • How to add a standard tool bar in alv

    H i
    i am developing a custom report  in Alv interactive report for to dispaly MRP information.
    Can you sejjest me how to add  a standard tool bar in alv.
      i displayed one final alv grid display there i have to add standard tool bar and application tool bar.
    Thanks,
    Rams
    Edited by: Ramsoft on Oct 27, 2010 12:09 PM

    Hi,
    Give the PF ststus name in  the PF status parameter of ALV FM
    I_CALLBACK_PF_STATUS_SET          = ' PF_STATUS'. " this parameter of ALV FM
    FORM pf_status USING pt_extab TYPE slis_t_extab.
      SET PF-STATUS 'MAIN' .
    ENDFORM.                    "pf_status
    Then create a main PF status by double clicking on it , after this goto EXTRA in menu
    EXTRA>ADJUST TEMPLATE> then give program - SAPLSLVC and status - STANDARD this will give u standard toolbar of ALV ,
    THen add what ever button you require in application toolbar
    Regards,
    Madhukar Shetty

  • How to edit tool bar?

    How to edit tool bar? thanks!

    Make sure that you do not run Firefox in full screen mode (press F11 or Fn + F11 to toggle; Mac: command+Shift+F).
    If you are in full screen mode then hover the mouse to the top to make the Navigation Toolbar and Tab bar appear.
    You can click the Maximize button at the top right to leave full screen mode or right click empty space on a toolbar and use "Exit Full Screen Mode" or press F11.

  • Display of only Tool bar in ALV without displaying the table

    Hi Experts,
    I defined a custom container and split it into 2 containers and used one for Top of page and the other for displaying the ALV.
    Now I want to export the entire report to excel sheet. So is there any method for having the Tool bar set for the custom container without displaying the ALV??
    I want to get the tool bar for custom container as we will have an option to download to excel sheet.

    Hi,
    You could try creating an instance of the class 'CL_GUI_TOOLBAR' on the custom container.
    And then call the method 'add_button' to add the export to Excel functionality.
    Here is a sample code..
    call method toolbar->add_button
              exporting fcode       = func code
                            icon        = icon name
                           is_disabled = '  ' or 'X'
                           butn_type   = '0'
                           quickinfo   = quickinfo information.
    Try it .............
    Thanks,
    Ketan

  • Problem with refresh button in tool bar in ALV

    hello experts,
                              I am displaying a report using OOPS ALV. Here i am deleting one row. After deleting the row, if i clicked on REFRESH button in the tool bar, it should display the table newly with all updations which i made. wat is the code to perform dis.
                                                      thanks in adance,

    in normal ALV we can refresh using     sel-refresh = 'X'.
    in OOPS ALV
    IF wa_toolbar-function = '&REFRESH'.
            wa_toolbar-function = 'REFRESH'.
            wa_toolbar-disabled = gc_x.
            MODIFY e_object->mt_toolbar FROM wa_toolbar
                              TRANSPORTING function disabled.

  • How to get one column of ALV table as dropdown by key.

    Hi experts,
                  How can I get one column of ALV table as dropdown and editable. If  user wants to change that column value he can just select from that dropdown and click on update button. Can I provide tool tip to that column as " Select from drop down to change the status "?
      Please Help.
    Thanks,
      Pratibha

    You just need to change the cell editor of that column in ALV.
    So first get access to the alv model object (adjusting the code below for your ALV Component Usage name - mine was ALV_ADV):
    DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
      l_ref_cmp_usage =   wd_this->wd_cpuse_alv_adv( ).
      IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
        l_ref_cmp_usage->create_component( ).
      ENDIF.
      DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
      l_salv_wd_table = wd_this->wd_cpifc_alv_adv( ).
      DATA l_table TYPE REF TO cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).
    Then access the column object you want to change:
    DATA l_column TYPE REF TO cl_salv_wd_column.
      l_column = l_table->if_salv_wd_column_settings~get_column( 'REGION' ).
    Then create the cell editor for DDLB and set it as the new cell editor for this column:
    DATA ddlb TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
      create object ddlb
        exporting
          selected_key_fieldname = 'REGION'.
      ddlb->set_tooltip( `Select from drop down to change the status` ).
      l_column->set_cell_editor( ddlb ).

  • ID CS5: How to include additional text into a table of contents and how to hide text from it?

    I have the following problem:
    1. I'd like to include additional Information in my table of contents which I don't want to appear in the text I refer to.
    Example: I do have a picture with a caption saying:
    picture 1: Blablabla.
    And I want to have the source of the picture as additional information in the table of contents:
    picture 1........Blablabla (source: thisandthat)........23
    Still I don't want this additional content to disappear, as soon as I update the table of contents!
    How can I achieve that?
    2. And how can I have this the other way round?
    Let's say I want the source in the caption, but not in the table of contents.
    So the caption says:
    picture1: Blablabla (source: thisandthat)
    but the table of content says:
    picture 1........Blablabla.....................23
    I was trying to achieve this by two different praograph styles in the caption. One which would be listed, and one which wouldn't be listed, but this of course resulted in always having two paragraphs in the caption, which I'd like to avoid:
    picture1: Blablabla
    (source: thisandthat)
    Any solution to this?
    Best Regards,
    Rainer Schwachsinn

    Sorry, missed the second part of the question. I think the only way to do that is to use invisible "dummy" text of some sort, and if you're going to do it for some entries, you might as will do it for all.
    One of the easiest ways is to put the text you want inthe TOC into an anchored frame attached to the actual heading in the text (so it moves along with it). Use a unique paragraph style for this text, and include this style, not the one applied to the headings inthe text, to make the TOC. I usually use a character color of red to make it satnd oout so I don't forget it's there, and the position on the page isn't really critical. Select the anchored frame, open the Attributes panel and make it non-printing. You'll see it in editing mode, the TOC will pick it up (as will variables, if required) but it will disappear on output.

  • How To Edit Selected Row In ALV Table

    Hello Experts,
    In My Webdynpro Application, I am displaying records from database table into an ALV Table.
    I want to edit only selected record from  ALV table.
    Please Suggest How to achieve this.
    Thanks,
    Pratibha

    The link given above is for the UI element 'Table' and does not pertain to ALV.
    To Make an ALV Editable on lead selection for that particular lead selected row.
    1. The ALV should be made lead selectable, when initializing
    2. The ON_LEAD_SELECT function should be invoked.
    3. Withing this function the index has to be retrieved to know which row was selected.
    4. Based on the index retrived all the columns have to pass FALSE to read_only in the column properties.
    Regards,
    Pramod

  • How to process Line Selection on ALV Table in ABAP WebDynpro

    Hi there,
    I have a view with an ALV table whose context node retrieves its data from a Service Call for a method.
    The method provides certain data of a database table which the ALV displays.
    Now I would like to be able to select one row of that ALV table and after pressing a button or doubleclicking on the row or whatever a different view (as for me it is also ok on the same view) should appear to display the details of that selection.
    I only need to know how to retrieve the selected data.
    Or its index within the internal table.
    I am already looking for hours for a useful thread and actually there is one which obviously is about a similar issue apart from the multiple selection part: 
    How to process multiple row selection in ALV table in Wendynpro ABAP? Help!
    but i am afraid that i don't understand it. Or at least I misunderstand it since it does not work with me.
    The system example mentioned in the thread does not help me either because it somehow does not correspond to my needs, does it?
    It would be GREAT if somebody could help me with that. Please keep it simple for I am not an expert in webdynpro yet (obviously ^^) and also please explain in detail what I have to do with the context nodes since I am not sure whether the selection is stored in my already existing node or whether I need a special one for that.
    Thanks!!
    christina

    Hi Christina,
    If you just want to get one column data of the line that user clicked, use the Web Dynpro Code Wizard to Read Context of attibute you needed, then you will get code as follow:
    * Define data for read attribute
        node_alv TYPE REF TO if_wd_context_node,
        elem_alv TYPE REF TO if_wd_context_element,
        stru_alv TYPE if_view_display=>element_alv ,
        item_column_name  LIKE stru_alv-column_name.
    * navigate from <CONTEXT> to <ALV> via lead selection
      node_alv = wd_context->get_child_node( name = if_view_display=>wdctx_alv ).
    * get element via lead selection
      elem_alv = node_alv->get_element(  ).
    * get single attribute
      elem_alv->get_attribute(
        EXPORTING
          name =  `COLUMN_NAME'
        IMPORTING
          value = item_column_name ).
    The value of column_name is stored in item_column_name.
    If you need the index that the user clicked, try this:
    * Definition of field symbol for index
      FIELD-SYMBOLS : <fs_index> TYPE data.
    * Get the selected index
      ASSIGN r_param->index->* TO <fs_index>.
    The index of clicked line is stored in field symbol <fs_index>.
    Hope it will help.
    Best Regards,
    Stephanie

  • How to remove a column from alv table

    Hi All
    How to remove a specific column from alv table.?
    Thanks & Regards
    SUN

    For delete u can follow the above post..
    Fo making invisible :
    data m_col type ref to cl_salv_wd_column.
    m_col = alv_mode->IF_SALV_WD_COLUMN_SETTINGS->GET_COLUMN (' col1' ).
    m_col->SET_VISIBILITY( '01'  ).

  • How to unhide the column in Alv table

    Hi Experts,
        Initially i have created webdynpro Alv table with 8 columns ,later i have added one more attribute/column to the node to display extra column
    but in the output ,alv table not displaying the 9th column,Instead the column is getting hidden which i came to know clicking on settings in alv table output.If i make changes in Alv table settings it getting displaying,can anyone tell me how to unhide this field.
    Regards
    Sandesh

    Hi Sandesh,
         It is possible that the user you are loggin in with, might have a layout saved.
    You can try logging in with different user and see if its still hidden.
    The explicit code to hide and unhide a column :
    lo_alv_column->set_visible( if_wdl_core=>visibility_none ).
    may be  you can use the above code and make column visibility true(cahnge parameter).
    Regards,
    Tashi

  • WDABAP - How to read data from filtered ALV table

    HI
    In Web Dynpro for ABAP.
    I have a view with an ALV table on it.
    I would like to know how to read the data that's been filtered in the ALV table?
    Regards

    I've managed to find out that during runtime the following code returns a reference to a class pool:
    data: lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
    lr_salv_wd_table = wd_This->wd_cpIfc_ALV_GRAPHICS_DATA( )
    Two of the attributes of this class pool are:
              <b>IG_COMPONENTCONTROLLER~R_COMPONENT =    </b>                                       
    <b>          IF_COMPONENTCONTROLLER~R_COMPONENT =    </b>
    The attributes, IG_COMPONENTCONTROLLERR_COMPONENT and IF_COMPONENTCONTROLLERR_COMPONENT references a class CL_SALV_WD_C_TABLE. This class has an attribute R_RESULT_DATA which references a class CL_SALV_WD_RESULT_DATA_TABLE. The attribute T_RESULT_DATA contains the filtered data.
    Now I need to find out how I can access these attributes in the view.
    Regards

  • How to create tool bars in forms in Portals

    Hi,
    I am new to Ep.I have created forms and in that forms i am supposed to add tool bars like standard tool bar,formatting tool bar etc.(Like how we have in the forum header itself like bold,italic,font size etc..)
    Please help me out.
    Regards
    Ramalakshmi.S

    Thanks for your reply, But i cannot able to set it in plugin menu.
    Please guide me
    Thanks,
    vijay

  • How to merge the Rows in ALV table?

    Hi All,
    I want to merge the Rows in my ALV table(SALV_WD_TABLE). Is it possible?
    Regards,
    Yugesh A.

    Yogi1729 wrote:
    Hi All,
    how to Restrict the Row in the Pivot table.
    My Requirement is like this.
    i have to show the top 10 values in the pivot table but My report is show all the values.
    how can we achieve this.
    any quick solution for this appreciated.
    Thanks,
    Yogi.You can't really restrict the rows in a pivot table, but you can do this:
    http://oraclebizint.wordpress.com/2008/01/17/oracle-bi-101332-pagination-in-pivot-tables/

  • How to Highlight a text in alv table

    Hi
    i want to highlight(make BOLD) a particular text in the alv table.
    how to do this
    thanks and regards
    chythanya

    Hi chythanya ,
    Try this,
    Go to the prorpeties of the text to which yo want to dispaly as bold and set the design prorpety  as Emphasized, and now the text will display as bold.

Maybe you are looking for

  • How do I migrate bookmarks from one HD to another?

    Windows XP became corrupted (?). It was cheaper to install another hard drive, and install windows on the new drive (backing up the original HD would cost more than the new HD did....) The old drive is easily accessed. How do I migrate Firefox bookma

  • Why can't I recover disc space after removing Windows partition?

    Greetings, I have an early 2008 iMac 3.06 GHz Core 2 Duo with a 500 GB HD that I have steadily updated from Leopard to Mountain Lion.  I also had partitioned my HD using Bootcamp 2.0 to run Windows Vista Ultimate 64-bit.  Everything hummed along nice

  • Error while runing ejbc

    Hi, I am getting this error while i deploy my application on Sun1 7.0 /Linux Platform. It works fine in Windows. Any help ? Please 18/Feb/2003:14:33:20] FINE ( 9447): [EJBC] rmic com.siptech.pdf.ejb.session.PDFSessionBean_RemoteHomeImpl... [18/Feb/20

  • Issue with macro

    I have a macro that updates a key figure . The macro checks certain conditions and if the result is true sets the value of the key figure to 1 and changes the key figure value to 0  if the conditions return a value of false. I executed the macro in a

  • IDOCS: Segment Definition and Segment Type

    Hi Gurus, We are working on IDOCs and trying to send a Location Master IDOCs to Third party system. 1. In the IDOC print preview we are in a position to see the IDOC segment type Ex: E1TPLOC but customer is asking for Segment definition E2TPLOC. When