ABAP:参数输入屏幕SELECTION-SCREEN中的事件(转贴)
在SAP开发中,有用户提出,在输入参数的屏幕中,根据用户的选择对某些输入框进行屏蔽,防止用户在不需要的地方输入参数。这需要用到SELECTION-SCREEN的事件。
http://www.cnblogs.com/zhumk/archive/2005/06/02/166773.html (转自这里)
下面的选择屏幕中,要求根据用户选择的单选按钮,对不同的参数输入栏进行控制,不允许用户输入。
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
为了方便单选按钮的控制,我们对输入控件进行了分组,使用MODIF ID name(name只能为3个字符以内),对这一组参数进行屏蔽或打开。在本例程中组名为sa/sb。
还需要注意,我们希望屏幕上的radiobutton能够触发事件,因此需要在第一个RadioButton上加上USER-COMMAND name的代码,它会触发屏幕标准的事件。
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
AT SELECTION-SCREEN OUTPUT .事件会被单选控件触发。
Screen的Group1是给用户编程使用的,在前面给控件编组以后,这里可以得到控件的组名称。
Group3是保留属性,通过跟踪,猜测它可能是控件的类型属性,对于TXT和OPU的控件,我们不需要改变它的INPUT属性,因此将它们排出在外。
详细可查看http://help.sap.com/saphelp_470/helpdata/EN/9f/dbab6f35c111d1829f0000e829fbfe/frameset.htm