cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro ABAP: Focus is not set in "Filter" Input field

Former Member
0 Kudos

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!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Ravi,

Thanks for your answer. I tried giving the ID as Filter value of the table column but doesn't works.

Regards.

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Dayana,

Could you check your code , like where did you write whether have you written inside the if condition of the Modify view or outside the if condition.

check  where have you writen ??

if first_time =  abap_true.

endif.

Regards,

Ravikiran.K

Former Member
0 Kudos

Hi Ravi,

Thanks for your answer. I wrote my code outside the if condition of the Modify view.

Regards.

Answers (1)

Answers (1)

former_member222068
Active Participant
0 Kudos

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

Former Member
0 Kudos

Hi Sankar,

Thanks for your answer, in that case, Do you know whether exist some SAP NOTE or Official document that talks about that? To show it to my boss.

Thanks a lot.

Regards.

former_member222068
Active Participant
0 Kudos

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