on 07-05-2012 7:07 AM
Hi Sir,
I have a scenario . Here, i m using dropdownbyindex UI element.
In first view i am displaying the educational details( infotype 0022 ) shown below
Once we select the perticular record, and click on change button...it takes to another view as below
Here, the field country key is fetching from the table T005T. So i want all values from that table but it should show the selected record value.
pls guide me
Thanks & regards,
Narasimha
Narasimha,
data: lv_index type i.
1. Select all countries and store in IT_COUNTRY
sort IT_COUNTRY by country ascending.
2. Loop at IT_COUNTRY into IS_COUNTRY where country = 'India'.
** do nothing.
Endloop.
3. lv_index = sy-tabix. """ This will contain the index of country "India"
4. Remember, you should bind these sorted list(IT_COUNTRY) to your DropDownByIndex node,
5. lo_nd_dropindx->set_lead_selection_index( index = lv_index ).
6. Now earlier selected country "India" will be shown by default after fetching data.
Test your end. hope understand, revert if any clarifications.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Chengalarayulu... I just followed the below steps
1. Collect all entries in to lt_country internal table.
2. Sort in ascending order.
3. once i click on change button,
CALL METHOD lo_nd_country->GET_STATIC_ATTRIBUTES_TABLE
IMPORTING
TABLE = lt_country
.
CALL METHOD lo_nd_country->GET_LEAD_SELECTION_INDEX
RECEIVING
INDEX = idx
.
READ TABLE lt_country into ls_country INDEX idx.
CALL METHOD lo_nd_country->SET_LEAD_SELECTION_INDEX
EXPORTING
INDEX = lv_index.
.
Now is working fine.
Thanks & regards,
Narasimha.
Hello Narasimha,
Can you explain your requirement in detail ??
Regards,
Gaur Mayank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gaur,
In my second view , displaying the selected record from the table shown as above.
Here ,the field COUNTRY KEY(Dropdownbyindex UI element) is displaying only selected record entry i.e;INDIA.
But i want all country list ( from T005T ) under the entry INDIA.
Did u understood my requirement.?
Thanks & regards,
Narasimha.
Dear Narasimha,
Create a node 'Country'.
Cardinallity 0.n.
create attribute 'Country_key'.
..
Then in your code( Second view init method.).
Copy and paste the following code
Data Ln_country type ref to if_wd_context_node.
Data lt_country type wd_this->elements_country.
ln_country = wd_context->get_child_node( name = 'COUNTRY' ).
select * from t005t into corresponding fileds of table lt_country.
ln_country->bind_table( lt_country ).
Now check whether all the countries are available in your drop down.
let me know if it is working.
Regards,
Gaur Mayank
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.