Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Specific Enter Event

Former Member
0 Kudos
152

Hello

I created a dynpro with some input-fields for my application.

I want to run a method each time the users hits the "ENTER"-Button and this runs fine,

but in relation to the input-field which the user has "selected" (the text-field which is focused) a different method should be called.

I don't know how I can check IF a field is focused and WHICH is focused?

Thank you for your answers.

1 ACCEPTED SOLUTION

former_member195402
Active Contributor
0 Kudos
130

Hi Robin,

in the flow logic of your module pool screen you can use

FIELD ... MODULE ON INPUT

and

FIELD ... MODULE ON REQUEST

in PAI for your issue. Maybe also a CHAIN ... ENDCHAIN will be useful.

Regards,

Klaus

4 REPLIES 4

former_member195402
Active Contributor
0 Kudos
131

Hi Robin,

in the flow logic of your module pool screen you can use

FIELD ... MODULE ON INPUT

and

FIELD ... MODULE ON REQUEST

in PAI for your issue. Maybe also a CHAIN ... ENDCHAIN will be useful.

Regards,

Klaus

0 Kudos
130

Thank you for your anwer. This is very close to the solution of my problem.

The problem of MODULE ON INPUT/OUTPUT is, that if an other field is selected by the user the code is executed anyway.

I want the to execute the code only if the input-field is "selected" like you can see in the picture for the field "Serialn."

0 Kudos
130

Hi,

you can use ABAP keyword GET CURSOR in an ABAP module or PERFORM to get the "selected" field.

If you are using

MODULE ON INPUT

in flow logic, first check in the module the right field. Or in a CHAIN:

PROCESS AFTER INPUT.


  CHAIN.

    MODULE GET_CURSOR.

    FIELD A MODULE DO_A ON INPUT.

    FIELD B MODULE DO_B ON INPUT.

  ENDCHAIN.

So you can find the "selected" field in module GET_CURSOR and check for it in modules DO_A and DO_B at the beginning.

Regards,

Klaus 

0 Kudos
130

Hi Klaus

Thank your for the answer, it works fine now!

Regards,

Robin