Application Development and Automation 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: 
Read only

Problem reading text in fields without press ENTER

Former Member
0 Likes
1,898

Hi everybody.

I'm doing a program where by pressing the enter key I change to another screen, but when I do it the values on fields are not read, the are only read after I press the ENTER key without passing to another screen, because in SAP by pressing the enter we do the validation on fields.

I would like to know if there is any possibility of simulating the ENTER pressing for field validation or if I can force the ENTER key to be executed before changing the screen.

Regards

EJVC

4 REPLIES 4
Read only

Former Member
0 Likes
970

Hi,

Try using FIELD .. MODULE CHECK_DATA..

This should capture the data as well as you do the validations in the module CHECK_DATA..

Thanks,

Naren

Read only

Former Member
0 Likes
970

Hi,

How are you leaving to the subsequent screen? are you handling ENTER as an exit command or in the normal PAI code (or is your dynpro's next screen parameter set to the subsequent screen)?

Your screen field values should always be copied to the program fields by the time you reach your PAI module so if you treat enter as a normal ok code and do a "leave to screen" in your PAI your values would be stored and all your field checks executed (Keep in mind the screen fields are stored to your program variables in the order that your FIELD CHECK modules are specified, they should be before your PAI anyway though).

Cheers

De Wildt

Read only

0 Likes
970

Thanks for the given help but I'm not getting it Wright. I presume the module check is to check the data in the field, but the data is only considered to be written after I press ENTER without passing to next screen. Is there any way to force the field to be read without pressing ENTER.

Best Regards

Read only

Former Member
0 Likes
970

Hi,

If you mean that you would like to read the field value without executing a PAI there is no way to do this. The values from the screen are read into your program as soon as any function code (i.e. button click on the screen or application toolbar, enter pressed, any okcode) is selected. Where have you written the code that leaves to the next screen and where do you want to access the screen field values?

De Wildt