on 06-24-2008 12:17 PM
Hi Gurus,
I create one Drop Down by Index.
Field with Material Description.
For that I hav Created Context Node Material Description with Cardinality 0..n
My Drop Down is Perfectly Ok
Now I want One Material to Be Default.
Suggest me How to do it !!
Thanks & Regards
PK
Hi PK,
Can you try like this within WDDOINIT( ) Method,
DATA lo_nd_material TYPE REF TO if_wd_context_node.
DATA lo_el_material TYPE REF TO if_wd_context_element.
DATA ls_material TYPE wd_this->element_material.
DATA lt_material TYPE wd_this->elements_material.
navigate from <CONTEXT> to <MATERIAL> via lead selection
lo_nd_material = wd_context->get_child_node( name = wd_this->wdctx_material ).
get element via lead selection
lo_el_material = lo_nd_material->get_element( ).
SELECT maktx FROM makt INTO TABLE lt_material UP TO 10 ROWS.
IF sy-subrc EQ 0.
lo_nd_material->bind_table( lt_material ).
ENDIF.
Thanks and Regards,
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can u try this once,
We can use set_lead_selection_index Method and Pass the index value based up on which default value you want display.
DATA lo_nd_material TYPE REF TO if_wd_context_node.
DATA lo_el_material TYPE REF TO if_wd_context_element.
DATA ls_material TYPE wd_this->element_material.
DATA lt_material TYPE wd_this->elements_material.
navigate from <CONTEXT> to <MATERIAL> via lead selection
lo_nd_material = wd_context->get_child_node( name = wd_this->wdctx_material ).
get element via lead selection
lo_el_material = lo_nd_material->get_element( ).
SELECT maktx FROM makt INTO TABLE lt_material UP TO 10 ROWS.
IF sy-subrc EQ 0.
lo_nd_material->bind_table( lt_material ).
CALL METHOD lo_nd_material->set_lead_selection_index
EXPORTING
index = 4.
ENDIF.
Thanks and Regards,
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks For Immidiate response.
I hav already done with this and its running successfully !!!
By this I will get first 10 Material in my Drop Down
And By this The Material on FIrst line of Internal Table will be reflected as Default or When i come to that view as first Material in Drop Down.
But now I want a perticular Material say "000000001" to be display as default or when i visit a Screen on drop down this material shuld be displayed.
This is my problem i m not able to set drop down to default one !!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.