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

document type validation

Former Member
0 Likes
567

hi all,

my requirement is the document number(BLART) in the selection screen should accept only kd,ka,kg,kc and space only other than that it should throw eeror.

3 REPLIES 3
Read only

Former Member
0 Likes
544

ranges: r_blart for blart.

r_blart-low = 'KD'

r_blart-sign = 'I'.

r_blart-option = 'EQ'.

append r_blart.

r_blart-low = 'KA'

r_blart-sign = 'I'.

r_blart-option = 'EQ'.

append r_blart.

r_blart-low = 'KC'

r_blart-sign = 'I'.

r_blart-option = 'EQ'.

append r_blart.

if not p_blart in r_blart.

message e001 with 'Error'.

endif.

Read only

Former Member
0 Likes
544

Hi,

You can do this at selection-screen event.



parameters : sp_blart like bsis-blart.
at selection-screen output.

if not sp_blart is initial.

if sp_blart = 'KD' or sp_blart = 'KA' sp_blart = 'KG' or sp_blart = 'KC' or sp_blart = ''.
if sy-subrc NE 0. 
message 'Document type not allowed' type 'E'.
endif.
endif.
endif.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
544

Try this:



AT SELECTION-SCREEN ON p_blart.

  IFp_blart NE 'KD' AND p_blart NE 'KG' AND p_blart NE 'KC' AND p_blart NE 'KA'
    MESSAGE e398(00) WITH text-001.
  ENDIF.

Thanks,

SKJ