TABLES:vbak. DATA:S_VBELN TYPE RANGE OF VBAK-VBELN."相当于select-option:S_WERKS FOR MARD-WERKS DATA:S_ERDAT TYPE RANGE OF VBAK-ERDAT."相当于select-option:S_WERKS FOR MARD-ERDAT DATA:S_ERZET TYPE RANGE OF VBAK-ERZET."相当于select-option:S_WERKS FOR MARD-ERZET DATA:S_ERNAM TYPE RANGE OF VBAK-ERNAM."相当于select-option:S_WERKS FOR MARD-ERNAM S_VBELN = VALUE #( SIGN ='I' OPTION = 'BT' ( LOW = 50000000 HIGH = 60000000 ) ( LOW = 7000 HIGH = 8000 ) OPTION = 'NB' ( LOW = 9000 ) ).
”图1 DATA: LT_WHERE TYPE STRINGTAB. INSERT CONV #( 'VBELN IN @S_VBELN ' ) INTO TABLE LT_WHERE. INSERT CONV #( 'AND ERDAT IN @S_ERDAT ' ) INTO TABLE LT_WHERE. INSERT CONV #( 'AND ERZET IN @S_ERZET AND ERNAM IN @S_ERNAM' ) INTO TABLE LT_WHERE.
”图2 SELECT VBELN,ERDAT,ERZET,ERNAM FROM VBAK UP TO 10 ROWS INTO TABLE @DATA(LT_VBAK) WHERE (LT_WHERE) . cl_demo_output=>DISPLAY( LT_VBAK ).
”图3
图1如下:
图2如下:相当于代替了where后面的全部条件,注意要声明类型
图3如下: