简体   繁体   English

仅接受选择屏幕参数中的特殊字符

[英]Accept only special characters in Selection Screen parameter

I have one input field of type C.我有一个 C 类型的输入字段。

PARAMETERS lv_sep TYPE c.

Field lv_sep should accept only special characters.字段 lv_sep 应仅接受特殊字符。

Can you help me how i can give this constraint?你能帮我怎么给这个约束吗?

you can do checks during AT-SELECTION-SCREEN.您可以在 AT-SELECTION-SCREEN 期间进行检查。 You could for instance check the parameter lv_sep for the characters you want to accept.例如,您可以检查参数 lv_sep 以获取要接受的字符。

AT-SELECTION-SCREEN.
if not lv_sep CO '!"§$%&/()=?'.
    message text-e01 type E.
endif.

Because I like to avoid NOT in IF statements when I can, I would propose this:因为我喜欢尽可能避免在 IF 语句中使用 NOT,所以我建议这样做:

AT-SELECTION-SCREEN.
IF lv_sep CN '!"§$%&/()=?'.
  MESSAGE text-e01 TYPE E.
ENDIF.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM