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

Select-options validations

Former Member
0 Likes
706

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
657

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.

6 REPLIES 6
Read only

Former Member
0 Likes
658

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.

Read only

0 Likes
657

Hi,

Does this also validates low and high values ??

thanks.

Read only

Former Member
0 Likes
657

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

Read only

0 Likes
657

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

Read only

0 Likes
657

hi,

so in this case if i validate low and high values it is enough ?? and how to do for those two .

thanks.

Read only

0 Likes
657

Points awarded.

Thanks.