on 02-26-2014 4:38 AM
Hi All,
I have created a Tab strip UI element with several tabs and a table(Not ALV) in each tab using dynamic programming in WebDynpro.
Now i got a requirement to enable few rows for user modifications.
I have done this by creating cell variants for the columns that required to be edited by the users,which is working fine.
But the problem is for the columns which i have added the cell variants , the column header text is not displaying. For other columns the text is correctly displaying.
Please help me to solve the issue ?
Let me know if any details required.
Thanks,
Vamshi
Hi Vamshi,
The column header text should be picked from data element definition and it works fine irrespective of your cell variant.
I suspect, somewhere in your code, the header text is getting set.
Please make sure that header text of the column is not set by your code.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
Thanks for the replies,
Hi Rama,
Waited for your reply .
Below is the code where i am adding the cell variant to column and adding the caption.
Kindly help.
"New column
coli =
cl_wd_table_column=>new_table_column(
view = view
id = col_id
visible = CL_WD_UIELEMENT=>E_VISIBLE-VISIBLE ).
"creating text view
texti =
cl_wd_text_view=>new_text_view(
view = view
id = attr_id
visible = CL_WD_UIELEMENT=>E_VISIBLE-VISIBLE
bind_text = attr_path ).
"add cell variant and assign text view
cl_wd_table_standard_cell=>new_table_standard_cell( exporting variant_key = '01'
receiving control = cell1 ).
coli->add_cell_variant( the_cell_variant = cell1 ).
cell1->set_editor( texti ).
similarly i am also adding the input field to the column through variant with key '02'.
Now adding the caption .
"set the caption for the column
lo_caption =
cl_wd_caption=>new_caption(
view = im_view
image_first = 'X'
enabled = 'X'
visible = CL_WD_UIELEMENT=>E_VISIBLE-VISIBLE ).
coli->set_header( lo_caption ).
Thanks,
Vamshi
Hi Vamshi,
There is no need to set the table column header text manually, as your dynamic code is automatically created the captions required for the column's header text.
Please try the below code for cell variant,
DATA lv_col_name TYPE string.
DATA lo_col TYPE REF TO cl_wd_table_column.
DATA lo_input TYPE REF TO cl_wd_input_field.
DATA lo_variant TYPE REF TO cl_wd_table_standard_cell.
DATA lv_path TYPE string.
CONCATENATE wd_this->wdctx_test 'C1' INTO lv_col_name SEPARATED BY '_'.
lo_table->get_column(
EXPORTING
id = lv_col_name
* index = " INDEX
RECEIVING
the_column = lo_col
).
lo_input = cl_wd_input_field=>new_input_field(
bind_value = 'TEST.FIRST_NAME' " you can get th
id = 'DYN_INP'
).
"add cell variant and assign text view
cl_wd_table_standard_cell=>new_table_standard_cell(
EXPORTING variant_key = '01'
RECEIVING control = lo_variant ).
lo_variant->set_editor( the_editor = lo_input ).
lo_col->add_cell_variant( the_cell_variant = lo_variant ).
lo_col->set_selected_cell_variant( value = '01' ).
Hope this helps you.
Regards,
Rama
Hi Rama,
Thank you for your Valuable input. Yet another time your input helped me to solve the issue.
Though the code is same as mine, it helped me to understand the mistake i have done.
Actually, i have created two cell variants and attached the input field and text filed both to the cell variants, without attaching any UI element directly to the table column.
That is why, the caption is not automatically getting the text as no UI element and context element is linked to it.
Now the problem is solved.
Thanks,
Vamshi
Hi,
Now i got a requirement to enable few rows for user modifications.
You meant enable few rows for input? ( or any drop down ) . If it is for enabling input for users, you could simply assign the cell editor to input field UI instead of creating cell variants.
If it is for drop down or other UI, share the code snippet which you are using to assign cell variants.
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.