on 01-07-2013 4:00 PM
Hey guys,
my task is to use set_focus to switch to a specific row and column.
I had a look at the example from SAP SALV_WD_TEST_TABLE_FOCUS. Of course this works, but when i use this statements in my ALV nothing happens.
I even built the example in my ALV so i could use the same way for jumping to a special cell.
I'm really upset, because any idea i had, didn't work.
Perhaps one of you can help me with this?
My ALV contains different columns, like PSTYP, WERKS, LGORT, MENGE, MEINS, etc.
Perhaps i have to say, that the ALV is enabled for inputs. this really works fine.
but when i now try to use the example, nothing happens, although the debugger doesn't mention any problems.
I created a button and two input fields, of course with context binding.
Here's my code:
method ONACTIONSPRINGEN .
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_cpu_alv( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
lo_interfacecontroller = wd_this->wd_cpifc_cpu_alv( ).
DATA lo_nd_focus TYPE REF TO if_wd_context_node.
DATA lo_el_focus TYPE REF TO if_wd_context_element.
DATA ls_focus TYPE wd_this->element_focus.
* navigate from <CONTEXT> to <FOCUS> via lead selection
lo_nd_focus = wd_context->get_child_node( name = wd_this->wdctx_focus ).
* @TODO handle non existant child
* IF lo_nd_focus IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_focus = lo_nd_focus->get_element( ).
* @TODO handle not set lead selection
IF lo_el_focus IS INITIAL.
ENDIF.
* get all declared attributes
lo_el_focus->get_static_attributes(
IMPORTING
static_attributes = ls_focus ).
lo_interfacecontroller->set_focus(
column = ls_focus-column " string
index = ls_focus-index " i
).
endmethod.
Perhaps anyone had this problem too and can help me with that?
hoping for an answer,
regards
Mathias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amy,
first, thanks for the quick response.
i didn't know, that this only works with editable ALV, but fortunately my ALV is editable, because the user should fill the ALV and i want the webdyndpro to jump to the first position, where a mistake is found. For that reason i want to use the set focus method, but it doesn't work.
i'm going to try to make the editable alv editable again, perhaps this works but i don't think so.
Are there any other solutions? Should i perhaps add some more coding or any further informations that could help?
cheers,
Mathias
EDIT: i tried it now, but nothing changed. I think i will have a deeper look at the debugger and check if the index and the column are set or get lost.
Hi Mathias,
"I want the webdyndpro to jump to the first position, where a mistake is found."
If you have issued an error message as part of a standard action, the phase model stops its processing. Have you verified in debugging that the code to set focus is being executed?
Cheers,
Amy
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.