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

set cursor in screen field

Former Member
0 Likes
1,529

Hi All,

I have created a screen, as there is date field in the screen, I have kept a validation in the screen that if future date is entered it should trigger an error and the cursor should position in to that field. the code is a below

DATA dt TYPE i.

DATA pos TYPE i.

dt = yorderb-zproposed_date - sy-datum.

IF dt > 0.

SET CURSOR FIELD 'YORDERB-ZPROPOSED_DATE' OFFSET 0.

set PF-STATUS 'ZYORDERB'.

MESSAGE e005(zmsg) WITH 'Future Date ' yorderb-zproposed_date 'is not allowed'.

ENDIF.

but the cursor is positioning into date field.

Please help me

Thanks in Advance.

1 ACCEPTED SOLUTION
Read only

vinod_vemuru2
Active Contributor
0 Likes
418

Hi Ranjith,

Can u be more clear about ur question. U told u need to put the cursor in date field if date entered is more than current date.

That is what happening now right? Then what is the problem?

Alo for checking future date no need of another variable. U can directly Check like below.

DATA dt TYPE i.

dt = yorderb-zproposed_date - sy-datum.

IF dt > 0.

IF yorderb-zproposed_date GT sy-datum.

SET CURSOR FIELD 'YORDERB-ZPROPOSED_DATE' OFFSET 0.

set PF-STATUS 'ZYORDERB'.

MESSAGE e005(zmsg) WITH 'Future Date ' yorderb-zproposed_date 'is not allowed'.

ENDIF

Thanks,

Vinod.

Hi All,

I have created a screen, as there is date field in the screen, I have kept a validation in the screen that if future date is entered it should trigger an error and the cursor should position in to that field. the code is a below

DATA dt TYPE i.

DATA pos TYPE i.

dt = yorderb-zproposed_date - sy-datum.

IF dt > 0.

SET CURSOR FIELD 'YORDERB-ZPROPOSED_DATE' OFFSET 0.

set PF-STATUS 'ZYORDERB'.

MESSAGE e005(zmsg) WITH 'Future Date ' yorderb-zproposed_date 'is not allowed'.

ENDIF.

but the cursor is positioning into date field.

Please help me

Thanks in Advance.

1 REPLY 1
Read only

vinod_vemuru2
Active Contributor
0 Likes
419

Hi Ranjith,

Can u be more clear about ur question. U told u need to put the cursor in date field if date entered is more than current date.

That is what happening now right? Then what is the problem?

Alo for checking future date no need of another variable. U can directly Check like below.

DATA dt TYPE i.

dt = yorderb-zproposed_date - sy-datum.

IF dt > 0.

IF yorderb-zproposed_date GT sy-datum.

SET CURSOR FIELD 'YORDERB-ZPROPOSED_DATE' OFFSET 0.

set PF-STATUS 'ZYORDERB'.

MESSAGE e005(zmsg) WITH 'Future Date ' yorderb-zproposed_date 'is not allowed'.

ENDIF

Thanks,

Vinod.