ABAP: 变量包含内表字段名,如何通过该变量为该内表字段赋值?

2024-12-29 08:01:42
推荐回答(3个)
回答1:

之前还要定义好i_bom-menge1i_bom-menge2'XXXX'这个地方可以写成 L_VARL_COUNT可以定义 L_VAR = ‘i_bom-menge’L_COUNT = L_COUNT + 1

回答2:

我是用collect 汇总的。FORM f_groupbyopt.FIELD-SYMBOLS:." type kna1-kunnr.DATA : l_fn(50) TYPE C VALUE 'ITAB_ALV-AGKUN',l_fn2(10) TYPE C.*PERFORM f_getsctext USING sy-repid sy-langu.LOOP AT itab_alv. LOOP AT text1 INTO wa1. l_fn2 = wa1-key+3(5). CONCATENATE 'ITAB_ALV-' l_fn2 INTO l_fn . ASSIGN (l_fn) TO . CONCATENATE 'ITAB_SUM-' l_fn2 INTO l_fn .* write : / ,l_fn. PERFORM f_setfieldval USING l_fn . ENDLOOP. itab_sum-lfimg = itab_alv-lfimg. itab_sum-menge = itab_alv-menge. itab_sum-amt = itab_alv-amt.*/added by gjl 2008.03.12 itab_sum-vrkme = itab_alv-vrkme. itab_sum-waerk = itab_alv-waerk.*/ COLLECT itab_sum.ENDLOOP.ENDFORM.

回答3:

新手,不太明白!ASSIGN COMPONENT 'i_bom_menge1' OF STRUCTURE TO . = vl_temp.那这里的 实际上就是i_bom_menge1?如果我处在一个循环当中,i_bom-menge1的值要垒加怎么办? = + x.???好像有问题耶!