WITHNON-UNIQUESORTEDKEYcarr_cityCOMPONENTScarrid,lt_lhTYPETABLEOFspfli.SELECT*INTOTABLElt_spfliFROMspfli."data(lt) = FILTER #( lt_spfli using key carrid where carrid = '1' ).lt_lh=FILTER#(lt_spfliusingkeycarr_citywherecarrid=conv#('LH')).BREAK-POINT.filter 之前:filter 之后:第二个...
1, 可以不指定KEY,但只能指定 NON-UNIQUEKEY 2, 可以使用INDEX和KEY来查询 注:NON-UNIQUE KEY代表内表里该字段可以重复,如果是UNIQUE KEY则代表该字段不能重复,不然程序会发生运行时错误。 举例:DATA IT_YM TYPE STANDARD TABLE OF VBAP WITH NON-UNIQUE KEY VBELN. SORTED TABLE是排序表,特点如下: 1, 必...
1, 必须指定KEY(作为排序参考字段),可以指定UNIQUE KEY或者是NON-UNIQUE KEY 2, 可以使用INDEX和KEY来查询 3, 已经按照KEY排序,不可以再排序 举例:DATA IT_YM TYPE SORTED TABLE OF VBAP WITH NON-UNIQUE KEY VBELN. 在记录条数多时,SORTED TABLE查询效率明显比STANDARD TABLE高,因为对已经排序的表可以进行二...
filter 之前: filter 之后: 第二个例子: reportz.TYPES:BEGINOFty_person,nametypestring,agetypeint4,endofty_person.data:lt_persontypeSTANDARDTABLEOFty_personwithNON-UNIQUESORTEDKEYperson_keyCOMPONENTSage,lt_old1likelt_person,lt_old2likelt_person,ls_persontypety_person.ls_person-name='Tom'.ls_pe...
WITH NON-UNIQUE SORTED KEY second_key COMPONENTS b c. aa = VALUE #( ( a = 11 b = 32 c = 13 ) ( a = 21 b = 22 c = 23 ) ( a = 31 b = 42 c = 33 ) ). *wa = it2[ 1 ]. wa = aa[ KEY second_key INDEX 1 ]. ...
WITH NON-UNIQUE SORTED KEY cities COMPONENTS cityfrom cityto. ENDCLASS. CLASS demo IMPLEMENTATION. METHOD main. DATA idx TYPE TABLE OF i. idx = VALUE #( ( line_index( flight_tab[ carrid = 'UA' connid = '0941' ##primkey[id] ] ) ) ...
If you create a "type" of the kind you want with sorting etc. and call it say ty_mytab you could do a conversion using CONV: TYPES ty_mytab TYPE SORTED TABLE OF t001w WITH NON-UNIQUE KEY fabkl. SELECT * FROM t001w INTO TABLE @DATA(lt_t001w). DATA(lt_new_tab) = CONV ty_...
如下面代码中,我们需要根据number或name读取数据,number定义成hash表的key,因此如果有值将采用number 作为primary key读取,如果number为空将采用name作为second key读取。 DATA:table_of_monstersTYPEHASHEDTABLEOFztsm_monstersWITHUNIQUEKEYmonster_numberWITHNON-UNIQUESORTEDKEYsortCOMPONENTSname.IFid_monster_numberISNOT...
8.data aa type sorted table of ty with unique key a 23、 9.with non-unique sorted key second_key 10.components b c. 11.12.aa = value #( 13.( a = 11 b = 32 c = 13 ) 14.( a = 21 b = 22 c = 23 ) 15.( a = 31 b = 42 c = 33 ) ). 16.*wa = it2 1 . 17...
data:gt_table_s type sorted table of gty_table with non-unique key name. 哈希表: data: gt_table_h type hashed table of gty_table with non-unique key name. 1. 2. 3. 4. 5. 6. 1.4 index table / any tablev 可以定义数据类型,但不能生成数据对象,数据对象一般是在程序中动态指定的, ...