04-30-2015 11:32 AM
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.
04-30-2015 12:06 PM
Hi ,
Check at event : AT SELECTION-SCREEN OUTPUT.
Regards
Yogendra Bhaskar
04-30-2015 12:14 PM
Hi,
Please use event AT SELECTION-SCREEN ON <FIELD>.
so that you can display message instantaneously on screen.
Regards,
Santoshp
04-30-2015 12:30 PM
04-30-2015 1:05 PM
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
04-30-2015 1:37 PM
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