cancel
Showing results for 
Search instead for 
Did you mean: 

How to place the cursor for a perticular field in webdynpro ?

former_member210804
Active Participant
0 Kudos

Hi sir,

I have two views named  'VIEW1' and 'VIEW2'.  Now i want to place the cursor for a field password in VIEW2 once we

navigate from VIEW1.

pls let me know how to process it.

Thanks & regards,

Narasimha Rao Putturi.

Accepted Solutions (1)

Accepted Solutions (1)

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Do the coding in modifyview.

WDDOMODIFYVIEW

DATA lo_element TYPE REF TO IF_WD_VIEW_ELEMENT.

if first_time eq abap_true.

* get element via lead selection
 
CALL METHOD view->get_element
   
EXPORTING
     
id      = 'PASSWORD1'
    receiving
      element = lo_element.
 
IF lo_element IS NOT INITIAL.
   
CALL METHOD view->request_focus_on_view_elem
     
EXPORTING
        view_element    = lo_element.
  ENDIF.
endif.

former_member210804
Active Participant
0 Kudos

in VIEW2, I wrote the same logic . but still not working.

please provide me solution for this.

Thanks & regards,

Narasimha Rao Putturi

Former Member
0 Kudos

Hi Narasimha,

There is no mistake with the code mentioned by Jayanthi it is working perfectly fine, I tried it myself and it is working perfectly fine .May be you could have mentioned wrong field name in the get_element.

Thx

Phani

I

chengalarayulu
Active Contributor
0 Kudos

Narasimha,

CALL METHOD view->get_element
   
EXPORTING
     
id      = 'PASSWORD1'
    receiving
      element = lo_element.

ID - should be UI element ID not context attribute name. which you can find in properties of password inputfield.

check once you tried the same or not.

former_member210804
Active Participant
0 Kudos

Hi Phani, I tried with context attribute name. Hence the output is not coming..

I changed to the UI element ID. Its working fine.

Thank you

former_member210804
Active Participant
0 Kudos

Hi Chengalarayulu D

Thank you sir. now it is working fine

Answers (0)