Remove print bottun in alv table

Hello,
In our web dynpro pages we use view controler uielement,
In the top of the alv we have a print button but we can't use it
because we do not have a Java engine.
haw can I remove the print button?
Best Regards,
Efrat Ben-David

Hi
Oops double posting
  data:   lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
  data: lr_config_table type ref to CL_SALV_WD_CONFIG_TABLE.
  lr_salv_wd_table = wd_this->wd_cpifc_<comp usage name>( ).
  lr_config_table = lr_salv_wd_table->get_model( )
  lr_config_table->IF_SALV_WD_STD_FUNCTIONS~SET_PDF_ALLOWED(  value = abap_false ).
Regards
Abhimanyu L
Message was edited by:
        Abhimanyu Lagishetti
Message was edited by:
        Abhimanyu Lagishetti

Similar Messages

  • 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 remove white seperators in ALV Table columns names?

    Hi,
    I am trying to remove white seperators which appeared dynamically on using ALV table on each of the column names. I checked in ALV API's but could not find anything there to remove code wise. Please help to remove this.
    Thanks
    Praveen

    Hi Praveen,
    Please use the following method.
      DATA lo_table  TYPE REF TO cl_salv_wd_config_table.
      CALL METHOD lo_table->if_salv_wd_std_functions~set_sort_headerclick_allowed( EXPORTING value  = abap_false ) .
    Regards,
    Manogna

  • Removing "print version" button in alv

    Hi Experts,
    I am trying to hide the buttons in ALV table.
    I did hide all other buttons except "Print Version".
    Can anyone assist.
    Thanks,
    Siva.

    Hi,
    I think use this "'SALV_WD_EXPORT' to hide the print version
    Use the below code -
    ***Reference to the standard button reference of the ALV
      DATA:
        ls_functions_std type SALV_WD_S_FUNCTION_STD_REF.
    ***Modifying The standard functionality buttons
    if lt_functions_std1 is not initial.
      loop at lt_functions_std1 into ls_functions_std.
        case ls_functions_std-id.
          when wd_assist->GC_APPEND_ROW.                           "'SALV_WD_INPUT_APPEND_ROW'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_INPUT_DELETE.                         "'SALV_WD_INPUT_DELETE'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_INSERT_ROW.                           "'SALV_WD_INPUT_INSERT_ROW'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_EXPORT_EXCEL.                        "'SALV_WD_EXPORT_EXCEL'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_PDF.                                     "'SALV_WD_PDF'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_INPUT_CHECK.                            "'SALV_WD_INPUT_CHECK'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_EXPORT.                                "'SALV_WD_EXPORT'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_FILTER .                               "'SALV_WD_FILTER'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_SETTINGS.                              "'SALV_WD_SETTINGS'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
        endcase.                     "Case ls_functions_std-id
        clear LS_FUNCTIONS_STD.
      endloop.                       "LOOP at lt_functions_std1 into ls_functions_std.
    endif.                           "IF lt_functions_std1 is not initial.
    Regards,
    Lekha.

  • Delete button in ALV Table

    Hi,
    Does any one have a code sample for the ALV Table Delete button? When I hit the DELETE button the selected row gets deleted but how can I save this deletion to the database table so that when I do a refresh the deleted row does not re-appear.
    Thanks. Kim

    Hi Kim,
             i am sorry but I dont have a sample code for this .. but yes i can tell you a very simple logic here that should work fine ..
    When the user clicks on Delete Entry call method say "Delete_entry" and within this you can write code based on this logic..
    1) On_Action_Lead_Select should copy the content of that row to another context node say "Selected_Entry"
    2) Search for this entry in your internal table/database that was bound to the ALVs context node(data source) and remove it using standard functions
    3) again read the database/internal table data and bind it to the context node ..
    Your changes will be reflected in your ALV..
    I hope this helps and if it does please do award points
    Also please close the thread if the issue gets resolved ..
    Regards,
    Anoop

  • WD4A Dynamic ALV Table with dynamic tables

    Hi all,
    first I want give you the information what I try to do.
    I have an another WD4A application for administrative use in which I can assign certain tablefields to a certain user. You can say it's something like a customizing application.
    In the next application (with my issues) I will display the tables for the user, but these tables are not the complete table.
    I have a node in my context of the component controller which is bound to my ALV. I add during the runtime attributes to my node.
    * .... coding ....declaration
    * get the node
      lr_node = wd_context->get_child_node( 'M_TABLE' ).
      lr_node_info ?= lr_node->get_node_info( ).
    * remove the attributes, if exists
      lr_node_info->remove_dynamic_attributes( ).
    * .... coding ....
    *   add attributes
        LOOP AT l_t_m_table INTO l_s_m_table.
          CLEAR ls_attribute.
    *     name of the attribute
          MOVE l_s_m_table-NAME TO ls_attribute-NAME.
    *     DDIC type of the attribute
          MOVE l_s_m_table-TYPE_NAME TO ls_attribute-TYPE_NAME.
    *     If the DDIC has a gen namespace like /B135/ replace the / with _
          REPLACE ALL OCCURRENCES OF '/' IN ls_attribute-NAME WITH '_'.
    *     add the attribute
          lr_node_info->add_attribute( EXPORTING
                                         attribute_info = ls_attribute ).
        ENDLOOP.
    This coding works fine I get the columns in my ALV. Then I tried to fill my ALV table with data from a database table.
    I created dynamicly an internal table with the following coding:
    *   Create dynamic table
        CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
          EXPORTING
            IT_FIELDCATALOG = l_t_FLDCAT
          IMPORTING
            EP_TABLE = l_t_NEW_M_TABLE.
    *   assign the table
        ASSIGN l_t_NEW_M_TABLE->* TO <M_TABLE>.
    *   structure of table
        CREATE DATA l_s_NEW_M_TABLE LIKE LINE OF <M_TABLE>.
        ASSIGN l_s_NEW_M_TABLE->* TO <l_s_m_table>.
    * get data from database
    SELECT * FROM (l_m_table) INTO CORRESPONDING FIELDS OF TABLE <M_table> WHERE OBJVERS = 'A'.
    With this coding I get the data from the database and only the required fields that means I have e.g. an itab with columns1, columns3, columns4 from the database.
    I also added e.g. these columns  (columns1, columns3, columns4 from the database) to the node as attribute. Now it should be possible to bind the table to the structure with this coding:
    lr_comp_usage_m = wd_this->wd_cpuse_usage_alv_M_table( ).
    *   create component if not active
        IF lr_comp_usage_m->has_active_component( ) IS INITIAL.
          lr_comp_usage_m->create_component( ).
        else.
    * set data if node exists
          l_ref_interfacecontroller = wd_this->wd_cpifc_usage_alv_M_table( ).
          l_ref_interfacecontroller->set_data( lr_node ).
        endif.
    *   bind table
        lr_node->bind_table( <M_TABLE> ).
    Now, I get an error, which is caused by the table binding.
    In ST22 I get:
    Short text
        Line types of an internal table and a work area not compatible.
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "CL_WDR_CONTEXT_NODE_VAL=======CP" had to be
         terminated because it has
        come across a statement that unfortunately cannot be executed.
    Error analysis
        The statement
           "INSERT wa INTO TABLE itab"
        requires the lines of the internal table "TABLE" and the
        work area " wa" to be compatible. Compatibility means
        equivalence in the context of ABAP/4 type checking.
        In this case, the condition is not satisfied because the internal table
        "TABLE" has the line type "u" and the length 28, but the work area " wa"
        has the type "C" and the length 2.
        (If the work area " wa" is the header line of the internal
        table "TABLE", the above inconsistency can arise if an internal
        table t with the line type T1 is passed to a subroutine (FORM or
        FUNCTION) as an actual parameter and the corresponding formal
        parameter p is declared in the subroutine by "TABLES p STRUCTURE T2".
        If then T1 and T2 are incompatible, the header line p
        has the type T2 (specifed by STRUCTURE), but the internal
        table p has the line type T1 (passed from the actual parameter)).
    Source Code Extract
    Line  SourceCde
        1 method if_wd_context_node~get_static_attributes_table .
        2
        3   field-symbols:
        4     <element> like line of me->collection,
        5     <static_attributes> type data,
        6     <table> type index table.
        7
        8 * check whether elements are supllied or not
        9   if me->elements_supplied = abap_false.
       10     me->supply_elements( ).
       11   endif.
       12
       13   clear table.
       14
       15   if me->table_ref is not initial.
       16     assign me->table_ref->* to <table>.
       17     table = <table>.
       18   else.
       19     loop at me->collection assigning <element> from from to to.
       20       assign <element>->static_attributes->* to <static_attributes>.
    error in line 21       insert <static_attributes> into table table.
       22     endloop.
       23   endif.
       24
       25 endmethod.
    Any suggestions? Is it allowed to use bind_table() with a field symbol?
    Another strange thing is that if I try the same with static itab and attributes during runtime it works, but only if the fields of the itab has the same name as the attributes, which means that I can not use itabs with fieldnames like /BI0/S_CUSTOMER and if I can not use them it's difficult to read data from database with SELECT * FROM ... INTO CORRESPONDING FIELDS OF TABLE itab.
    Thanks in advance for your suggestions!
    Best Regards,
    Marcel

    Hi Francois,
    I solve it with the RTTI and the method    
    lr_node_info = lr_node_info->add_new_child_node(
                          name = 'Dynamic_TABLE'
                          IS_MANDATORY = ABAP_false
                          IS_MULTIPLE = ABAP_true
                          STATIC_ELEMENT_RTTI = lr_struct_descr
                          IS_STATIC = ABAP_false
    I don't know why it doesn't work with adding attributes and binding the table after adding the attributes.
    Anyway thanks for your help.
    Best Regards,
    Marcel

  • I need to print logo in alv grid

    I need to print logo in alv grid .As of now its getting displayed but it cannot be printed .Kindly tell me wether there is any option to print it .Eitjer using ALV or Object oriented ALV.Please reply soon

    Hi Deepti,
    Refer the code below.
    report  sy-repid.
    type-pools : slis.
    *ALV Formatting tables /structures
    data: gt_fieldcat type slis_t_fieldcat_alv.
    data: gt_events type slis_t_event.
    data: gs_layout type slis_layout_alv.
    data: gt_page   type slis_t_listheader.
    data: gs_page type slis_listheader.
    data: v_repid like sy-repid.
    *ALV Formatting work area
    data: w_fieldcat type slis_fieldcat_alv.
    data: w_events type slis_alv_event.
    data: gt_bsid type table of bsid with header line.
    initialization.
      perform build_events.
      perform build_page_header.
    start-of-selection.
    *perform build_comment.     "top_of_page - in initialization at present
      select * from bsid into table gt_bsid up to 10 rows.
    *perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.
    *USING = Row, Column, Field name, display length, table name, heading
    *OR
      perform build_fieldcat.
      gs_layout-zebra = 'X'.
    *top of page event does not work without I_callback_program
      v_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program                = v_repid
          i_structure_name                  = 'BSID'
       i_background_id                   = 'ALV_BACKGROUND'
          i_grid_title                      = 'This is the grid title'
      I_GRID_SETTINGS                   =
          is_layout                         = gs_layout
          it_fieldcat                       = gt_fieldcat[]
          it_events                         = gt_events[]
        tables
          t_outtab                          = gt_bsid.
    Form..............:  populate_for_fm
    Description.......:  Populates fields for function module used in ALV
    form populate_for_fm using    p_row
                                        p_col
                                        p_fieldname
                                        p_len
                                        p_table
                                        p_desc.
      w_fieldcat-row_pos = p_row.          "Row Position
      w_fieldcat-col_pos = p_col.          "Column Position
      w_fieldcat-fieldname = p_fieldname.  "Field name
      w_fieldcat-outputlen = p_len.        "Column Lenth
      w_fieldcat-tabname = p_table.        "Table name
      w_fieldcat-reptext_ddic = p_desc.    "Field Description
      w_fieldcat-input = '1'.
      append w_fieldcat to gt_fieldcat.
      clear w_fieldcat.
    endform.                    " populate_for_fm
    *&      Form  build_events
    form build_events.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = gt_events.
      read table gt_events with key name =  slis_ev_user_command
                               into ls_event.
      if sy-subrc = 0.
        move slis_ev_user_command to ls_event-form.
        append ls_event to gt_events.
      endif.
      read table gt_events with key name =  slis_ev_top_of_page
                               into ls_event.
      if sy-subrc = 0.
        move slis_ev_top_of_page to ls_event-form.
        append ls_event to gt_events.
      endif.
    endform.                    " build_events
    *&      Form  USER_COMMAND
    When user command is called it uses 2 parameters. The itab
    passed to the ALV is in whatever order it currently is on screen.
    Therefore, you can read table itab index rs_selfield-tabindex to get
    all data from the table. You can also check r_ucomm and code
    accordingly.
    form user_command using  r_ucomm      like sy-ucomm
                             rs_selfield type slis_selfield.
      read table gt_bsid index rs_selfield-tabindex.
    error checking etc.
      set parameter id 'KUN' field gt_bsid-kunnr.
      call transaction 'XD03' and skip first screen.
    endform.
    *&      Form  top_of_page
    Your own company logo can go here if it has been saved (OAOR)
    If the logo is larger than the size of the headings in gt_page,
    the window will not show full logo and will have a scroll bar. Thus,
    it is a good idea to have a standard ALV header if you are going to
    use logos in your top of page.
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = gt_page
                i_logo             = 'ENJOYSAP_LOGO'.
    endform.
    *&      Form  build_fieldcat
    *Many and varied fields are available here. Have a look at documentation
    *for FM REUSE_ALV_LIST_DISPLAY and REUSE_ALV_FIELDCATALOG_MERGE
    form build_fieldcat.
      w_fieldcat-fieldname = 'BUDAT'.
      w_fieldcat-seltext_m = 'Dte pst'.
      w_fieldcat-ddictxt(1) = 'M'.
    Can change the position of fields if you do not want them in order
    of the DDIC or itab
    w_fieldcat-row_pos = '1'.
    w_fieldcat-col_pos = '10'.
      append w_fieldcat to gt_fieldcat.
      clear w_fieldcat.
    endform.                    " build_fieldcat
    *&      Form  build_page_header
          gt_page is used in top of page (ALV subroutine - NOT event)
          *H = Header, S = Selection, A = Action
    form build_page_header.
    For Headers, Key is not printed and is irrelevant. Will not cause
    a syntax error, but is not used.
      gs_page-typ = 'H'.
      gs_page-info = 'Header 1'.
      append gs_page to gt_page.
      gs_page-typ = 'H'.
      gs_page-info = 'Header 2'.
      append gs_page to gt_page.
    For Selections, the Key is printed (bold). It can be anything up to 20
    bytes. It gets printed in order of code here, not by key value.
      gs_page-typ = 'S'.
      gs_page-key = 'And the winner is:'.
      gs_page-info = 'Selection 1'.
      append gs_page to gt_page.
      gs_page-typ = 'S'.
      gs_page-key = 'Runner up:'.
      gs_page-info = 'Selection 2'.
      append gs_page to gt_page.
    For Action, Key is also irrelevant.
      gs_page-typ = 'A'.
      gs_page-info = 'Action goes here'.
      append gs_page to gt_page.
    endform.                    " build_page_header
    Settings for the Logo :
    01) GOTO - OAOR (Business Document Navigator)
    02) Give Class Name - PICTURES
    Class Type - OT
    Object type - whatever you want to call your area EG: OURCOMP.... then Execute
    03) Top left will say PICTURES. Bottom left will have multi tab. Select Create and double-click on Screen.
    04) Select your image from the appropriate directory.
    05) Give the image an appropriate name (not Screen)
    06) It will tell you document stored successfully.
    07) You can now find your logo under the heading OURCOMP in top left window.
    08) You can reference the logo in things like FM REUSE_ALV_COMMENTARY_WRITE or any other area which may reference these things. EG: I_LOGO = 'OURCOMP'. You can preview image by double-clicking it.
    <b>Please reward points if it helps.</b>
    Regards,
    Amit Mishra
    Message was edited by: Amit Mishra

  • Replacing SAP Object Selector with Radio Button in ALV table in WD ABAP

    Hi All,
    I have a view in Webdynpro ABAP which displays data in an ALV table view (using SALV_WD_TABLE component).
    By default we have the SAP Object Selector for selecting a particular row of the table. This has to be replaced with radio buttons.
    I mean instead of using the SAP Object Selector, I need radio buttons at the start of each row.
    What I have thought of is to make the SAP Object Selector Invisible and create another attribute for the radio button in the node which contains ALV output data.
    Can you please let me know how to remove the SAP Object Selector from ALV output table and also how to include a column with radio button in the ALV output table.
    Thanks and Regards,
    Sayan Ghosh

    Hi Lekha,
    I am working with HRASR00_PROCESS_EXECUTE WD component of MSS application. In order to generate the data, this in turn calls another component called DATAOBJECTPROVIDER. I need to make the table selection as none and replace the SAP Object Selector with the radio button.
    Do you know under which method in DATAOBJECTPROVIDER do we need make the changes. I tried to search all the methods but couldnt understand a suitable one.
    Thanks and Regards,
    Sayan Ghosh

  • DropdownByKey inside ALV Table - Problem with Value set

    Hi,
    I have Component A which has a custom controller that uses the interface controller of the ALV Component.
    Custom controller has node ITAB.. that has certain attributes...
    I want DropdownByKey inside the ALV Table column. I am populating the corresponding attribute of ITAB node with the value set that I want the drop down to have.
    However when I execute the application..I get error
    " Key XXX not present in Value Set and is not initial"
    XXX is present in the Value Set table of the attribute.
    <b>Following is my code in the methods of CUSTOM CONTROLLER</b>
    <u>Generate Value Set</u>
    nodeinfo_context = wd_context->get_node_info( ).
    nodeinfo_ITAB= nodeinfo_context->get_child_node( wd_this->wdctx_ITAB ).
    <u> Populate the Value Set</u>
    data ls_valueset type wdy_key_value.
    data it_valueset type wdy_key_value_table.
    ls_valueset-key = 'FRA'.
    ls_valueset-value = 'FRANCE'.
    Append ls_valueset to it_valueset.
    ls_valueset-key = 'SFO'.
    ls_valueset-value = 'SAN FRANCISCO'.
    Append ls_valueset to it_valueset.
    <u>Set the Value Set for the Attribute</u>
    call method nodeinfo_ITAB->SET_ATTRIBUTE_VALUE_SET
                  EXPORTING
                     NAME = <b>'ATTR1'</b>
                     VALUE_SET = it_valueset.
    <u>Changing ALV Column</u>
    Get the ALV Configuration Model
      ifc_alv2 = wd_this->wd_cpifc_alv2( ).
      itab_alv2_config = ifc_alv2->get_model( ).
      itab_alv2_config->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( abap_false ).
    <u>Get the Column reference for ATTR1</u> 
    ref_alv2_colset = itab_alv2_config->if_salv_wd_column_settings~get_column( <b>'ATTR1'</b> ).
    <u>Create the DropDownByKey Object</u>
    CREATE OBJECT ref_dropdownkey
              exporting SELECTED_KEY_FIELDNAME = ref_alv2_colset->id.
      ref_dropdownkey->SET_SELECTED_KEY_FIELDNAME( <b>ref_alv2_colset->id</b> ).
      ref_alv2_colset->SET_CELL_EDITOR( <b>ref_dropdownkey</b> ).
    <u>Check the value set</u>
      ref_attr_info = nodeinfo_flight_details2->get_attribute( ref_alv2_colset->id ).
    I do get back the value set if I see ref_attr_info->value_set.
    SO the Value Set is getting set for attribute ATTR1, but still I get Error
    <b>"The value selectedKey = "SFO" in DropDownByKey "_8C" does not exist in the value list and is not initial either "</b><u></u>
    SAP  User

    You have forgotten to set a cell variant. I had the same with setting a ProgressIndicator cell-editor to a table column as default editor. This causes the column to be hidden on the table while it did show up in the settings dialog. I removed the set_editor( lr_progressindicator) and created a cell variant instead with this lr_progressindicator. You then need to add this cell variant to your column. By default it will select the standard viewtext-cell-editor (which can only be textview and inputfield, like when you create a table yourself in a view), but if you use a cell variant, it will display the required cell editor if you set it (last line of the code).
    <b>In your case, replace lr_progressindicator by your ref_dropdownkey.</b>
      DATA: lr_column_settings    TYPE REF TO if_salv_wd_column_settings,
            lr_column             TYPE REF TO cl_salv_wd_column,
            lr_column_header      TYPE REF TO cl_salv_wd_column_header,
            lr_cellvar            TYPE REF TO cl_salv_wd_cv_standard,
            l_cellvar             TYPE string,
            lr_progress_indicator TYPE REF TO cl_salv_wd_uie_progr_indicator.
      lr_column_settings ?= wd_this->mr_table.
      lr_column = lr_column_settings->get_column( 'STATUSBAR' ).
      lr_column_header = lr_column->get_header( ).
      lr_column_header->set_text( 'Completed' ).
    CREATE OBJECT lr_cellvar.
      l_cellvar = 'CV_SB'.
      lr_cellvar->set_key( l_cellvar ).
      CREATE OBJECT lr_progress_indicator.
      lr_progress_indicator->set_percent_value_fieldname( 'STATUSBAR' ).
      lr_progress_indicator->set_tooltip( 'completed' ).
      lr_cellvar->set_editor( lr_progress_indicator ).
      lr_column->add_cell_variant( lr_cellvar ).
      lr_column->set_selected_cell_variant( l_cellvar ).
    I hope this will solve your issues.

  • Remove toolbar from Reused alv grid

    How can i remove the toolbar and all the functions from the re-used alv grid ?
    regards

    Hi,
    I hope this is what you are looking for:
    **make sure you create a component and get the model first
    contol ALV table
    data: lr_alv_usage       TYPE REF TO if_wd_component_usage,
            lr_if_controller   TYPE REF TO iwci_salv_wd_table,
            lr_config          TYPE REF TO cl_salv_wd_config_table,
            lr_filter          TYPE REF TO if_salv_wd_std_functions.
            lr_filter          ?= lo_value.
    set read only mode to false (and display edit toolbar)
      data: lr_table_settings type ref to if_salv_wd_table_settings.
      lr_table_settings ?= lo_value.
      lr_table_settings->set_read_only( abap_false ).
    disable insert, delete and append from the ALV toolbar
      lo_value->if_salv_wd_std_functions~set_edit_append_row_allowed( abap_false ).
      lo_value->if_salv_wd_std_functions~set_edit_insert_row_allowed( abap_false ).
      lo_value->if_salv_wd_std_functions~set_edit_delete_row_allowed( abap_false ).
      lo_value->if_salv_wd_std_functions~SET_EDIT_CHECK_AVAILABLE( abap_false ).
    " Specify the setting for using ALV filter
       lr_filter->set_filter_complex_allowed( value = abap_true ).
    DATA: lr_table_settings TYPE REF TO if_salv_wd_table_settings.
      lr_table_settings ?= lo_value.
      lr_table_settings->set_enabled( abap_true ).
      lr_table_settings->set_row_selectable( abap_true ).
      lr_table_settings->set_design( cl_wd_table=>e_design-alternating ).
      lr_table_settings->set_top_of_list_visible( abap_false ).
      lr_filter->set_sort_headerclick_allowed( abap_true ).
      lr_filter->aset_filter_filterline_allowed( abap_true ).
      lr_filter->set_sort_complex_allowed( abap_true ).
      lr_filter->set_view_list_allowed( abap_false ).
      lr_filter->set_pdf_allowed( abap_true ).
    Regards,
    Abdul

  • Custom Button in ALV table

    Hi Experts,
    I have created a custom button 'SELECT' in ALV table toolbar.
    lo_function = l_value->if_salv_wd_function_settings~create_function( 'SELECT' ).
    Now i am getting position of this custom button next to the Standard buttons ('Print' and 'Export' ). So how do I change the custom button position to first place. I mean the custom button should be in the left most position in the toolbar.
    Please help me in resolving this.
    Regards,
    Sarathy.

    Thank you Lekha. Set_position is working.
    We have to change the positon of custom button and the standard button. So that the position of button gets interchnaged.
    Regards,
    Sarathy
    Edited by: DEVASARATHY PANDI on Jan 26, 2012 12:18 PM

  • Displaying default value for a field in ALV table

    Hai all,
         I am having an ALV table in which I want to display Requisition number by default using a value which i generated randomly and it is stored in a variable.
    While displaying ALV table my req number field should display that value by default when ever user is inserting a row( all the coloumns n my alv are editable.
    Is it possible?? 
    Kindly give some suggestions.
    Thanks in Advance,
    Nalla.B

    Hai Kris,
        I took help from ur link and i declared a global attribute request_number.
    and i created an event handler ON_ALV_INSERT and did the follwing coding for giving default value wen ever am inserting new row.
    FIELD-SYMBOLS: <wa_row> LIKE LINE OF r_param->t_inserted_rows.
      DATA bill_details TYPE REF TO zdom_bill_detail.
      LOOP AT r_param->t_inserted_rows ASSIGNING <wa_row>.
        bill_details ?= <wa_row>-r_value.
        IF bill_details->REQ_NUMBER IS INITIAL.
      DATA lo_nd_bill_detail TYPE REF TO if_wd_context_node.
      DATA lo_el_bill_detail TYPE REF TO if_wd_context_element.
      DATA ls_bill_detail TYPE wd_this->Element_bill_detail.
    navigate from <CONTEXT> to <BILL_DETAIL> via lead selection
      lo_nd_bill_detail = wd_context->get_child_node( name = wd_this->wdctx_bill_detail ).
    lo_el_bill_detail = lo_nd_bill_detail->get_element( index = <wa_row>-index ).
          lo_el_bill_detail->set_attribute(
            EXPORTING
              name  = 'REQ_NUMBER'
              value = wd_comp_controller->request_number
    Wen am  setting the value of wd_comp_controller->request_number to my context attribute am getting NULL object ref error.
    lo_el_bill_detail->set_attribute(
        name =  `REQ_NUMBER`
        value = wd_comp_controller->request_number ).
    Pls give some suggestions,
    Thanks in Advance,
    Nalla.B

  • How many lines we can print using Non-alv report list ?

    Hi Experts,
    How many lines we can print using Non-alv report list ?
    regards
    vishnu

    Hi,
    It depends on the page size according to the page size we can set the no. of lines as follows,
    REPORT  program_name   NO STANDARD PAGE HEADING
    LINE-SIZE 290
    LINE-COUNT 65.
    Hope it helps you,
    Regards,
    Abhijit G. Borkar

  • How to remove Print pdf link below the reports?

    How to remove print pdf(only pdf. i need html) report which is available below the reports? I am not asking to remove it from the print icon at the left bottom of the page. I need it to be deleted from the link in the middle of the page below the report.

    Go to
    C:\OracleBI\web\msgdb\messages\controlmessages.xml
    Then
    Remove The below Tag From the control messages.xml
    <sawm:if name="enablePDF"><a class="NQWMenuItem" name="pdf" href="javascript:void(null)" onclick="return PortalPrint(&#39;@{pdfURL}[javaScriptString]&#39;,@{bNewWindow});"><sawm:messageRef name="kmsgDashboardPrintPDF"/></a></sawm:if>
    After that Restart the server.
    You will not find the pdf link
    Edited by: 848525 on Apr 21, 2011 4:17 AM

  • How can i  change the column label text in a alv table display

    how can i change the column label text in a alv table display??
    A similar kinda of question was posted previuosly where the requirement was the label text was needed and following below code was given as solution :
    <i>*  declare column, settings, header object
    DATA: lr_column TYPE REF TO cl_salv_wd_column.
    DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    DATA: lr_column_header type ref to CL_SALV_WD_COLUMN_HEADER.
    get column by specifying column name.
    lr_column = lr_column_settings->get_column( 'COLUMN_NAME1' ).
    set Header Text as null
    lr_column_header = lr_column->get_header( ).
    lr_column_header->set_text( ' ' ).</i>
    My specific requirement is i have an input field on the screen and i want reflect that value as the column label for one of the column in the alv table. I have used he above code with slight modification in the MODIFYVIEW method of the view since it is a process after input. The component gets activated without any errors but while run time i get an error stating
    <i>"The following error text was processed in the system CDV : Access via 'NULL' object reference not possible."</i>
    i have checked in debugging and the error occured at the statement :
    <i>lr_column = lr_column_settings->get_column( 'CURRENT_YEAR' ).</i>Please can you provide me an alternative for my requirement or correct me if i have done it wrong.
    Thanks,
    Suri

    I found it myself how to do it. The error says that it is not able to find the reference object i.e  it is asking us to refer to the table. The following piece of code will solve this problem. Have to implement this in WDDOMODIFYVIEW method of the view. This thing works comrades enjoy...
      DATA : lr_cmp_usage TYPE REF TO if_wd_component_usage,
             lr_if_controller  TYPE REF TO iwci_salv_wd_table,
             lr_cmdl   TYPE REF TO cl_salv_wd_config_table,
             lr_col    TYPE REF TO cl_salv_wd_column.
      DATA : node_year  TYPE REF TO if_wd_context_node,
             elem_year  TYPE REF TO if_wd_context_element,
             stru_year  TYPE if_alv_layout=>element_importing,
             item_year  LIKE stru_year-i_current_year,
             lf_string    TYPE char(x),
      DATA: lr_column TYPE REF TO cl_salv_wd_column.
      DATA: lr_column_header TYPE REF TO cl_salv_wd_column_header.
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    Get the entered value from the input field of the screen
    node_year  = wd_context->get_child_node( name = 'IMPORTING_NODE' ).
    elem_year  = node_year->get_element( ).
      elem_year->get_attribute(
       EXPORTING
        name = 'IMPORT_NODE-PARAMETER'
       IMPORTING
        value = L_IMPORT_PARAM ).
      WRITE L_IMPORT_PARAM TO lf_string.
    Get the reference of the table
      lr_cmp_usage  =  wd_this->wd_cpuse_alv( ).
      IF lr_cmp_usage->has_active_component( ) IS INITIAL.
        lr_cmp_usage->create_component( ).
      ENDIF.
      lr_if_controller  = wd_this->wd_cpifc_alv( ).
      lr_column_settings = lr_if_controller->get_model( ).
    get column by specifying column name.
      IF lr_column_settings IS BOUND.
        lr_column = lr_column_settings->get_column( 'COLUMN_NAME').
    set Header Text as null
        lr_column_header = lr_column->get_header( ).
        lr_column_header->set_text( lf_string ).
    endif.

Maybe you are looking for