on 05-30-2012 10:38 AM
Narasimha,
You can write like below: you can achieve this by using two methods GET_LEAD_SELECTION_INDEX and SET_LEAD_SELECTION_INDEX
Note: You should enable InitialLeadSelection to the node.
data: lv_count type i.
lv_count = lo_nd_node->get_element_count( ).
1. in Back Action.
data: lv_index type i.
**** lv_index = lo_nd_node->get_lead_selection_Index( ).
if lv_index = 1.
*** lo_nd_node->set_lead_selection_index( lv_count ). """ Sets last record.
else.
lv_index = lv_index - 1.
lo_nd_node->set_lead_selection_index( lv_index ). """" Sets previous record.
endif.
********* Now you can read the node and bind to form.
2. in Next Action.
**** lv_index = lo_nd_node->get_lead_selection_Index( ).
if lv_index = lv_count.
*** lo_nd_node->set_lead_selection_index( 1 ). """ Sets last record.
else.
lv_index = lv_index + 1.
lo_nd_node->set_lead_selection_index( lv_index ). """" Sets previous record.
endif.
***** Now you can read the node and bind to form.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi thanks you all.
CALL METHOD lo_nd_emp->get_static_attributes_table
IMPORTING table = lt_emp.
here LT_EMP has 3 records as mentioned above. i can able to fetch only 2records ;the last record is not fetching. the node is bind with the 2record bcoz LT_EMP has only 2record. How to get the 3 records into LT_EMP.
Thanks & regards,
Narasimha Rao Putturi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use the internal table which is used for populating table data.
Then make the SCREEN1.jpg fields bound to that node's attributes.
If you keep incrementing the count in NEXT button, you can achieve populating data as below.
data lv_value type pa0001-pernr.
CALL METHOD lo_nd_empdetails->get_attribute
EXPORTING
index = 3 "incremented index
name = 'PERNR'
IMPORTING
value = lv_value
.
* get element via lead selection
lo_el_empdetails = lo_nd_empdetails->get_element( ).
* @TODO handle not set lead selection
IF lo_el_empdetails IS NOT INITIAL.
* set single attribute
lo_el_empdetails->set_attribute(
name = `PERNR`
value = lv_value ).
ENDIF.
Hi , thank you for your quick reply.
I want to get the incremented index for each action( i.e; by pressing on NEXT button )
Pls. provide me the correct solution
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi narasimha,
That is initially.... Lead selection on first record.. ok...
when u clik next...
in program u write
get_LEAD_SELECTION_INDEX( ).
u get an index number then incremented by one and use
SET_LEAD_SELECTION_INDEX( ). method to lead select...
if click next again u will get lead selection index and it increments by one and setleadselection....
Regards,
Venkat
Hi narasimha,
by using lead selection u will get result like..
initialy put lead selection on first record .by using..
lo_nd_context->SET_LEAD_SELECTION_INDEX( ).
if u put the lead selection on first element then when u call get_attribute.( ) it automatically calls the first record..that lead selection record..
after click on next increment index......
like that u can do u r requirementr..
regards,
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
There can be many ways.
1. One way is to increment the index when Next button is pressed.
2. And then get the attributes using GET_ATTRIBUTE by passing the incremented index.
3. Make the display fields(Screen1.jpg) binded to the attribute value under the node.
4. Make sure you can make the read possible only till the no. of records.
data lv_value type pa0001-pernr.
CALL METHOD lo_nd_empdetails->get_attribute
EXPORTING
index = lv_index "Incremented index
name = 'PERNR' 'Attribute in the node
IMPORTING
value = lv_value
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
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.