Skip to Content
0
Former Member
Jun 07, 2009 at 12:05 PM

validation for GL account

49 Views

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.