BSP COMPILER & Table view  ITERATOR

Hi Gurus,
   Can any  body give the follwing details
1.What is BSP Compiler?
2.What is Table view iterator?
Thanks in Advance,
Regards,
Ravi.

Hi,
1.the compiler builds the internal code you put in your pages.
practical reference:
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/11099890-0201-0010-d695-ac642d35c708">pdf by Karl Kessler</a>
2.a bsp table view iterator can be checked here:
<a href="/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator">Weblog by Brian McKellar</a>
<a href="/people/thomas.jung3/blog/2004/09/15/bsp-150-a-developer146s-journal-part-xi--table-view-iterators by Thomas Jung</a>
basically it's used for customizing diplay of tables
grtz
Koen
Message was edited by: Koen Labie

Similar Messages

  • Urgent!!!How to add a Dropdown in a Table View Iterator CLass?

    Hi All,
    I want to add a Drop Down List in the Table View Iterator Class. I am not able to do that.
    If any of you have done please reply, as it is very urgent.
    Please give the code extract possible (with data defination too)
    Regards,
    Dhaval
    Points will be given
    Mark this as Urgent

    Hi
    You need to modify RENDER_CELL_START method of your iterator class and you use the p_replacement_bee attribute to output the drop down
    The example below outputs the units of measure for a material
    data:
            col_dropdown   TYPE REF TO CL_HTMLB_DROPDOWNLISTBOX,
            col_listitem   TYPE REF TO CL_HTMLB_LISTBOXITEM,
            table_bee      TYPE REF TO cl_bsp_bee_table,
    CASE p_column_key.
        WHEN 'Column Name'.
    needs to change.  way too slow to select each time.
            prod_id = <current_line>-matnr.
            CALL FUNCTION 'Z_GET_UOM'
              EXPORTING
                PRODUCT_ID = prod_id
              IMPORTING
                UOMLIST    = uom_list.
            clear uom_line.   append uom_line to uom_list.
            CREATE OBJECT table_bee.
            CREATE OBJECT col_dropdown.
            rowidx = p_row_index.
            shift rowidx left deleting leading space.
            concatenate p_column_key rowidx into  col_dropdown->id.
            col_dropdown->width     = '100%'.
            col_dropdown->selection = <current_line>-zieme.
            table_bee->add( level = 1 element = col_dropdown    ).
            loop at uom_list into uom_line.
              CREATE OBJECT col_listitem.
              col_listitem->key    = uom_line-name.
              col_listitem->value  = uom_line-value.
              table_bee->add( level = 2 element = col_listitem    ).
            endloop.
            p_replacement_bee     = table_bee.

  • Cell Binding/Table View Iterator

    Hi Friends,
    I am getting error while editing the particular cell of column table view. when I enter the changes, they are not updating in the cell.I used the following code.
    method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS .
    APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
    <def>-COLUMNNAME = 'RELDATE'. <def>-EDIT = 'X'.
    method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_ROW_START .
    m_row_ref ?= p_row_data_ref.
    endmethod.
    method
    IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START .
    CASE p_column_key.
    WHEN 'RELDATE'.
    IF p_edit_mode IS NOT INITIAL.
      DATA: Rdate TYPE STRING.
      Rdate = m_row_ref->RELDATE.
      p_replacement_bee = CL_HTMLB_INPUTFIELD=>FACTORY(
                              id        = p_cell_id
                              value     = Rdate
                               type      = 'DATE'
                               VALUE = PCELL_BINDING
                                showHelp  = 'TRUE'
                                encode = 'TRUE').
    I am bit confused abt MVC.Please mail me the exact code changes to be done in MVC-Class controller.
    Regards
    CSM Reddy

    Pls check the code, & mail me back in case of any errors.
    method DO_HANDLE_EVENT .
    DATA: itabtype  type standard table of stdview1.
    DATA: tv TYPE REF TO cl_htmlb_tableview.
      tv ?= cl_htmlb_manager=>get_data(
                              request      = runtime->server->request
                              name         = 'tableView'
                              id         = 'stdview1' ).
      IF tv IS NOT INITIAL.
        DATA: tv_data TYPE REF TO cl_htmlb_event_tableview.
        tv_data = tv->data.
        IF tv_data->prevselectedrowindex IS NOT INITIAL.
          FIELD-SYMBOLS: <row> like LINE OF ITABTYPE .
         READ TABLE ITABTYPE INDEX tv_data->prevselectedrowindex
         ASSIGNING <row>.
          DATA value TYPE string.
          value = tv_data->get_cell_id( row_index    =
                       tv_data->prevselectedrowindex
                                         column_index = '6' ).
          DATA: inputfield TYPE REF TO cl_htmlb_inputfield.
          inputfield ?= cl_htmlb_manager=>get_data(
                              request      = request
                              name         = 'DESCRIPTION'
                              id           = value ).
    <row>-DESCRIPTION = inputfield->value.
    ENDIF.
    ENDIF.
    Regards
    CSM Reddy

  • Create/Drop/Compile Table, Views, Triggers, Sequences, etc.

    Is there a way to create, drop, and compile objects on an Oracle database with the ADF library? If so, any good examples?
    Can the results be captured as well?

    Frank,
    Maybe I wasn't clear enough. The only example I saw that involved the blob column was number 85 which did not contain info for database maintance.
    I have a JClient application that reads database structures like triggers, tables, and views. I would like the user to be able to push a button and the trigger be compiled in the database. While SQL Dev probably has more features and does a better job I have added a bunch of internal stuff that would have to be manually added in SQL Dev each time a new trigger was created.
    Is there a way, when working with the current transaction(or new transaction), to issue a statement like you would in SQL*Plus "DROP TABLE EMPLOYEES;" with the results being "TABLE DROPPED"?
    thanks.

  • Table View Iterator

    Hi SDN Firends,
    Is it possible to use two iterator in the same class?If so how?
    Using MVC ,I'm having a requirement of displaying two tables in the same page.
    I dont want to display it by calling from others pages.
    With Regards,
    SHARMILA BRINDHA.M

    Of course you can. Simply give them two different names.
    data: iterator1 type ref to zcl_my_iterator1.
    data: iterator2 type ref to zcl_my_iterator2.
    create object iterator1.
    create object iterator2.
    <htmlb:tableView id="tv1" iterator="<%= iterator1> ...
    <htmlb:tableView id="tv2" iterator="<%= iterator2> ...
    Cheers
    Graham Robbo

  • Changeable image using table view iterator

    Hello Forum -
    I have a tableview iterator working using cl_htmlb_image class. The icon shows up perfectly based on the column value (X=green; space=red). I would now like to click on the icon (just like clicking on checkbox) and turn the color from red->green or green->red which should of course change the value of the column as well.
    Here is my code, please help me:
    ======================================================
    IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START
    ======================================================
    DATA: img       TYPE REF TO cl_htmlb_image.
    DATA: beetable  TYPE REF TO cl_bsp_bee_table.
    CREATE OBJECT img.
    CREATE OBJECT beetable.
    CASE p_column_key.
      WHEN 'ACTVFLAG'.
        img->id   = p_cell_id.
        IF c_row_ref->actvflag = 'N' OR
           c_row_ref->actvflag IS INITIAL.
           img->src = 'ICON_LED_RED'.
           img->alt = 'Inactive'.
        ELSE.
           img->src = 'ICON_LED_GREEN'.
           img->alt = 'Active'.
        ENDIF.
        beetable->add( element = img level = 1 ).
        p_replacement_bee = beetable.
    Thanks,
    Partho

    in the iterator (render cell start) when rendering the image add the onclick property to image.
    p_replacement_bee = cl_htmlb_image=>factory( id = p_cell_id src = icon_plane onclick = 'image_click' )
    now when the user click on the image oninputprocessing will be triggered and check whether its is image click, if yes set a variable to some value to indicate that the image is clicked (and also to identify what image is clicked)
    option1: store these info as a serverside cookie and read it in your IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START method to change the image
    or
    option2: pass these values to iterator class attribute and read it in your IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START method to change the image.
    Regards
    Raja

  • Check box in tabel view?when to use itereator and when to use table view

    hi,
    I want to have a check box along with the other 7fields  in the table view.
    when the checkbox is checked and the merge complete push button is clicked, the respective code for merge is to be executed.
    how can I do this?
    could anyone tell me hw to get a check boz in table view
    when to use a  iterator in BSP, how table view n iterator in comparision ae used or function/work.
    Regards,
    Pavan P.

    Hi Pavan,
    Table View is an BSP element used to display mass data in a layout similar to a table (table view).
    <b>Iterator</b>is an attribute to modify rendering row-by-row, and make it dependent on the clicked row. In this way, you define an action from a particular line. This action is defined in columnDefinitions or overWriteDefinitions.
    <htmlb:tableView id = "tvX"
                     headerText          = "Department List"
                     design              = "standard"
                     headerVisible       = "true"
                     width               = "30%"
         selectedRowKeyTable = "<%= selectedrowindextable %>"
         onRowSelection      = "MyEventRowSelection"
         sort                = "server"
         keepSelectedRow     = "TRUE"
         selectionMode       = "MULTISELECT"
         table               = "<%= i_dept %>" >
    </htmlb:tableview>
    In your <b> OnInputProcessing </b>, Use this Iterator table to get the data of selected records.
    IF selectedrowindextable[] IS NOT INITIAL.
    DESCRIBE TABLE selectedrowindextable LINES no .
    Rgds,
    Jothi.
    Pls do close the thread if ur problem is solved.

  • Create a table view in my BSP Application!.

    Hi All,
    I am using CRM version 4.0 here i want to crate a new table view in my own BSP Application and want to display in the CRM_IC Application.
    The problem now i am facing is.. there is now provision to create the table view via the wizard. I tried to copy the BSP code, changed the code accordingly also i changed the inheritance for the context node class from
    CL_BSP_WD_CONTEXT_NODE to CL_BSP_WD_CONTEXT_NODE_TV.
    i also copied the iterator attribute.
    still the view is coming with an error saying that page have some problem.
    can anyone suggest any easy method to create the table view!.
    or else can you tell me what i have to do further!.
    Thanks n regards,
    sudeep v d.

    Hi,
    The problem is not only at the .htm page!. I think some changes are required at the context node level. for
    here is the BSP code I m using for displaying the table view..
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <%@extension name="xhtmlb" prefix="xhtmlb" %>
    <%@extension name="bsp" prefix="bsp" %>
    <%@extension name="CRM_BSP_IC" prefix="crmic" %>
    <crmic:tray2 id     = "MoreFields"
                 title  = "<%= otr(crm_ic_appl/BuPaAccount) %>"
                 height = "100%,603"
                 width  = "100%" >
      <crmic:trayBody2>
        <crmic:gridLayout cellSpacing    = "1"
                          columnSize     = "1"
                          rowSize        = "10"
                          height         = "100%"
                          width          = "100%"
                          widthPredefine = "TRUE">
        <crmic:gridLayoutCell columnIndex = "1" rowIndex    = "4" >
            <crmic:tableView design          = "STANDARD"
                             width           = "100%"
                             id              = "Address"
                             table           = "//Address/Table"
                             visibleFirstRow = "3"
                             visibleRowCount = "4"
                             selectionMode   = "LINEEDIT"
                             onRowSelection  = "select"
                             fillUpEmptyRows = "TRUE"
                             headerVisible   = "FALSE"
                                           >
              <crmic:tableViewCols>
                <crmic:tableViewColumn columnName = "STREET"
                                       title      = "<%= otr(CRM_IC_APPL/BuPaStreet_t) %>"
                                       edit       = "TRUE" />
                <crmic:tableViewColumn columnName = "POSTL_COD1"
                                       title      = "<%= otr(CRM_IC_APPL/BUPAPOSTCODE_T) %>"
                                       edit       = "TRUE" />
                <crmic:tableViewColumn columnName = "CITY"
                                       title      = "<%= otr(CRM_IC_APPL/BUPACITY_T) %>"
                                       edit       = "TRUE" />
                <crmic:tableViewColumn columnName = "REGION"
                                       title      = "<%= otr(CRM_IC_APPL/REGION) %>"
                                       edit       = "TRUE" />
                <crmic:tableViewColumn columnName = "REGIONNAME"
                                    title      = " "
                                       edit       = "FALSE" />
              </crmic:tableViewCols>
            </crmic:tableView>
        </crmic:gridLayoutCell>
       </crmic:gridLayout>
      </crmic:trayBody2>
    </crmic:tray2>
    In the above code i have given
    table    = "//Address/Table"
    here the 'Address' is defined as a page attribute type ref to the context node class ( CL_CRM_IC_BUPAMOREADDRESS_CN01 ).
    the same class is used in the CRM_IC application works fine!.
    also i entered the attribute entry for the 'Address' in the _CTXT class the view.
    still the same error 'page  cannot be displayed'.
    what could be the problem anyone plaese help!.
    Thanks n regards,
    sudeep v d.

  • BSP table view concatenation

    Dear SAP Gurus,
    I am working in SAP BSP. I have a table view, in that, I have concatenated date and time field.
    I want to create a filter there.  Since it is concatenated, the filter is not working.
    Please help and guide me how to resolve it.
    Regards,
    Abu.

    I agree with Graham...you can implement iterator concept to tackle the requirement...
    in TableView element there is a parameter name "Iterattor" which can hold instance of any iterator class...
    you can use local or global class to write logic...
    correct method can be "Column_Rendering" (can not remember exact name, please check in the interface avaialble in TableView element)
    Thanks

  • BSP: How to create check box in a column of a Table View

    Hi All,
    I have a table view in Web IC scenario. my requirement is to display check box in one of the column of the table view.. so that i can select multiple lines from the table and do some calculations!.
    Anybody have any hint/clue
    Thanks in advance,
    sudeep v d.

    Hi,
    This can be achieved by using a Table iterator.
    Please check the standard examples for this.
    Thanks,
    Rashmi.

  • Minimise Server Click in a Table view in  BSP

    Hello All
    I have a issue related to TableView in a BSP Application
    Our requirement is :
    User want to edit a coolumn value for  few records displayed in a Table View . as per My knowledge , when a row is selected in a table view , system go to server side and takes time . user did not liked that. He want to get it done faster that is selection of rows should be faster.
    How can we achiew row selection in a tableview without server clicks....we also want to find selected rows.
    can we achieve this and how ? Please let me know at the earliest.
    Thanks
    Rajiv

    don't implement the onRowSelection handler for the table view. Let the user choose the several lines and add a button called 'Choose' for e.g. Only when the button is clicked you start processing the selection.

  • How to SELECT ALL records of a TABLE VIEW in the BSP page

    Hi All,
    In the BSP portal, I am displaying some data(multple records) in the form of a table using the BSP TAG <htmlb:tableView>. I wrote the logic in the 'VIEW' of the BSP application which will be triggered by the controller. I have used the attribute selectionMode = "MULTISELECT" to have a Check Box to select a row.
    My requirement is to have a button/checkbox on the first column of the header of the table view. By clicking on this, it should select/desect all the records of the table. Could someone please help me how to do this? What attribute I should use in the tableview to get the button in the header row of the table and how to select all the records of the table.?
    Please provide your valuable inputs.
    Thanks & Regards,
    Paddu.

    Select all / Deselect all functionality when onRowSelection is there

  • Capture the rows selected in a multiselect table view (BSP)

    Hi,
    My requirement is:
    I have a table view in which I can select multiple rows.
    I will be selecting some rows, and pressing a button.
    Functionality of button is written in Javascript, to open a popup window.
    But how will I capture which all rows were selected ?
    Should I use a Java code or ABAP code ?
    And where should I put that code ?
    I tried calling the method cl_hrrcf_iterator=>get_tv_attr in the Javascript of the button. But it doesnt work. But if its in DO_HANDLE_DATA it works. Why is it like that ?
    Is it possible in BSP, to use the function htmlbevent.obj.getSelectedRows() ? If so, how should the code be ?
    Could you please tell me some of the possible solutions.
    Would definitely appreciate quick replies.
    Thanks,
    Nisha Vengal.

    Hi Nisha,
    You can have the ABAP code itself. I had also faced with then same issue. Use the below piece of code form your requirements.
    In *IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_ROW_START*
    *  Data : M_ROW_REF type <Structure type>
    *m_row_ref ?= p_row_data_ref*
    In *IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START*
    * DATA : CHK TYPE FLAG
    *case p_column_key.*
       when ' <Column Name>'.*
         CHK = m_row_ref-><Column Name>.*
          p_replacement_bee = CL_HTMLB_CHECKBOX=>FACTORY(
                                id                = p_cell_id
                              checked         = CHK ).
    In *Do Request*
    Data : loc_table_event type ref to cl_htmlb_event_tableview
    call method cl_hrrcf_iterator=>get_tv_attr
        exporting
          p_tv_id               = '<Tabe View ID'
          p_component_id        = me->component_id
          po_request            = me->request
        importing
          po_tv_event           = loc_table_event.
    The above methods are used to get the values which are selected in the table view and operated further.
    Reward points if useful.
    Regards,
    Gokul.N

  • Passing internal table to a BSP Table view

    Hi All,
    I have a Function Module which returns an internal table
    with data from R/3.
    I would like to know is it possible to display it in a custom BSP Table view for Web IC.
    please help if anybody solved similar problem!.
    Thanks n Regards,
    sudeep v d.

    Hi,
    I am able to display a table view but here i am passing
    the table parameter in the .htm like this.,
    table           = "//Address/Table"
    where,
    'Address' is type ref to CL_CRM_IC_BUPAMOREADDRESS_CN01
    I created my  own implementation class (ZCL_CRM_IC_BUPAMOREADDRES_IMPL)
    and context class (ZCL_CRM_IC_BUPAMOREADDRES_CTXT)
    created!.
    here my question is .. is there anyway to pass an internal table to this view!.
    please help..
    Thanks n regards,
    sudeep v d.

  • To determine the number of rows selected in a table view (BSP)

    Hi,
    My requirement is:
    I would be selecting 1 row from a table view ( which is made multiselect for another requirement) , and press a button.
    The functionality of button is to open a popup window based on the row selected.
    I want to display an error message if more than 1 row is selected, and button is clicked.
    Message will say that "you cannot select more than 1 row".
    For this,  I need to know how I can get the number of selected rows in a table view.
    I tried using the below code.
    But I feel this will work only in DO_HANDLE_DATA method.
    The popup would open, even before control comes in this method.
      CALL METHOD cl_hrrcf_iterator=>get_tv_index
        EXPORTING
          p_id               = p_tableview_id
          pt_form_fields = table_form_fields
        IMPORTING
          pt_indices      = sel_row_index_tab.
    Could you please provide me with a solution.
    Quick replies will be highly appreciated.
    Thanks,
    Nisha Vengal.

    Hi ,
    Your TV :
    <htmlb:tableView id              = "tv1l"
                                   design          = "alternating"
                                   visibleRowCount = "10"
                                   fillUpEmptyRows = "true"
                               onRowSelection  = "MyEventRowSelection" <----This is the event you have to use
                                   selectionMode   = "MULTILINEEDIT"
                                  filter          = "SERVER"
                                   table           = "<%= some table %>" >
    in DO_REQUEST:
    DATA:  tv                  TYPE REF TO cl_htmlb_tableview,
           tv_event          TYPE REF TO cl_htmlb_event_tableview ,
           event             TYPE REF TO if_htmlb_data.
    event = cl_htmlb_manager=>get_event( request ).
    IF event IS NOT INITIAL AND event->event_name = htmlb_events=>tableview.
      tv_event ?= event.
      CASE event->event_server_name.
        WHEN 'MyEventRowSelection'.
    count = count + 1 .
    if count ne 1 .
    errmsg = 'Your message'.
    endif.
    ENDCASE.
    ENDIF.
    in View/Layout:
    <% if errmsg is not initial. %>
    <s cript t y p e   =   t e x t / j a v a s c r i p t >
    a l e r t ("<%= errmsg %>") .
    </ s c r i p t>
    <% clear errmsg. %>
    <% endif. %>
    errmsg is a class attribute of type string and count is also a class attribute of type c .
    Regards,
    Anubhav.
    Reward if useful
    Edited by: Anubhav Jain on Sep 19, 2008 3:08 PM

Maybe you are looking for