cancel
Showing results for 
Search instead for 
Did you mean: 

get Selected field on screen

Former Member
0 Kudos

Hi all ,

I need to get selected field on the screen.

is there any way?

Regards,

Shashank

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

The default way was correct .that is to make diffrent events for diffrent buttons.

Former Member
0 Kudos

Well as you all know there is a method that is to check all the values on the screen which is WDDOBEFOREACTION .

i planned to make a single event for every "enter" click on any field on dynpro and then track where the focus was so that i can validate it..

I knew there is an alternative way that is default which is to write different event for different fields and then use below code..

lo_api_controller = wd_this->wd_get_api( ).

lo_action = lo_api_controller->get_current_action( ).

if lo_action is bound.

case lo_action->name.

when 'FIELD1CLICK'.

when 'FIELD2CLICK'.

when 'FIELD3CLICK'.

ENDCASE.

I am thinking of closing this thread rather than striving for a solution..

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

First of all, I'm not sure that an OnEnter event is very efficient for every input field. That's a lot of server round trips - assuming the user even remembers to press the enter button. But a better way of doing this might be to use the Context Change Log. it will tell you only the values that have changed since the last event. This way you only validate what really needs to be validated.

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/a8e5d273b12fe2e10000000a42189d/frameset.htm

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/ae/eb56bd5dce494ebc89d55ebfc1fa96/frameset.htm

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I don't see any APIs that would return the focus. Only ones to set it. Here is some information on how the framework handles focus:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/c0/800f02bb734dd9977a64a8a7e87fe3/frameset.htm

What exactly are you trying to acomplish? If you have UI elements within an interation (Multipane, Table, etc) the leadSelection is generally used to determine the relative "focus".

Former Member
0 Kudos

YES..!

Former Member
0 Kudos

Hi,

I don't find any way to get the focus of UI element...There is a way to set the focus..(IF_WD_VIEW).

Let Thomas reply this.

Regards,

Lekha.

Former Member
0 Kudos

HI,

You mean to say the current cursor postion/focus of the UI element right.

Regards,

Lekha.