on 04-19-2012 1:09 PM
Hello,
How can i set the focus on a cell which is an error? I have an alv output and users can add entries into it.IF there is error in one of the cells in the ALV then the save functionality should be stopped and the cell's which are error must be focusssed. I am able to stop from saving but not sure as to how to set the focus on that cell.
Please help.
Thanks,
Prem
Hi Prem,
It seems to very simple, as per my understanding you might be hitting a button after filling the ALV table. so, just in that button action read the context node which is bound to ALV Data node by using As table operation.
2. Loop that table
3. use get_element method like lo_element = lo_nd_<name>->get_element( index = sy-tabix ).
4. Validate your input field conditions..
5. use REPORT_ATTRIBUTE_ERROR_MESSAGE and provide the attribute name which takes error place.. and export lo_element as ELEMENT.
6. Execute and test.
Hope this would resolve your issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Kiran,
I tried the same code but there is no change. The fields are not getting highlighted.
Jana, do you have some example code for it? I searched it online and few posts reagrding set_focus but even then the alv field is not getting highlighted. I also found one another method report_attribute_error_message. Can we use this method as well for this case.
Thanks,
Prem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Did you tried interface method SET_FOCUS was introduced in the SALV_WD_TABLE WD ABAP ALV component. This allows you to set the focus to a particular cell in the ALV output. the focus can be set to a line.
Regards,
Jana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
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.