2

I have one input field of type C.

PARAMETERS lv_sep TYPE c.

Field lv_sep should accept only special characters.

Can you help me how i can give this constraint?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
  • In order to distinguish parameters from data values, one usually names parameters as p_* , so in this case it ought to be p_sep. Furthermore not mentioning length, because the default is one and not using a custom type is very old skool, and ought to be avoided. – tomdemuyt Feb 04 '13 at 01:23

2 Answers2

7

you can do checks during AT-SELECTION-SCREEN. You could for instance check the parameter lv_sep for the characters you want to accept.

AT-SELECTION-SCREEN.
if not lv_sep CO '!"§$%&/()=?'.
    message text-e01 type E.
endif.
Dirk Trilsbeek
  • 5,873
  • 2
  • 25
  • 23
2

Because I like to avoid NOT in IF statements when I can, I would propose this:

AT-SELECTION-SCREEN.
IF lv_sep CN '!"§$%&/()=?'.
  MESSAGE text-e01 TYPE E.
ENDIF.
tomdemuyt
  • 4,572
  • 2
  • 31
  • 60