cancel
Showing results for 
Search instead for 
Did you mean: 

DropDown by Key in WD_SALV

0 Kudos

Hey there,

I have an Application with an WD_SALV Grid. The Grid contains two Fields, which have a CELL_EDITO set to DROPDOWN_BY_KEY.

At WDDOINIT the first field is filled with main-categories. That's all fine. In order of the choosen value, the second field should have the right valueset for the secondary categorietypes for the main category.

I catch the Event "CHANGE" of the DD_BY_KEY and read the choosen Category. Then I select the secondary categories for the choosen one and bring it over the NODE_INFO-Reference with SET_ATTRIBUTE_VALUE_SET to the Node at the right field. All is fine an no Error comes up. But in the ALV the DD-Field is empty.

What is my mistake? Can anyone help me??

Best regards

Heiner Tiling

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member199125
Active Contributor
0 Kudos

why dont you write some code in ONSELECT action of first ddbk .

write code conditionally.....if first ddbk value is xxxx then one value set for second ddbk or if it is yyyy then another valuesset.

Regards

Srinivas

0 Kudos

First, I tried to do this. But nothing happend. It's the Event "CHANGE" of the ALV-Grid (SALV_WD_TABLE). I wrote my Code to a separate Method and called this Message from various other Methods. From WDDOMODIFY, from the Eventhandler for the CHANGE-Event and at WDAFTERACTION.

The effect I want to get, I did'nt get.

I think, that you can only put new valuesets at WDDOINIT to a node. Is that right?

Best regards

Heiner Tiling

former_member199125
Active Contributor
0 Kudos

You can write valuesets in any method..

Regards

Srinivas

0 Kudos

OK. Thanks for your quick answer!

Here is my code:

DATA: lr_nd_detail TYPE REF TO if_wd_context_node,

lr_nd_info TYPE REF TO if_wd_context_node_info.

DATA: lt_dd_value TYPE wdr_context_attr_value_list,

lt_kat TYPE /otto/mss_t_kat1tx,

lt_kat2 TYPE /otto/mss_t_kat2tx.

DATA: ls_dd_value TYPE wdr_context_attr_value,

ls_kat TYPE /otto/mss_kat1tx,

ls_kat2 TYPE /otto/mss_kat2tx.

  • Knoteninfo-Referenz

lr_nd_detail = wd_context->get_child_node( 'DETAIL' ).

lr_nd_info = lr_nd_detail->get_node_info( ).

  • Daten für Hauptkategorien lesen

SELECT * FROM /otto/mss_kat1tx INTO TABLE lt_kat

WHERE langu = sy-langu.

MOVE lt_kat TO wd_this->t_kat1.

LOOP AT lt_kat INTO ls_kat.

MOVE: ls_kat-id TO ls_dd_value-value,

ls_kat-text TO ls_dd_value-text.

APPEND ls_dd_value TO lt_dd_value.

ENDLOOP.

  • Werte in die Knoteninfo eintragen

lr_nd_info->set_attribute_value_set(

EXPORTING

name = 'KATEGORIE'

value_set = lt_dd_value ).

This I do at WDDOINIT. All is fine and the DropDown is filled!

At ON_CELL_ACTION of the ALV-Grid, I did the same for the second DD-Field, but the field is already empty. So where is my mistake?

Best regards

Heiner Tiling

former_member199125
Active Contributor
0 Kudos

Hi..

lr_nd_info->set_attribute_value_set(

EXPORTING

name = 'KATEGORIE'

value_set = lt_dd_value ).

In above statement KATEGORE is second dropdown attribute name?

Regards

Srinivas

0 Kudos

No. This is the code, which works. It's in WDDOINIT.

At ONCELLACTION I called a Method which has the same Code with EXPORTING name = 'KATEGORIE2', which is the Field of the second DD-Field.

former_member199125
Active Contributor
0 Kudos

It means ONCELL Action method is not triggering. You can test it by putting break point in onaction cell method.

Please check why its not triggering

Regards

Srinivas

0 Kudos

ONCELLACTION is triggered. My breakpoint is in the Method and I can see in the Debugger, that the selected Values are transported to the node attribute. But I can't see them in the Grid.

former_member199125
Active Contributor
0 Kudos

Its strange behavior.

Ur method is triggering... valueset binded to attribute.. Did you bind the same attribute at to table column?

Regards

Srinivas

sahai
Contributor
0 Kudos
0 Kudos

Thanks for your link. It doesn't match my problem.

You see, I filled my DropDownbox, so I know how to set it up. But the second fields values should be in order of what you select at the first. But my DD-Field is empty after setting the valueset to the node.

Any other tips??

Best regards

Heiner Tiling

sahai
Contributor
0 Kudos

HI,

Try Coding in WDDOMODIFYVIEW method.

regards,

sahai.S

0 Kudos

I tried it at WDDOMODIFY, but there was no effect.

Next Tip?

sahai
Contributor
0 Kudos

try using on_cell_action

for details follow the link below.

http://wiki.sdn.sap.com/wiki/display/WDABAP/HowtotriggertheeventON_CELL_ACTIONin+ALV

or

on_data_check

http://help.sap.com/saphelp_nw70/helpdata/en/c8/6c80dbedfe42d1a93f8e6df1d7244a/content.htm