DATA : ls_konv LIKE konv,
lv_str TYPE string,
lv_i TYPE i.
FIELD-SYMBOLS : <a_fs> TYPE ANY,
<ak_fs> TYPE ANY,
<akk_fs> TYPE ANY.
LOOP AT gt_display.
CLEAR ls_konv .
SELECT SINGLE * FROM konv INTO ls_konv
WHERE knumv EQ gt_display-knumv.
CLEAR lv_i.
DO 18 TIMES.
lv_i = lv_i + 1.
lv_str = lv_i. CONDENSE lv_str.
CONCATENATE 'A' lv_str '_KSCHL' INTO lv_str.
ASSIGN (lv_str) TO <a_fs>.
lv_str = lv_i. CONDENSE lv_str.
CONCATENATE 'A' lv_str '_KRECH' INTO lv_str.
ASSIGN (lv_str) TO <ak_fs>.
lv_str = lv_i. CONDENSE lv_str.
CONCATENATE 'GT_DISPLAY-A' lv_str INTO lv_str.
ASSIGN (lv_str) TO <akk_fs>.
IF sy-subrc IS INITIAL.
IF <a_fs> IS NOT INITIAL AND <a_fs> EQ ls_konv-kschl.
IF <ak_fs> IS NOT INITIAL.
IF gt_display-krech = 'A'.
<akk_fs> = ls_konv-kwert / gt_display-menge.
ELSE.
<akk_fs> = ls_konv-kawrt.
ENDIF.
ELSE.
<akk_fs> = ls_konv-kawrt.
ENDIF.
ENDIF.
ENDIF.
ENDDO.
MODIFY gt_display.
ENDLOOP.
ENDFORM.
Serkan AKKAVAK Computer Engineer ABAP Developer & SAP S/4 HANA Logistics Team Lead Contact : serkurumsal@yandex.com
Social Plugin