标签:数据 等于 where sele 相关 pre time class pid
RANGE用法类似SELECT-OPTION,为带表头的内表,有OPTION、SIGN、LOW、HIGH四个字段值。
定义形式:DATA R_TIME TYPE RANGE OF ZTPUBLOG-LASTP WITH HEADER LINE
1.用法一:筛选以“3*”开头的相关数据。(OPTION = ‘CP’)
DATA R_WERKS_3 TYPE RANGE OF VBAP-WERKS WITH HEADER LINE. R_WERKS_3-SIGN = ‘I‘. R_WERKS_3-OPTION = ‘CP‘. R_WERKS_3-LOW = ‘3*‘. APPEND R_WERKS_3.
2.用法二:筛选值等于“CD01”~“CD07”的相关数据。(LOW值)
DATA R_WERKS_CD TYPE RANGE OF VBAP-WERKS WITH HEADER LINE。 R_WERKS_CD-SIGN = ‘I‘. R_WERKS_CD-OPTION = ‘EQ‘. R_WERKS_CD-LOW = ‘CD01‘. APPEND R_WERKS_CD. R_WERKS_CD-LOW = ‘CD02‘. APPEND R_WERKS_CD. R_WERKS_CD-LOW = ‘CD03‘. APPEND R_WERKS_CD. R_WERKS_CD-LOW = ‘CD04‘. APPEND R_WERKS_CD. R_WERKS_CD-LOW = ‘CD05‘. APPEND R_WERKS_CD. R_WERKS_CD-LOW = ‘CD06‘. APPEND R_WERKS_CD. R_WERKS_CD-LOW = ‘CD07‘. APPEND R_WERKS_CD.
3.用法三:筛选以时间为区间的相关数据。(OPTION = ‘BT’)
DATA R_WERKS_CD TYPE RANGE OF VBAP-WERKS WITH HEADER LINE. CONCATENATE SY-DATUM SY-UZEIT INTO LV_ETIME. R_TIME-SIGN = ‘I‘. R_TIME-OPTION = ‘BT‘. SELECT SINGLE LASTP FROM ZTPUBLOG INTO LV_STIME WHERE FEILBM EQ SY-REPID. IF SY-SUBRC EQ 0. R_TIME-LOW = LV_STIME. ELSE. LV_TIME = SY-UZEIT - 300. CONCATENATE SY-DATUM LV_TIME INTO LV_ETIME. R_TIME-LOW = LV_ETIME. ENDIF. R_TIME-HIGH = LV_ETIME. APPEND R_TIME.
标签:数据 等于 where sele 相关 pre time class pid
原文地址:https://www.cnblogs.com/ccyc/p/14102343.html