PERFORM output_dyntable_data." 从动态内表中取数,并写到屏幕 * LOOP AT it_structure INTO wa_structure. * WRITE: wa_structure-fieldname(5). * ENDLOOP. * LOOP AT <dyn_table> INTO <dyn_wa>. * WRITE: / . * LOOP AT it_structure INTO wa_structure. * ASSIGN COMPONENT wa_structure-fie...
3.1.LOOP AT循环内表 LOOP ATitab {INTOwa}|{ASSIGNING<fs> [CASTING]}|{TRANSPORTING NO FILDS} [[USINGKEYkey_name|(name)] [FROMidx1] [TOidx2] [WHERElog_exp|(cond_syntax)]]. ENDLOOP. FROM … TO:只适用于标准表与排序表WHERE … :适用于所有类型的内表 如果没有通过USING KEY选项的key_...
USING KEY keyname is used to determine the table key with which the loop is executed. The table rows to be read in a LOOP loop can also be limited using optional conditions. If no conditions are declared, all table rows are read. ...
FILTER type( itab [EXCEPT] [IN ftab] [USING KEY keyname] WHERE c1 op f1 [AND c2 op f2 […]] ). 实例: TYPES: BEGIN OF ty_filter, cityfrom TYPE spfli–cityfrom, cityto TYPE spfli–cityto, f3 TYPE i, END OF ty_filter, ty_filter_tab TYPE HASHED TABLE OF ty_filter WITH UNIQ...
2 可以在READ TABLE itab, LOOP AT itab, MODIFY itab, DELETE itab内表操作语句中通过WITH [TABLE] KEY ... COMPONENTS或者USING KEY选项指定key_name来使用第二索引2 可以在INSERT itab与APPEND语句中通过USING KEY选项来使用源内表的第二索引
Many of you already know to work with For loop in SAP ABAP. However, those who are new to the ABAP 7.4 syntax often struggle at some places to achieve the expected result using new syntax. One of the scenario, I am covering below so that new learner can find help with this post. Sc...
LOOP AT it_md INTO wa_md. READ TABLE lt_marc INTO lw_marc WITH KEY taskname = g_taskname BINARYSEARCH. MOVE-CORRESPONDING wa_md TO wa_output. wa_output-matnr = lw_marc-matnr. wa_output-werks = lw_marc-werks. APPEND wa_output TO it_output. CLEAR:wa_output,wa_md,lw_marc. ENDLO...
ABAPLOOPstatementhasthepossibilitytouseacursor,inotherwords,ifwehavesortedtableswewillbeabletostartloopingfromthefirstitem,thatwearelookingfor,otheritemswillbeinthenextpositions.SORTlt_bkpfBYBUKRSBELNRGJAHR.SORTlt_bsegBYBUKRSBELNRGJAHR.LOOPATlt_bkpfINTOls_bkpf.READTABLElt_bsegTRANSPORTINGNOFIELDSWITHKEYBUKRS...
Before the additional components can be declared, a group key binding must be defined in the output behavior group_result. The additional components can be accessed in the group loop using the data object or field symbol specified here.
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( ). ...