‎2006 Jun 25 3:54 AM
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.
‎2006 Jun 25 4:39 AM
‎2006 Jun 25 8:56 AM
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