cancel
Showing results for 
Search instead for 
Did you mean: 

Iterator for a table displayed in page with flow logic

Former Member
0 Kudos

Hi,

Can we use an iterator for table displayed in a page with flow logic.

If yes , please suggest how can that be implemented.

Regards

Arun

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HiArun,

Check this sample code. I hope you will get the solution by going through this sample...

if event->name = 'tableView' and event->event_type = 'rowSelection'.

data : data2 type ref to cl_htmlb_tableview.

DATA: tv_data TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.

data2 ?= cl_htmlb_manager=>get_data(

request = request

name = 'tableView'

id = 'tview' ).

clear tv_data.

if not data2 is initial.

tv_data = data2->data.

clear wa1.

read table it_mara3 into wa1 index tv_data->row_index.

if sy-subrc = 0.

      • You can have u r logic for the event here.

endif.

endif.

endif.

If there are any issues let me know.

Regards,

Azaz.

Former Member
0 Kudos

Hi azaz ,

Looking at the code i feel that it would be writted

onInputProcessing . But my exact requirement is that when the table is being displayed it self the coloumn must be colored .

Let us consider this case , assuming thet my internal table has Material Number , Material Description and Stock . The output required is such that for all materials where the stock is less than 100 units , that row must be coloured.

Thanks

Arun

Former Member
0 Kudos

Hi Arun,

We can use Table View Iterator in Page With Flow Logics also. We need to implement a Iterator class with Interface <b>IF_HTMLB_TABLEVIEW_ITERATOR</b> which will have the following methods:

IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS

IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_ROW_START

IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START

To make the color of a particular cell colored you can write your code in the method RENDER_CELL_START. You can search in the forum, you will get lot of threads related to this topic.

Refer to this thread, which could be useful to you.

Regards,

Ravikiran.

Answers (1)

Answers (1)

former_member191062
Active Contributor
0 Kudos

Hello,

please check the following example:

'SBSPEXT_TABLES' page: TableViewIterator.bsp

wich is avalaible in your system, it uses a tableview iterator, and it is a page with flow logic.

Regards,

Dezso

athavanraja
Active Contributor
0 Kudos

Apart from the sample application mentioned by Dezso also check out this following weblogs about how to use htmlb tableview iterators.

/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator

/people/thomas.jung3/blog/2004/09/15/bsp-150-a-developer146s-journal-part-xi--table-view-iterators

to color specific rows based on the value of certain cells.

do the following in the IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START method of your iterator.

define a class attribute instance/public type ref to the table type of your itab.

then in the method render_cell_start

<var> ?= p_row_data_ref.

FIELD-SYMBOLS: <fs> TYPE ANY ,

<l_field> TYPE ANY .

ASSIGN m_row_ref->* TO <fs>.

ASSIGN COMPONENT p_column_key OF STRUCTURE <fs> TO <l_field>.

if <l_field> = "somevalue"

p_style = 'cellDesign:GROUP_LEVEL2' .

Hope this is clear.

Regards

Raja

Former Member
0 Kudos

Hi ,

I was able to solve the problem by creating an iterator.

And assign value to P_STYLE in the method RENDER_CELL_START.

Thanks a lot for all the responses.

Regards

Arun

athavanraja
Active Contributor
0 Kudos

can you mark the thread as answered

Raja