‎2008 Feb 27 7:11 PM
Hi,
I have a select-option on selection screen. i need to validate both from and to values for this field. and also restrict user if he enters lower value in to with mesage " lower limit is greater than upper limit".
thanks.
‎2008 Feb 27 7:16 PM
You must use
REPORT zdummy_atg_2 message-id 000.
TABLES: SPFLI.
SELECTION-SCREEN BEGIN OF BLOCK TEST.
SELECT-OPTIONS:
S_CARRID FOR SPFLI-CARRID.
SELECTION-SCREEN END OF BLOCK TEST.
AT SELECTION-SCREEN.
READ TABLE S_CARRID INDEX 1.
IF S_CARRID-HIGH LT S_CARRID-LOW.
MESSAGE E000 WITH 'Error'.
ENDIF.
Greetings,
Blag.
‎2008 Feb 27 7:16 PM
You must use
REPORT zdummy_atg_2 message-id 000.
TABLES: SPFLI.
SELECTION-SCREEN BEGIN OF BLOCK TEST.
SELECT-OPTIONS:
S_CARRID FOR SPFLI-CARRID.
SELECTION-SCREEN END OF BLOCK TEST.
AT SELECTION-SCREEN.
READ TABLE S_CARRID INDEX 1.
IF S_CARRID-HIGH LT S_CARRID-LOW.
MESSAGE E000 WITH 'Error'.
ENDIF.
Greetings,
Blag.
‎2008 Feb 27 7:42 PM
‎2008 Feb 27 7:43 PM
Hi,
you need not to do a check for the later situation. Select options automatically checks for 'TO' value to be greater than 'FROM' value.
And the solution mentioned above will check only the first record in select-options. if you have multiple entries, you need to do
LOOP AT S_CARRID.
*Validations goes here
ENDLOOP.
Regards,
Nirmal
‎2008 Feb 27 7:46 PM
Hi,
To validate the Low and High Values, you need to check individiually if required.
LOOP AT S_CARRID.
IF S_CARRID-LOW <> C_VALID.
*Message goes here
ENDIF.
IF S_CARRID-HIGH <> C_VALID.
*Message goes here
ENDIF.
ENDLOOP.
Regards,
Nirmal
‎2008 Feb 27 7:48 PM
hi,
so in this case if i validate low and high values it is enough ?? and how to do for those two .
thanks.
‎2008 Feb 27 8:24 PM