如果你把第一行的b改为22那么wa就是第一行了,应为b第一、第二行都最小,那么就比较二级所以的C字段,看哪个最小。 使用内表KEY访问内表 类似上面 wa = itab[ KEY key col1 = ... col2 = ...]. wa = itab[ KEY key COMPONENTS col1 = ... col2 = ...]. 相当于READ TABLE WITH TABLE K...
DATA gt_mara_sort TYPE SORTED TABLE OF mara WITH UNIQUE KEY primary_key COMPONENTS matnr. "旧语法 DATA LV_MATKL TYPE MARA-MATKL. READ TABLE GT_MARA INDEX 1 INTO DATA(LS_MARA). READ TABLE gt_mara_sort INTO DATA(ls_mara_sort1) INDEX 1 USING KEY primary_key. READ TABLE gt_mara_sor...
end of firstLine."定义内表(不指定talbe类型默认标准table,标准表只能使用 with NON-UNIQUE DEFAULT KEYData: firstTabTYPETABLEOFfirstLine with NON-UNIQUE DEFAULT KEYINITIALSIZE20WITHHEADERLINE"定义sorted table WITH UNIQUE KEY,或with non-unique default key 指定是否使用重复key fieldData: firstTab1 type S...
"beforeREADTABLEitabINDEXidxINTOwa."740wa=itab[idx]."Read Table using key "beforeREADTABLEitabINDEXidxUSINGKEYkeyINTOwa."740wa=itab[KEYkeyINDEXidx]."Read Tablewithkey "beforeREADTABLEitabWITHKEYcol1=… col2=…INTOwa."740wa=itab[col1=… col2=…]."Read Tablewithkey components "beforeRE...
READ TABLE gt_alv WITH KEY icon = g_red TRANSPORTING NO FIELDS. IF sy-subrc = 0. MESSAGE '存在错误数据,请处理' TYPE 'S' DISPLAY LIKE 'E'. ENDIF. DATA: lt_asset TYPE TABLE OF zmmt_asset_tmp, ls_asset TYPE zmmt_asset_tmp, ...
ABAP READ TABLE使用BINARY SEARCH如题,read table使用binary search,with key有多个字段的时候,寻找数据的内部逻辑是怎样的比如有内表(按A,B已排好序)T_DATAA B C1 1 11 2 22 1 32 2 42 3 53 1 63 2 73 3 8现在用如下语句查找READ TABLE T_DATA INTO W_DATA WITH KEY A='2' B = '3' BINA...
(lv_attribute_name)=cv_value&&sy-index.READTABLElt_attributesWITHKEYname=lv_attribute_nameTRANSPORTING NO FIELDS.IFsy-subrc<>0.data(ls_attribute_prop)=VALUEwdr_context_attribute_info(NAME=lv_attribute_nameTYPE_NAME='STRING').lo_node_info->add_attribute(attribute_info=ls_attribute_prop).DATA(...
WITH UNIQUE KEY carrid connid WITH NON-UNIQUE SORTED KEY city_key COMPONENTS cityfrom cityto, spfli_key LIKE LINE OF spfli_tab. ... spfli_key = VALUE #( carrid = 'LH' connid = '0400' ). READ TABLE spfli_tab FROM spfli_key ASSIGNING FIELD-SYMBOL(<spfli>). ...
READ TABLE <itab> [INTO <wa>] WITH KEY <key> [BINARY SEARCH]. 用INTO 选项可以指定目标区域。如果表格有表头行,则可以忽略INTO 选项。这样,表格工作区域就成了目标区域。 系统读取<itab>中匹配<key>中所定义的关键字的第一个条目。如果找到有适当关键字的条目,则将系统字段 SY-SUBRC 设置为0,并且 SY...
不推荐Readtable int_fligh with key airln=‘LF’.推荐Readtable int_fligh with key airln=‘LF’ binary search. 7、两个内表添加使用批量增加代替逐行 不推荐 Loop at int_fligh1. Append int_fligh1 to int_fligh2. Endloop. 推荐 Append lines of int_fligh1 to int_fligh2. ...