cancel
Showing results for 
Search instead for 
Did you mean: 

TableView + ALV functions ?

Former Member
0 Kudos

Hi everybody!

We would like to know how to implement a TableView in a BSP page, with the same functionnalities as ALV offers : totals, sub-totals, filters, sorts...

Thanks a lot in advance!

François

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi Francois,,

In a Tableview,you can use the tags FILTER,SORT for filtering and sorting.

You can see the applications SBSPEXT_HTMLB with page Tableview.

You can find help on the help.sap.com also

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/fd/003a3c00b96951e10000000a11405a/content.htm">http://help.sap.com/saphelp_nw04/helpdata/en/fd/003a3c00b96951e10000000a11405a/content.htm</a>

You can do calculations like totals in your internal table as required and then view as tableview.

There are numerous weblogs available,for doing advanced features at runtime like Brian's [url]https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/pub/wlg/213[ [original link is broken];/url]

Regards,

Siddhartha

Message was edited by: Siddhartha Jain

Former Member
0 Kudos

I checked the SBSPEXT_HTMLB, but didn't find the way to have a right wrapping.

We also implemented an iterator to test a dynamic sorting :

method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS .

DATA: test_column TYPE TABLEVIEWCONTROL.
test_column-COLUMNNAME = 'MENGE'.
test_column-TITLE = 'Quantité'.
test_column-SORT = 'X'.
APPEND test_column TO p_column_definitions.

endmethod.

But I don't know how to launch the method and where !

Sorry about it...

Anyway, I have another idea for those who would be interested in it : we have BW running on the same server, and I will use a web template on a query based on a specific ODS (table).

The BW web templates offer many powerfull features.

Thanks to everybody

François

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>But I don't know how to launch the method and where !

You don't have to. There is an interator attribute in the tableView. You just pass a reference to your iterator class to the tableView and it will call the methods when appropriate.

Former Member
0 Kudos

Hi Francois,

For sorting you can use the tag already provided in tableview.

For using iterator's,you don't have to launch anything,

Just write your tableview in layout


<htmlb:tableView id="tv1"
                       table="<%= flights %>"
                       iterator="<%= iterate %>"

                       visibleRowCount="10"
                       design="alternating"   >

here page attribute iterator is type ref to IF_HTMLB_TABLEVIEW_ITERATOR

In your onCreate you will instantiate the class for the tableview iterator as

create object iterate type zcl_sid_iterator.

You can get better insight by reading Brian's weblog i had given link to in my previous reply.

There are more weblogs on this like,<a href="/people/sap.user72/blog/2004/08/27/bsp-howto-tableview-iterator--column-header-graphics:///people/sap.user72/blog/2004/08/27/bsp-howto-tableview-iterator--column-header-graphics

hope this helps,

Regards,

Siddhartha

Former Member
0 Kudos

HI,

Pls don't forget to reward points if you find the answers useful.

Regards,

Siddhartha

Former Member
0 Kudos

Hi,

Of course I will grant you with the diserved points, don't be affraid

But I was playing around with the iterator, something was wrong : I forgot to declare the iterator instance as a parameter in the GET_TABLEVIEW_CONFIGURATION method of the application class.

Since it's okay.

Do the sorting functions used to work properly?

Best regards,

François

Former Member
0 Kudos

Hi Francois ,

"Do the sorting functions used to work properly?"

The SORT and FILTER both properties are still there and work fine as far as i know.

For sorting you just have to add the property sort = "server" in your tableview ,but if you want your application to handle it,then you give value to SORT as "APPLICATION" .

Similarly for Filtering you have to give the value for Property FILTER ,in the tableview tags.

Regards,

Siddhartha

Former Member
0 Kudos

Thanks Siddhartha!

It now works.

Regards

François

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Filters and Sorts are fairly easy. There are two attributes of the tableView SORT and FILTER that you set to the value of SERVER. Then the element will handle the rest. Of course if you want control, there are methods to code your own routines.

Totals and Sub-totals are another matter. You have to create those yourself. There are different approaches. I tend to calculate them in advance in my internal table in special rows (extra fields in the row definition). I then use a TableView Iterator to control the rendering and make the Total/sub-totals stand out - or all the user to turn them on and off. I'm afraid there isn't anything as automatic as what we have in the ALV grid.