包含TOP的查询条件:
SELECT-OPTIONS: p_bldat FOR ekbe-bldat . "凭证日期
包含FORM的代码:
RANGES: date_range FOR ekbe-bldat.
IF p_bldat[] IS INITIAL.
date_range-sign = 'I'.
date_range-option = 'BT'.
date_range-low = sy-datum - 1.
date_range-high = sy-datum.
APPEND date_range.
ELSE.
date_range = p_bldat.
APPEND date_range.
ENDIF.
SELECT ebeln,ebelp,gjahr,belnr,buzei,bldat,dmbtr
INTO TABLE @DATA(lt_ekbe)
FROM ekbe FOR ALL ENTRIES IN @lt_ekpo
WHERE ebeln = @lt_ekpo-ebeln
AND ebelp = @lt_ekpo-ebelp
AND bwart = '101'
AND bldat IN @date_range.
SORT lt_ekbe BY ebeln ASCENDING ebelp ASCENDING bldat DESCENDING.
标签:ebelp,界面,ekbe,range,查询,ABAP,lt,date,bldat
From: https://www.cnblogs.com/yddwinter/p/17350238.html