Error in End routine- Field not there in Table or Data statement
I am writing an END Routine. Here are the exact code. Its giving me error "E:Field "COPANETSL" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement.
DATA : begin of t_comp,
/BIC/ZCOMPANY type /BIC/PZSOLD_TO-/BIC/ZCOMPANY,
/BIC/ZSOLD_TO type /BIC/PZSOLD_TO-/BIC/ZSOLD_TO,
COPANETSL TYPE /BI0/OICOPANETSL,
END OF t_comp.
data: lt_comp like table of t_comp.
DATA: E_S_RESULT TYPE _ty_s_TG_1 .
DATA: E_T_RESULT TYPE _ty_t_TG_1 .
INTO table lt_comp
for all entries in RESULT_PACKAGE
where /BIC/ZSOLD_TO = RESULT_PACKAGE-/BIC/ZSOLD_TO.
LOOP AT RESULT_PACKAGE INTO E_S_RESULT.
READ TABLE lt_comp INTO t_comp WITH KEY
/BIC/ZSOLD_TO = E_S_RESULT-/BIC/ZSOLD_TO.
IF sy-subrc = 0.
MOVE t_comp-/BIC/ZCOMPANY to E_S_RESULT-/BIC/ZCOMPANY.
if t_comp-/BIC/ZCOMPANY IS INITIAL.
MOVE COPANETSL to E_S_RESULT-/BIC/ZAFFAMT.
ELSEIF E_S_RESULT-/BIC/ZAFFAMT =0.
MODIFY RESULT_PACKAGE from E_S_RESULT transporting /BIC/ZCOMPANY.
Here are some more details.
DS is Flat File. COPANETSL is available in RESULT_PACKAGE and in DS also mapped.
Can someone please suggest what am I doing wrong?