cancel
Showing results for 
Search instead for 
Did you mean: 

tableView MULTISELECT reading first record in tableview

Former Member
0 Kudos

OK, I know we've talked about this already, however I am having either a "dumb moment" or something is not right.

I do the following


data: srit TYPE INT4_TABLE.
data: table_event TYPE REF TO cl_htmlb_event_tableview.

table_event = table->data.
srit = table_event->PREVSELECTEDROWINDEXTABLE.
read table srit with key table_line = table_event->ROW_INDEX
TRANSPORTING NO FIELDS.

However it only shows the values for every line after the first record, I never get the first record from the table??? Anyone else have this problem?

I have 5 records in the table and even when I select all 5 I only have 4 in the srit table

Accepted Solutions (0)

Answers (2)

Answers (2)

steffen_knoeller
Explorer
0 Kudos

Hi Craig,

Try the following:


srit = table_event->GET_ROWS_SELECTED( includeCurrentSelectedRow = 'X' ).

Best wishes,

Steffen

Former Member
0 Kudos

Hi Steffen,

"The result type of the function method cannot be converted into the type of SRIT"

I have srit TYPE INT4_TABLE.

I did try changing the type to

data: srit TYPE SELECTEDROW.

But same error occurs as well as a few others with my code I had to change for testing

former_member181879
Active Contributor
0 Kudos

As usual, double click on method to see definition.

The method returns type SELECTEDROWS. Notice trailing S!


DATA: srit TYPE SELECTEDROW<b>S</b>.
FIELD-SYMBOLS: <srit> LIKE LINE OF srit.
srit = obj->GET_ROWS_SELECTED( INCLUDECURRENTSELECTEDROW = 'X' ).
LOOP AT srit ASSIGNING <srit>.
  ...here use <srit>...
ENDLOOP.

Former Member
0 Kudos

Thanks Brian, that helps with some code reduction.

We redesigned the BSP "alertinbox" (ok a copy of that one) to use a tableView and Multi select to "confirm" alerts.

Former Member
0 Kudos

        field-symbols <i> type i.
        append initial line to srit assigning <i>.
        <i> = table_event->ROW_INDEX.

Add that after


read table srit with key table_line = table_event->ROW_INDEXTRANSPORTING NO FIELDS.

And it takes care of the missing element.