on 09-17-2015 9:19 AM
Hi Experts,
I've got a strange problem. I have two programs with almost identical code - one works fine and one gets dump. Those programs show ALV tables, I can choose some positions (by checking checkbox (XMARK field in structure) and then go to the other screen and do some stuff. I have this dump after I press "Back" button from the second screen and go back to the ALV table. Here's the code:
This code works fine every time:
lr_nd_context = wd_context->get_child_node( name = `LT_DATA`).
lr_nd_context->bind_table( wd_this->gt_data ).
DATA lo_el_res TYPE REF TO if_wd_context_element.
FIELD-SYMBOLS <data> LIKE LINE OF wd_this->gt_data.
LOOP AT wd_this->gt_data ASSIGNING <data> WHERE cell_design = cl_wd_table_column=>e_cell_design-subtotal.
lo_el_res = lr_nd_context->get_element( INDEX = sy-tabix ).
lo_el_res->set_attribute_property(
attribute_name = `XMARK`
PROPERTY = 3 " Property 3 - Read Only
VALUE = 'X' ).
ENDLOOP.
lr_nd_context is not initial, in loop lo_el_res is also not initial
And this code gets dump:
lr_ot = wd_context->get_child_node( name = `GT_RESULTS`).
lr_ot->bind_table( lt_dane ).
DATA lo_el_res TYPE REF TO if_wd_context_element.
LOOP AT lt_dane ASSIGNING <res> WHERE cell_design = cl_wd_table_column=>e_cell_design-subtotal.
lo_el_res = lr_ot->get_element( index = sy-tabix ).
lo_el_res->set_attribute_property(
attribute_name = `XMARK`
property = 3 " Property 3 - Read Only
value = 'X' ).
ENDLOOP.
lr_ot is not initial, however lo_el_res IS initial after get_element( ) method.
Did anyone face that problem or knows possible solutions?
I'll be grateful for all answers
Bartłomiej
Problem solved.
Solution: pass sy-tabix to some variable, e.g. lv_index, then use it in get_element method:
GET_ELEMENT( INDEX = lv_index)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the second case, did you check if lt_dane has a line in the sy-tabix position? If someone copied the code from the original one, maybe there is something missing in the MODIFYVIEW method.
What is the dump message?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.