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...
```abap READ TABLE lt_table WITH KEY your_key_field = your_key_value INTO ls_table. ``` 在上述代码中,“your_key_field”是作为搜索条件的字段,而“your_key_value”是该字段对应的值。读取成功后的数据将会保存在ls_table中。 ### 步骤3:处理读取到的数据 当我们成功地使用“READ TABLE WITH KE...
1.动态内表的创建,首先要定义动态结构,然后再根据定义的动态结构利用系统一个标准的method:”cl_alv_table_create=>create_dynamic_table“生成动态内表。 2.动态内表的赋值,遍历动态结构,获取指定的字段,然后给指定的字段赋值。 3.动态内表的读取显示,与赋值相似,遍历动态结构,获取指定的字段,然后读取对应字段的...
If theprimary table keyis used to access astandard tableand the key isempty, the first row of the internal table is read. If this is known statically, the syntax check produces a warning. Notes When using the primary table key, note that this key can be thestandard key, which can also...
[USING KEY keyname ]*WHERE c1 op f1 [AND c2 op f2 [...] ] ) ...*note: WHERE对应过滤的条件,是必须要指定的,注意有些操作符是不能在WHERE中使用的,如:OR , NOT 等*EXCEPT如果不指定则表示满足条件的找出来,如果指定则表示不满足条件的找出来*4. 內表缩减*语法: ... REDUCE type(*[let_...
TYPES vector TYPE STANDARD TABLE OF i WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 10.本示例创建内表数据类型 vector,其行包含基本类型 I 字段。注:WITH HEADER LINE只能与DATA关键字一起使用,而不能与TYPES一起使用,这也就是说,只有在分配了存储空间时才有隐藏工作区这一说,在定义内表类型时是没有的。
READ TABLE itab INDEX idx USING KEY sort_key ASSIGNING FIELD-SYMBOL(<fs>). idx = idx - 1. CHECK <fs> > 2. output = output && <fs> && ` `. ENDWHILE. cl_demo_output=>display( output ). Cause:When reading a table usingREAD ... WITH[TABLE]KEY, overlapping or duplicate keys we...
2. Table Expressions If a table line is not found, the exception CX_SY_ITAB_LINE_NOT_FOUND is raised. No sy-subrc. Before 7.40 With 7.40 Read Table index READ TABLE itab INDEX idx INTO wa. wa = itab[ idx ]. Read Table using key READ TABLE itab INDEX idx USING KEY key INTO ...
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...
Handling exceptions using/with exception classes 截获处理方法 data MYREF type ref to CX_SY_ARITHMETIC_ERROR. data ERR_TEXT type STRING. data RESULT type I. try. RESULT = 1 / 0. catch cx_sy_arithmetic_error into MYREF. ERR_TEXT = MYREF->GET_TEXT( ). ...