cancel
Showing results for 
Search instead for 
Did you mean: 

Table Cell Variant and Transparent container

ged_hurst
Participant
0 Kudos

Hi there,

I've got a Table where for a few columns I defined cell variants.

It all works okay.

The thing is that in a particular cell in which I already inserted a DropDownByIndex I now need to insert a label as well, so two objects inside the same cell.

In fact the content of the cell changes, sometimes it refers to datatype X and other times to datatype Y and the user must know what the values displayed refer to.

How can I implement this?

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Did you try table column grouping? This way, you can have two columns under one header...

You can refer this help link for details [SAP Help|http://help.sap.com/saphelp_nw70/helpdata/en/b5/ac884118aa1709e10000000a155106/frameset.htm]

Search the page with columngroup for info...

Also, it is not possible to use a label as cell editor, instead you can use a text view...

Best regards,

Nadh

Former Member
0 Kudos

Hi

i am not getting exactly what you want? can you be more clear.

As per my understand.. you want two values in Dropdownindex. i mean X Y. you want to display like this?

Cheers,

Kris.

ged_hurst
Participant
0 Kudos

Well, I thought I made myself clear enough.

I want to display a TransparentContainer into a CellVariant because, that way, I can insert a label + DDBIndex.

Otherwise I can only insert a DDBIndex but then the end-user doesn't know what that refers to. In fact the column heading wouldn't be self explanatory since it would contain a description like "Cost Object" but the actual content of the cell could be a cost center, an internal order or something else. So a label within the cell is necessary.

Thank you for your input.

Former Member
0 Kudos

Hi,

Instead of Dropdown you can do this by using OVS help. You will get ID and TEXT like that.

Try that.

Cheers,

Kris.

saravanan_narayanan
Active Contributor
0 Kudos

i doubt whether you can achieve this. workaround would be to have a group column or two columns and display label in one column and value in another column (with cell variant).

If you find a straight forward solution for this usecase kindly share it with us.

BR, Saravanan

Former Member
0 Kudos

I usually solve this by using two columns - one with the "technical" drop-down value and another column next to it with a textView (not modifiable by the user) showing the related text or "non-technical" value - say, the plant name or whatever.

Then, based on the value the user selects in the first column, I set the value of the text column. This can be done as follows:

method onaction_plant .

data lo_nd_plants type ref to if_wd_context_node.

data lo_element type ref to if_wd_context_element.

data lv_selected_row type i.

data: lr_element type ref to if_wd_context_element.

lo_nd_plants = wd_context->get_child_node( name = wd_this->wdctx_plants ).

  • Find which line was clicked - this is not necessarily the same as the one which is "selected"

lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).

lv_selected_row = lr_element->get_index( ).

lo_element = lo_nd_plants->get_element( index = lv_selected_row ).

if not lo_element is initial.

me->set_plant_name( lo_element ). "This method retrieves the value for column number 2 and sets it

endif.

endmethod.

Regards,

Trond