on 10-17-2005 7:23 AM
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>
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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é
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.