cancel
Showing results for 
Search instead for 
Did you mean: 

TableView with a Cell as TableView ? Possible ?

Former Member
0 Kudos

Hello out there,

i want to dipslay complex data on a bsp-page. The date is stored in a table. One collumn contains agian a small table. Is it possible to use a tableview to render the output ?

I used an iterator on my "outer"-tableview and in the method RENDER_CELL_START i tried the following coding, but there is nothing rendered on the bsp. Can anybody help ?

<i>CASE p_column_key.

WHEN 'RELATED_PARTNER'.

CALL METHOD ME->GET_CELL_VALUE

EXPORTING

IV_COLUMN_NAME = 'RELATED_PARTNER'

IV_ROW_REF = p_row_data_ref

IMPORTING

EV_CELL_VALUE = lt_table_data.

              • TEST BEGIN IF lt_table_data is INITIAL

IF lt_table_data IS INITIAL.

lwa_table_data-partner = '0060000505'.

APPEND lwa_table_data TO lt_table_data.

lwa_table_data-partner = '0060000509'.

APPEND lwa_table_data TO lt_table_data.

ENDIF.

              • TEST END

GET REFERENCE OF lt_table_data INTO lcr_table.

CREATE OBJECT lcr_table_view.

lcr_table_view->table = lcr_table.

lcr_table_view->fillupemptyrows = 'TRUE'.

lcr_table_view->headervisible = 'FALSE'.

lcr_table_view->footervisible = 'FALSE'.

lcr_table_view->visiblerowcount = 2.

p_replacement_bee = lcr_table_view.</i>

Accepted Solutions (1)

Accepted Solutions (1)

daniel_humberg
Contributor
0 Kudos

Hi André,

I don't know if you can place a tableView into a tableView cell. If not, you could just use a HTML table within a htmlb:textView (with code like this):


METHOD if_htmlb_tableview_iterator~render_cell_start .

  DATA lr_text TYPE REF TO cl_htmlb_textview.
  FIELD-SYMBOLS <fs> LIKE LINE OF lt_table_data.

  CASE p_column_key.
    WHEN 'RELATED PARTNER'.

      CREATE OBJECT lr_text.
      lr_text->id     = p_cell_id.
      lr_text->text   = '<TABLE>'.
      "read table lt_table_data.		

      LOOP AT lt_table_data ASSIGNING <fs>.
        CONCATENATE lr_text->text 
		    '<TR>'
		    '<TD>'
		    <fs>-first_field
		    '</TD>'
		    '</TR>'
	            '<TR>'
		    <fs>-second_field
		    '</TD>'
		    '</TR>'
		INTO lr_text->text.
      ENDLOOP.

      CONCATENATE lr_text->text
		  </TABLE>
		INTO lr_text->text.

      p_replacement_bee = lr_text.

  ENDCASE.

ENDMETHOD.

Former Member
0 Kudos

Hello Daniel,

thanks. Thats a fine workaround for that what i want to do...

But there are some nice function of the table view missing.

Best regards,

André

Former Member
0 Kudos

hi,

i have done the same you are trying. in mine case i have replaced a column name 'TEMP' by a tableview. i have used factory method of class CL_HTMLB_TABLEVIEW to get a BEE object to replace.

i have created a reference of internal table into tabletype and assigned it to table of factory method as:

when 'TEMP'.

p_replacement_bee = CL_HTMLB_TABLEVIEW=>FACTORY(

id = p_cell_id

table = EMP_ref

).

where:

emp_ref is type ref to TIHTTPNVP.

and emp is type TIHTTPNVP.

i have filled data in emp inside constructor.

and then created reference

GET REFERENCE OF emp INTO emp_ref.

prior to calling BEE replacement.

its working fine.

remember in factory methods we have to pass a reference of table type for TABLE.

hope this helps you,

Hemendra

maximilian_schaufler
Active Contributor
0 Kudos

Andre,

how could I overlook that ...

youre factory method is missing - thx to Hemendra I looked at the code and compared it to your snippet.

It's not enough to create the object and then assign some attributes, but you have to use the FACTORY method submitting the needed/desired parameters.

Besides that you should also think about upgrading your SPs - there has been a lot of change in the 40s SPs, so it is highly recommend to upgrade to the latest SP, especially when working with extensions.

Max

Former Member
0 Kudos

Hello Maximilian and Hemendra,

your tips works as i need it.

Thanks a lot for the fast help.

Kindly regards,

André

maximilian_schaufler
Active Contributor
0 Kudos

Hemendra,

just out of interest, what kind of data do you have in your "inner" tableview? What for do you use it in your application?

Answers (1)

Answers (1)

maximilian_schaufler
Active Contributor
0 Kudos

Hi Andre,

nice problem, something I have not thought of yet, placing a whole tableview into a single cell.

I don't know of any limitations that should prevent you from doing this (compared to other replacement_bees).

I would suggest that you debug into your iterator code, and watch the tableview object you create, if it gets created in the right way, and how the iterator continues to work with the p_replacement_bee containing the tableview afterwards.

What WebAS version/SP are you working on btw?

Max

Former Member
0 Kudos

Hi Maximilian,

we are running WebAS6.20 on ABA and Basis SP44.

I debugged the iterator and think that the tableview-object is well created, but what means that ? I don't know about the real minimum requeired fields in the object to have a well rendered output.

The steps which are executed after my method are hard to understand, but i think there is nothing be done with p_replacement_bee.

Kindly regards,

André