0
selection-screen begin of block b4 with frame title text-b04.
select-options: s_matkl for t023-matkl default 'Z310'.
selection-screen end of block b4.

我必须为材料组创建一个新的初始选择,并将其设置为具有排除垫组Z310Z320. 但是,在需要时,用户应该能够包括Z320

INITIALIZATION.
s_matkl-sign = 'E'.
s_matkl-option = 'EQ'.
s_matkl-high = 'Z310'.
s_matkl-low ='Z320'.
MODIFY s_matkl.

我试过上面它不起作用。关于如何做到这一点的任何建议?提前致谢!

4

2 回答 2

4

如果您使用的是较新版本,以下内容会更简洁:

DATA gv_matkl TYPE t023-matkl.
select-options: gt_matkl for gv_matkl.

INITIALIZATION.
 gt_matkl[] = VALUE #(
  ( sign = 'E' option = 'EQ' low = 'Z310' )
  ( sign = 'E' option = 'EQ' low = 'Z320' )
 ).
于 2018-07-05T15:26:32.977 回答
1

试试这个:

data g_matkl like t023-matkl.

selection-screen begin of block b1 with frame title text-b01.
select-options: s_matkl for g_matkl.
selection-screen end of block b1.

INITIALIZATION.
  s_matkl-sign = 'E'.
  s_matkl-option = 'EQ'.
  s_matkl-low = 'Z310'.
  APPEND s_matkl. " <----------- 'APPEND' instead of 'MODIFY'

  s_matkl-sign = 'E'.
  s_matkl-option = 'EQ'.
  s_matkl-low = 'Z320'.
  APPEND s_matkl. " <----------- 'APPEND' instead of 'MODIFY'

需要时,用户应修改 SELECT-OPTIONS。

希望能帮助到你

于 2018-07-04T16:26:01.190 回答