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

selection-screen condition

Former Member
0 Likes
432

Hi,

I am working with a report. This report has 13 selection criterias(13 select-options) out of which one is fixed with 'sy-datum'.

My requirement is user must enter atleast one selection criteria other than the 'sy-datum' select-option i.e., there should be atleast two inputs. Otherwise, a message should be returned saying 'Selection criteria not enough'

Thanks.

2 REPLIES 2
Read only

ferry_lianto
Active Contributor
0 Likes
386

Hi Raju,

You can use this FM SELECT_OPTIONS_RESTRICT or RS_INT_SELOPT_RESTRICT.

Please check this thread for sample code.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
386

Hi

Try something like this:

DATA: COUNT_SO TYPE I.

SELECT-OPTIONS: SO_BUKRS FOR BKPF-BUKRS,

SO_GJAHR FOR BKPF-GJAHR,

SO_BELNR FOR BKPF-BELNR,

SO_BUDAT FOR BKPF-BUDAT,

SO_BLDAT FOR BKPF-BLDAT.

AT SELECTION-SCREEN.

COUNT_SO = 0.

PERFORM CHECK_SO USING: SO_BUKRS[],

SO_GJAHR[],

SO_BELNR[],

SO_BUDAT[],

SO_BLDAT[].

IF COUNT_SO < 2.

MESSAGE E208(00) WITH 'Selection criteria not enough'.

ENDIF.

&----


*& Form CHECK_SO

&----


  • text

----


  • -->P_SO text

----


FORM CHECK_SO USING P_SO.

FIELD-SYMBOLS: <SO> TYPE TABLE.

ASSIGN P_SO TO <SO>.

CHECK SY-SUBRC = 0.

DESCRIBE TABLE <SO> LINES SY-TABIX.

IF SY-TABIX > 0.

COUNT_SO = COUNT_SO + 1.

ENDIF.

ENDFORM. " CHECK_SO

Max