cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown by index in ALV

Former Member
0 Kudos

Hi All,

I have a node to display my table details. This node contains another subnode which conatins the values for my dropdown. (Dropdown are disfferent for every row).

Now this works fine in a normal table where i create a droup down editor in the table group and bind the value to the value in the subnode.

But, i am not able to convert this to ALV. How do i bind my subnode values to alv dropdown?

Thanks for your help.

Regards,

Prisford Pereira.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Prisford Pereira,

Please go through the link below :

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0cbdde3-fe58-2c10-fcbc-8db18e693...

It will be helpful to fix  the issue!

Best Regards,

NKC

Answers (2)

Answers (2)

former_member184958
Active Participant
0 Kudos

Hi,

Go through the below,

method onactiond_index .

data: lo_nd_sflight
type ref to if_wd_context_node,
lo_el_sflight
type ref to if_wd_context_element,
"First node
lt_sflight
type           wd_this->elements_sflight,
ls_sflight
type           wd_this->element_sflight.

data:
"Final Node
lt_sflight1   
type       wd_this->elements_sflight1,
ls_sflight1   
type       wd_this->element_sflight1.

data:
"Drop_Down Node
lt_d_sflight
type         wd_this->elements_d_sflight,
ls_d_sflight
type         wd_this->element_d_sflight.

"Intex to find First and DD values
data: ld_tabix
type             sy-tabix,
ld_index
type             sy-index.

"If may set flag
data  lv_flg type               c.

"Get the First node values
*navigate from <CONTEXT> to <SFLIGHT> via lead selection
lo_nd_sflight = wd_context->get_child_node( name = wd_this->wdctx_sflight ).

*lo_el_sflight = lo_nd_sflight->get_element( ).
lo_nd_sflight->get_static_attributes_table(
IMPORTING table = lt_sflight ).

loop at lt_sflight into ls_sflight.

"Internal Table index
ld_tabix = ld_tabix +
1.

lo_nd_sflight = wd_context->get_child_node( name = wd_this->wdctx_sflight ).

lo_el_sflight = lo_nd_sflight->get_element( ld_tabix ).

"Drop_Down node
lo_nd_sflight = lo_el_sflight->get_child_node( name =
'D_SFLIGHT' ).
ld_index =    lo_nd_sflight->get_lead_selection_index( ).

* if ld_index = -2.   "Indicator for Empty Record
*      lv_flg = 'X'.
*      exit.
*    else.
"Get the selected value form the Drop_Down Values
CALL METHOD lo_nd_sflight->get_static_attributes
EXPORTING
index             = ld_index
IMPORTING
static_attributes = ls_d_sflight.


ls_sflight1-CARRID     =  ls_sflight-CARRID.
ls_sflight1-CONNID     =  ls_sflight-CONNID.
ls_sflight1-PRICE      =  ls_sflight-PRICE.
ls_sflight1-SEATSMAX_F =  ls_sflight-SEATSMAX_F.
ls_sflight1-SEATSOCC_F =  ls_sflight-SEATSOCC_F.
ls_sflight1-RATING     =  ls_d_sflight-RATING.
append  ls_sflight1 to lt_sflight1.

"Find the value to final Table
* navigate from <CONTEXT> to <SFLIGHT1> via lead selection
lo_nd_sflight = wd_context->get_child_node( name = wd_this->wdctx_sflight1 ).

lo_nd_sflight->bind_table( new_items = lt_sflight1 set_initial_elements = abap_true ).

*endif.
endloop.
endmethod.

Hope this will helpful to you.

Regards,

John.

Aswin
Explorer
0 Kudos

Hi Prisford Pereira,

Instead of creating sub node create an attribute of type WDR_CONTEXT_ATTR_VALUE_SET and fill your values to this attribute. With the reference of drop down UI element call method set_valueset_fieldname by passing attribute name.

Regards

Aswani