on 02-06-2014 4:40 PM
Hi everybody,
I have a Web Dynpro Abap Application in SAP ECC 7.02 SP 9. It have a table with filter values. I'm trying to set the focus in "filter" inputfield into table, for that I'm using the method MY_RUNTIMEAPI->REQUEST_FOCUS, but doesn't work:
This is my code:
method HANDLEFROM_DETALLE_N .
data:
MY_CONTEXT_NODE type ref to IF_WD_CONTEXT_NODE,
MY_CONTEXT_ELEMENT type ref to IF_WD_CONTEXT_ELEMENT,
MY_RUNTIMEAPI type ref to IF_WD_VIEW_CONTROLLER,
l_action type ref to IF_WD_ACTION.
MY_CONTEXT_NODE = WD_CONTEXT->GET_CHILD_NODE( name = wd_this->WDCTX_FILTRO ).
MY_CONTEXT_ELEMENT = MY_CONTEXT_NODE->GET_ELEMENT( ).
MY_RUNTIMEAPI = WD_THIS->WD_GET_API( ).
MY_RUNTIMEAPI->REQUEST_FOCUS( exporting context_element = MY_CONTEXT_ELEMENT
attribute = 'MATNR').
endmethod.
This is what I have:
Context:
View: I want to set the focus (cursor) in the "filter" inputfield associated to article.
Please help me.
Greetings!
Hi Dayana,
Use this code.
data: lr_element type ref to if_wd_view_element.
CALL METHOD VIEW->GET_ELEMENT
EXPORTING
ID = 'TAB_DETALLE_MATNR' * id of the element in layout
RECEIVING
ELEMENT = lr_element
.
CALL METHOD VIEW->REQUEST_FOCUS_ON_VIEW_ELEM
EXPORTING
VIEW_ELEMENT = lr_element.
Regards,
Ravikiran.K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi thanks for your answer,
But, I did that you suggested me and still doesn't work. I think that the reason is that the input field in the table appear in runtime. I'm referencing to Column table ID and not to this inputfield.
I tested your code using the ID of another element in my layout and this works ok, but not in my case.
Another suggestion, please, I think that I need to reference to this inputfield in such case.
Please, help me.
Regards.
Hi Dayana,
Try giving the ID as Filter value of the table column ,ie. 'PRODUCTOS_INICIO.FILTRO.MATNR''
data: lr_element type ref to if_wd_view_element.
CALL METHOD VIEW->GET_ELEMENT
EXPORTING
ID = 'PRODUCTOS_INICIO.FILTRO.MATNR'
RECEIVING
ELEMENT = lr_element
.
CALL METHOD VIEW->REQUEST_FOCUS_ON_VIEW_ELEM
EXPORTING
VIEW_ELEMENT = lr_element.
Regards,
Ravikiran.K
Hi Ravi,
I have tested again your code inside WDDOMODIFYVIEW method of my View, and I could set the cursor in the "filter" column table. But, I don't know what is happening, because this occur when application come back to the View by second time.
Let me explain better, I have two Views, one of them "ViewFIRST" have the table that contain the "filter" table column, I wrote your code inside WDDOMODIFYVIEW method in this View. When I clicking in the row of the table, one action triggers a navigation to another View "ViewSECOND", when I comeback to "ViewFIRST" the cursor is not set but If I repeat the same step when I comeback to "ViewFIRST" the cursor is set to the "filter" table column.
I don't know what is the reason of this behavior. Please, do you have any idea about why this happen?
Please, help me.
Thanks a lot.
Regards.
Hi Dayana,
We cannot set focus in the input field of a table filter. I hope we dont have this functionality in WDA.
Thanks & Regards,
Sankar Gelivi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dayana,
You can just explain your boss, this is the functionality provided by SAP.
This link provides information of a Table properties
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/2d/390e422dfcde2ce10000000a1550b0/content.htm
Thanks & Regards,
Sankar Gelivi
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
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.