2008 May 11 12:23 PM
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.
2008 May 11 12:50 PM
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.
2008 May 11 12:50 PM
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.