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

Former Member
0 Likes
953

hi all,

in my report i have a select option of GL ACCOUNT.

I need to restrict the GL Account range from 5000 to 100000.

if account is outside the range then i need to get a error message like enter with in the range 5000 to 10000.

please help me how to write code for restrict the account from 5000 to 10000 and code for to get message.

thanks in advance

10 REPLIES 10
Read only

Former Member
0 Likes
923

hi,

put the conditon like this.

if s_glac-low > '5000' AND

s_glac-high < 100000.

message 'error'.

else.

your code***********.

endif.

Regards

Sandeep Reddy

Edited by: Sandeep Reddy on Jun 18, 2008 3:07 PM

Read only

Former Member
0 Likes
923

do like this..

add this in the initialization.

s_field-low = '5000'.

s_feild-sign = 'E'.

s_field-option = 'BT'.

s_field-high = '10000'.

append s_field.

Read only

Former Member
0 Likes
923

Hi ,

Check in the code whether your select option values are inside the range . IF not show the error message .

For this you can write :

loop at s_gl.

if s_gl-low LT 5000 OR GT 10000

Show message .

else.

Continue.

endloop.

Read only

sachin_mathapati
Contributor
0 Likes
923

Hi Sai,

At selection screen event check if so_glaccount-low is less than 5000 and so_glaccount-high is greater than 10000 , if yes raise the required error message.

AT SELECTION-SCREEN.

If gl_account-low le 5000 and gl_account-high >10000.

MESSAGE 'enter with in the range 5000 to 10000'.

ENDIF.

Regards,

Sachin M M

Read only

Former Member
0 Likes
923

hi

u can do this funtionality in AT SELCTION-SCREEN OUTPUT

Check the value of selectoption HIGH AND LOW in this event and display an message

PLZ REWARD POINTS

Cheers

Snehi

Read only

Former Member
0 Likes
923

if s_glact-low < '5000' or

s_glact-high > '100000' or

message e000 with 'error'.

endif.

Read only

Former Member
0 Likes
923

hi,

there are several cases while validating this.

I hope the below logic works in all the cases

Loop at s_account.

IF s_account-low < '5000' or s_account-low > '100000'

or s-account-high > '100000'.

  • message error.

endif.

endloop.

Read only

Former Member
0 Likes
923

Hi Latha,

Everytime you create a Select-Option (eg SO_SAKNR) an internal table is created with coloumns:

sign

option

low

high

where sign represents I/E which means Including or Excluding

Option may be EQ/LT/GT/NE/BT...... which represents EQual to/ LessThan/ Greater Than/ NotEqual/BeTween.....

low is for low range

high for higher limit/range

So in your report in event

AT SELECTION-SCREEN

*looping is required in case you have not used NO EXTENSION *option in ur selectop

loop at so_saknr.

if SO_SAKNR-LOW LT 5000 or SO_SAKNR-HIGH GT 100000.

*This will check whether user is entering a single field or range

if so_saknr-option eq 'BT'

    • message appropriate error message

endif.

endif.

endloop.

this was for your guidance the exact code can be build based on your actual scenario.

Thanks,

Saurabh

Read only

Former Member
0 Likes
923

write the logic of this sudo logic in

at selection-screen.

select all gl account from gl master where glaccount in s_gl_accont.

loop through g/l table.

if g/l account < 5000

or g/l account > 10000.

message e208(00) with 'enter in 5000-100000 range only'.

endloop.

Read only

Former Member
0 Likes
923

Hi,

at selection-screen.

if s_glaccount-low lt 5000 and s_glaccount-high gt 10000.

message text-001 type 'e'.

endif.

Hope it helps u.

Regards

Manjari.