Skip to Content
avatar image
Former Member

HTMLB Complex Select Options

Hi,

I am pretty comfortable with developing BSP application with HTMLB.Now i have a complex scenario of forming the SELECT statement dynamically with HTMLB.I am in need of the following requirements,

1) Dynamically selecting the Columns in the TableView when the user selects the Fields available for that table.

2) Dynamic Arrangement of Columns for e.g User selected

1,4,7,8 and giving the option to the user to rearrange in

any way like 4,7,1,8 and save it in his user session.

3) Dynamic sorting of Columns for the TableView and the user specified the sort order

4) Dynamic filtering of data for the TableView

My whole idea is to take the BSP application to EP60. I know selecting Dynamically sounds crazy but some of the experts would have done it for sure.

Can any expert help me out in this?

Thank you

arun

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • Aug 06, 2004 at 10:27 PM

    Would recommend as starting point this article: <a href="/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator">BSP Programming: HTMLB TableView Iterator</a>.

    What you are specifically interested in, is the column definition method in the iterator. This is the time that can you update, completely replace, or even in that moment actually define the column definitions. It is easily possible to specify what columns should be rendered, and in what sequence. Look at all the flags that this table support per column.

    We do not have the concept of column select in <htmlb:tableView>.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 08, 2004 at 08:24 PM

    Thanks Brian McKellar,

    This is the same example i used to create the report. But what i am looking for is, I will provide checkboxes to select the list of columns(This checkbox column values are hardcoded) and at runtime and wheni press a button it should display a report with only the selected columns in the checkboxes.

    It is the same thing for Arranging the column and sorting. Everything is selected by the User at runtime.

    Is this really possible in HTMLB, Because in the Select statement the INTO clause target is an static table which has all the fields in it, I want this to table to be a dynamic structure or field synbol so that it can change the number of fields at runtime.

    Thank you

    arun

    Add comment
    10|10000 characters needed characters exceeded

    • Arun,

      I am still slightly confused by your question. There are one or two questions:

      (1) How to get the rendering of the table using the <htmlb:tabelView> so dynamic that only specific columns are used and in a specific sequence. For this, you can very easily do it with the column definitions. If you really fail, we can build an example.

      (2) How to use the SELECT statement to only fetch specific columns from the database (so as to obtimize load performance). This question has nothing to do with BSP. I look at the online documentation for ABAP about 60 seconds (using the SELECT keyword as search criteria), and find this example code:

        DATA: l_columns TYPE TABLE OF string, 
              l_container TYPE string, 
              l_count     TYPE i. 
        APPEND `CITYTO`   TO l_columns. 
        APPEND `count( * )` TO l_columns. 
        SELECT (l_columns) 
               FROM spfli 
               INTO (l_container, l_count) 
               GROUP BY (l_group). 
          WRITE: / l_count, l_container. 
        ENDSELECT. 
      

      The documentation is relatively complex here. Maybe you can read it directly in your system, as I do not want to paste all of it here. Of course l_columns can have more fields.

      Is this roughly what you wanted?

  • avatar image
    Former Member
    Aug 09, 2004 at 08:39 PM

    Thanks Brian McKellar,

    I too used the same example for dynamic select

    SELECT (l_columns)

    FROM spfli

    INTO flights or <flights>

    ORDER BY (l_order).

    Let me reform the question now,

    1) l_columns should be formed at runtime with the user selected columns which are provided by me as list of checkboxes.

    2) The target in the INTO class should be dynamic enough to only have the fields selected by the user at runtime. Because i want the report to be formed based on the fields selected by the user and the table or field symbol in the INTO class is assigned to the <TableView>. I cannot specigy <Tableviewcolumns> because i don't know the list of columns at design time.

    3) l_order should be formed at runtime with the sorting made by the user with the selected columns in l_columns.

    4) I should be able to sort the columns by clicking the header of each and every column.

    Anyhow you have provided me lots of valuable information through this Posting thanks for that.

    If you could give your email i can attached the actual expections as screenshots. so that you understand it really clear.

    Thank you

    arun

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      This thread helped out sooooooooooooo mcuh!! Thanks guys!!!

      <%
        DATA: columnDefinitions type TABLEVIEWCONTROLTAB,
                wa                type TABLEVIEWCONTROL.
      
                wa-COLUMNNAME          = 'RFCSYSID'.
                wa-TITLE               = 'System'.
                wa-SORT                = 'X'.
                APPEND wa TO columnDefinitions.
                CLEAR wa.
      
                wa-COLUMNNAME          = 'KERNRL'.
                wa-TITLE               = 'Kernel Level'.
                wa-SORT                = 'X'.
                APPEND wa TO columnDefinitions.
                CLEAR wa.
      %>
      
      <htmlb:tableView
                           id="dbtable"
                           width="100%"
                           footerVisible="false"
                           fillUpEmptyRows="false"
                           headerVisible="true"
                           headerText="<%=tmpText%>"
                           design="ALTERNATING"
                           sort="SERVER"
                           table="<%=dbtab%>"
                           filter="server"
                           columnDefinitions="<%= columnDefinitions %>" />
      
      

  • avatar image
    Former Member
    Aug 09, 2004 at 09:08 PM

    Hi Arun,

    How about we attack this from diffrent angle. If I were you, I select all possible fields required, in this case you have a 'static' internal table.

    So let say there are 1 2 3 4 5 6 columns

    and the user want to see only 2 4 5 and 3. You do a select for all the column (1-6), but you can define the column dynamically using iterator, so the user can only see the columns that s/he has selected (2 4 5 and 3). I believe this is what Brian said on the previous answer.

    As far as sorting and filter, I believe this can be done 'automatically' if you see SBSPEXT_TABLE application, you can see how this can be done.

    Honestly, I did not see the benefit of just retrieving the data (field) that is specified.. Maybe to reduce an overhead, but is 3-4 extra column will impact the performance that much? I doubt it.

    Regards,

    Iwan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2004 at 04:23 PM

    Points have been assigned to this Post

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      > Points have been assigned to this Post

      Your point?

      If you are referring to my posting of code, first I was saying thank you because the thread actually helped me as well. Plus since the thread is not marked "solved" I wanted to post a sample of code that worked.