cancel
Showing results for 
Search instead for 
Did you mean: 

Drop down in a table not in ALV table but the normal table

Former Member
0 Kudos

Dear All,

My question is regarding the drop down in a table.

I am trying to put the drop down in a table and i am trying to fetch the data from the Data dictionary.

Since my table contains more than 3 records all the columns are fetched accordingly but the drop down column is not getting set as per the reords of the database.

When there is one record in the table then i am able to set the value of drop down as per the database and fill the drop down but when there are multiple records in the database all the values are set as same .

For eg my datbase consits of 2 records and 1st record consists of drop down value as ""open"" and my 2nd record as "Cancelled" then the two values are over written as ""Cancelled " "Cancelled".

To over come this situation suggest me with a solution .

Hope i am clear with my question.

Regards,

Sana.

Accepted Solutions (1)

Accepted Solutions (1)

raja_narayanan2
Active Participant
0 Kudos

hi...

to display list box you have to use...

DATA LS_VALUESET TYPE WDR_CONTEXT_ATTR_VALUE.

DATA LT_VALUESET TYPE WDR_CONTEXT_ATTR_VALUE_LIST.

so while you bind this values of table to your attribute ie.., LT_VALUESET will hold the values like OPEN, CLOSE....etc..

during runtime these values will display in the list box...

but if first record contains OPEN value and second record contains CLOSE value ...

that time you have read individual record from the internal table and assign it for the list box.

Say your DB records are Like this:

PJ292| Hyderabad| OPEN ( this is dropdown field )

PJ293| Indore| CLOSED

PJ293| Goa| WIP.

then Read the first record from the internal table and then ...

LOOP AT <internal table> INTO <workarea>. " internal table holds data base values

LS_VALUESET-VALUE = workarea-key.

LS_VALUESET-TEXT = workarea-text.

APPEND LS_VALUESET TO LT_VALUESET.

ENDLOOP.

now the LT_VALUEST will hold the values in it...

<NODE_INFO> ->SET_ATTRIBUTE_VALUE_SET(

EXPORTING

NAME = <YOUR ATTRIBUTE NAME>

VALUE_SET = LT_VALUESET ).

Then bind the values of your internal table to your node

<your node>->BIND_TABLE( <internal table> ). " not LT_VALUESET table.. its your internal table.

Answers (3)

Answers (3)

Former Member
0 Kudos

Dear ALL,

Thanks for the replies, my question was like this:

I have a table with few columns in it, and out of those columns I have column of type dropdown in it.

All the columns of the table ( including dropdown column ) are under a node, say, TABLE node.

I got the values from a DB table in to an internal table of type wd_this->elements_table ( here TABLE is my main node ).

I have binded this internal table to the UI element, i want to see the dropdown getting adjusted based on the value it possess.

Ex: my dropdown might be with values, OPEN, CLOSED, WIP.

Say my DB records are Like this:

PJ292| Hyderabad| OPEN ( this is dropdown field )

PJ293| Indore| CLOSED

PJ293| Goa| WIP.

When i display this table, the dropdown column for all these three records needs to be adjusted based on the value it has.

I hope it is clear now, and please suggest me something.

raja_narayanan2
Active Participant
0 Kudos

Hi......

I too got the same prblm like you but i solved it... here is the solution...

first i have used dropdownbykey list box for my scenario...

then in the wd_doint...

DATA LS_VALUESET TYPE WDR_CONTEXT_ATTR_VALUE.

DATA LT_VALUESET TYPE WDR_CONTEXT_ATTR_VALUE_LIST.

DATA LO_ND_INFO TYPE REF TO IF_WD_CONTEXT_NODE_INFO.

DATA LO_ND_ND_EDUCATION TYPE REF TO IF_WD_CONTEXT_NODE.

DATA LO_EL_ND_EDUCATION TYPE REF TO IF_WD_CONTEXT_ELEMENT.

  • navigate from <CONTEXT> to <ND_EDUCATION> via lead selection

LO_ND_ND_EDUCATION = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_ND_EDUCATION ).

  • get element via lead selection

LO_EL_ND_EDUCATION = LO_ND_ND_EDUCATION->GET_ELEMENT( ).

  • get element via lead selection

LO_ND_INFO = LO_ND_ND_EDUCATION->GET_NODE_INFO( ).

  • i have the values in lt_subty fetched from database.

LOOP AT LT_SUBTY INTO LS_SUBTY.

LS_VALUESET-VALUE = LS_SUBTY-SLART.

LS_VALUESET-TEXT = LS_SUBTY-STEXT.

APPEND LS_VALUESET TO LT_VALUESET.

ENDLOOP.

  • get all declared attributes

LO_ND_INFO->SET_ATTRIBUTE_VALUE_SET(

EXPORTING

NAME = 'SLART'

VALUE_SET = LT_VALUESET ).

Hope this will help you.....

if still dint come.... reply me....

Thanks & regards

Raja

Former Member
0 Kudos

Hi Misbah,

In Table column for dropdown add dropdown by key UI element. Then bind attribute for which domain values are maintained in dictionary. In attribute property select 'Automatic' for Input help mode.

Check WDR_TEST_TABLE, View COL_SCROLLING for example. It is having normal table with dropdown for one column.

Regards,

Karthick S