T-CODE: GS01/GS02/GS03
程序中获取信息集:ZFI002,并将获取的值存入RANGE变量中
表:setleaf
range变量:lra_blart
*&---------------------------------------------------------------------*
*& Report ZTEST
*&---------------------------------------------------------------------*
*& 获取信息集(ZFI002)维护内容
*&---------------------------------------------------------------------*
REPORT ztest.
CONSTANTS: gc_setname TYPE setleaf-setname VALUE 'ZFI002'.
DATA: lra_blart TYPE RANGE OF t003-blart.
SELECT *
INTO TABLE @DATA(lt_setleaf)
FROM setleaf
WHERE setname = @gc_setname
AND ( valfrom NE @space OR valto NE @space ).
LOOP AT lt_setleaf INTO DATA(ls_setleaf).
lra_blart = VALUE #( BASE lra_blart
( sign = ls_setleaf-valsign
option = ls_setleaf-valoption
low = ls_setleaf-valfrom
high = ls_setleaf-valto ) ).
ENDLOOP.
测试如下:
程序中使用lra_blart
SELECT
bukrs,
belnr,
gjahr,
blart,
cpudt,
cputm,
budat,
monat,
xref2_hd
INTO TABLE @DATA(lt_bkpf)
FROM bkpf
WHERE blart IN @lra_blart.
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/17897.html