我找到了这段代码,用于填写范围表here。
DATA lr_vkorg TYPE RANGE OF vkorg.
TYPES: lr_range_t TYPE RANGE OF vkorg.
lr_vkorg = VALUE lr_range_t(
LET s = 'I'
o = 'EQ'
IN sign = s
option = o
( low = '1100' )
( low = '1200' )
( low = '1300' )
( low = '1400' )
( low = '1500' )
).
但是不要做这样的事情:
( low = '1' )
( low = '2' )
...
我想用内部表['1', '2', ...]
的值填充它。
有谁知道如何做到这一点?
这是我根据答案进行的操作:
DATA:
lt_itab TYPE TABLE OF string,
lt_range_itab TYPE RANGE OF string
.
APPEND '1' TO lt_itab.
APPEND '2' TO lt_itab.
APPEND '3' TO lt_itab.
APPEND '4' TO lt_itab.
lt_range_itab = VALUE #(
FOR <ls_itab> IN lt_itab
( sign = 'I'
option = 'EQ'
low = <ls_itab> )
).
答案 0 :(得分:2)
lr_vkorg = VALUE # ( sign = 'I' option = 'EQ' ( low = '1100' ) ( low = '1200' )
( low = '1300' ) ( low = '1400' ) ( low = '1500' ) ).
答案 1 :(得分:1)
您可以像这样使用声明的结构声明宏:
each(function ($article) {
$article->category_id = KnowledgeBaseCategory::find($article->category_id)->name;
});
然后使用此单线填充范围:
DEFINE range.
lr_vkorg = VALUE lr_range_t( BASE lr_vkorg ( sign = 'I' option = 'EQ' low = &1 ) ).
END-OF-DEFINITION.
如果我们要谈论itab的填充范围,请使用以下语句:
range: '1100', '1200', '1300', '1400', '1500', '1600'.