Skip to Content
avatar image
Former Member

Table Cell Variant and Transparent container

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jul 09, 2011 at 06:52 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • avatar image
    Former Member
    Jul 12, 2011 at 10:58 AM

    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

    Add comment
    10|10000 characters needed characters exceeded