Application Development 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: 

Restrict number of entries in Select-Options

Former Member
0 Kudos

Hi,

I would like to restrict the number entries in select options. Lets say I have select options field defined for GL and I want only 10 GLs to be entered on Select-Options. If more than 10 Gls then it should give message that GL count is exceeding its Limit.

Please may I know how I can do this ?

Thanks for you help.

5 REPLIES 5

yogendra_bhaskar
Contributor
0 Kudos

Hi ,

Check at event : AT SELECTION-SCREEN OUTPUT.

Regards

Yogendra Bhaskar

Santosh_PSN
Participant
0 Kudos

Hi,

Please use event AT SELECTION-SCREEN ON <FIELD>.

so that you can display message instantaneously on screen.

Regards,

Santoshp

Former Member
0 Kudos

Hi,

You can do that using FM   SELECT_OPTIONS_RESTRICT

Regards,

Vamsi

0 Kudos

Try this if you want to restrict rows in s_matnr for example.


At selection screen.

data: line type i.

describe table s_matnr lines line.

if line > 10.

   Message 'Error' Type 'E'.

endif.

or else if you want only 10 Materials to be selected then try this.

At selection-screen.

if s_matnr-high - s_matnr-low > 10.

    Message 'Error' type 'E'.

endif.

Regards,

Vamsi

Former Member
0 Kudos

Hi,

If your requirement is to only allow selecting up to 10 GL accounts, then you'll have to do something like:

SELECT COUNT( * ) FROM SKA1 INTO lv_count WHERE SAKNR IN (select-options)
.

IF lv_count > 10.

  MESSAGE E.......

ENDIF.

Put this in an AT SELECTION-SCREEN event.

Jim