cancel
Showing results for 
Search instead for 
Did you mean: 

Possible for different drop down content in a table column?

Former Member
0 Kudos

Hi All,

We're using ECC6 701.

I have a table where one column contains drop down lists. The trouble is that each drop down should have a different subset of the data. So my question is how can I revise the subset of data based on the row it's on.

As it stands at the moment I have that column bound to another node in my context which is filled at run time. This node contains all possible values for the drop down column but depending on the row the drop down is on, it should only contain a subset of this data. Is this even possible? If so, how?

Many thanks in advance,

Liz.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

It is totally possible using value sets.

former_member199125
Active Contributor
0 Kudos

Yes, thats good idea to use value set, but how you are going to assign on row based condition?

Regards

Srinivas

Former Member
0 Kudos

HI Srinivas,

Each column has it's own values but these values are repeated on the rows. In other words, the column A in row 1, has the same values as column A in row 2.

Here is the code I used to achieve my goal:

data: lt_value_set type table of wdr_context_attr_value,

ls_value_set type wdr_context_attr_value.

data: lo_nd_reason_code type ref to if_wd_context_node,

lo_nodeinfo type ref to if_wd_context_node_info.

refresh lt_value_set.

clear ls_value_set.

append ls_value_set to lt_value_set.

loop at lt_zsd_reason_codes into wa_reason_code

where org_unit = wa_field_cat-org_unit

and field_no = wa_field_cat-field_no.

ls_value_set-value = wa_reason_code-reason_code.

concatenate wa_reason_code-reason_code wa_reason_code-long_desc into

ls_value_set-text separated by space.

append ls_value_set to lt_value_set.

clear ls_value_set.

endloop.

lo_nodeinfo->set_attribute_value_set( name = 'SUPPLY_CHAIN_CODE'

value_set = lt_value_set ).

'SUPPLY_CHAIN_CODE' is the name of the context element on the view, with the attribute selected_key bound to it.

Hope it helps,

Liz.

Former Member
0 Kudos

Hi Liz,

I am using ddbk in table, but displaying without dropdown i mean just no edit mode table.

here the code.. where is the problem pelase suggest

data: lt_value_set type table of wdr_context_attr_value,

ls_value_set type wdr_context_attr_value.

data: node type ref to if_wd_context_node,

node_info type ref to if_wd_context_node_info.

data : it_objid type STANDARD TABLE OF if_main=>element_portal,

wa_objid like line of it_objid.

SELECT OBJID FROM HRP5007

INTO TABLE it_objid

WHERE "PLVAR = '01' and

  • ENDDA = '99991231' and

TFORM = '0017'.

loop at it_objid into wa_objid.

ls_value_set-value = wa_objid.

append ls_value_set to lt_value_set.

endloop.

node_info = wd_context->get_node_info( ).

node_info = node_info->get_child_node( 'PORTAL2' ).

node_info->set_attribute_value_set( name = 'DEALER_CODE'

value_set = lt_value_set ).

Thanks,

Venkat.

Former Member
0 Kudos

Hi Venkat,

I'm not sure I follow what you're problem is. Could you be a bt clearer?

Regards,

Liz.

Former Member
0 Kudos

HI Liz,

You can use the event on_lead_select ie when you change the select in a table that event will be called and you can fill the dropdown as per your requirement.

Regards

Kuldeep

Former Member
0 Kudos

Hi Kuldeep,

Thank you for the response. The trouble with your suggestion is that the user would have to select the line first in order for the action to be fired. This won't happen, the user will just select the drop down arrow.

Any other ideas?

Thanks again,

Liz.

Former Member
0 Kudos

The way you described, supply function seems appropriate.

Create a node(DDBK) inside the (table) node which you binded for table UI.

Write a supply function for the DDBK node.

Bind this node (attribute ) to the dropdown.

When the Table is rendered, supply function would called for every table. You can control the table row data and based on that fill the ddbk node.