2009 Jun 07 1:05 PM
Hi all,
i am doing valodations for GL accouont. my requirement is to if the user enters the any GL account other then the range 0000100000 to 0000299999, it should through a Error message saying that Enter GL account in the range range 0000100000 to 0000299999.
i tried with the below code, but still not able to get the requirement.
SELECT-OPTIONS: s_saknr FOR skat-saknr .
AT SELECTION-SCREEN.
if not o_saknr-low is NOT INITIAL.
SELECT SINGLE * FROM skat WHERE saknr = o_saknr-low and
saknr in between '0000100000' and '0000299999'.
IF sy-subrc NE 0.
MESSAGE e001(00) WITH 'GL account in the range range 0000100000 to 0000299999'.
ENDIF.
ENDIF.
thanks
Nirmala
if not o_saknr-high is NOT INITIAL.
SELECT SINGLE * FROM skat WHERE saknr = o_saknr-low and
saknr in between '0000100000' and '0000299999'.
IF sy-subrc NE 0.
MESSAGE e001(00) WITH 'GL account in the range range 0000100000 to 0000299999'.
ENDIF.
ENDIF.
2009 Jun 07 1:13 PM
Hi,
Try this:
1) First loop at the select option and fill the data into a range.
2) Validate the values in range:
if r_range NOT between (0000100000' , '0000299999').
error message----
endif.
OR
if not o_saknr-low LT 0000100000' OR o_saknr-high GT '0000299999'.
error message---
endif.
Regards
Shiva
2009 Jun 07 1:13 PM
Hi,
Try this:
1) First loop at the select option and fill the data into a range.
2) Validate the values in range:
if r_range NOT between (0000100000' , '0000299999').
error message----
endif.
OR
if not o_saknr-low LT 0000100000' OR o_saknr-high GT '0000299999'.
error message---
endif.
Regards
Shiva
2009 Jun 07 1:26 PM
Hi,
i tried like following .. but still iam unable to get the error message.
AT SELECTION-SCREEN.
if not o_saknr-low is NOT INITIAL.
SELECT SINGLE * FROM skat WHERE saknr = o_saknr-low and
saknr >= '0000100000' or
saknr <= '0000299999'.
IF sy-subrc NE 0.
error message
ENDIF.
ENDIF.