Hi Colleagues,
I want to implemente an end routine in order to populate the material type from the material master data.
The source structure of my transformation contain the material.
The target structure of my transformation contain the material and material type infoobject.
I have implemented the following source code in the end routine based on the sdn doc below :
My source code is :
***************************************************
Global data declaration
***************************************************
List of all Employees and corresponding sales organisation
DATA: BEGIN OF I_S_MATERIAL_TYPE,
MATERIAL TYPE /BI0/PMATERIAL-MATERIAL,
MATERIAL_TYPE TYPE /BI0/PMATERIAL-MATL_TYPE,
END OF I_S_MATERIAL_TYPE.
DATA: i_t_material_type like table of I_S_material_type.
METHOD end_routine.
*=== Segments ===
FIELD-SYMBOLS:
<RESULT_FIELDS> TYPE tys_TG_1.
DATA:
MONITOR_REC TYPE rstmonitor.
$$ begin of routine - insert your code only below this line -
***************************************************
local data declaration
***************************************************
data: e_s_result type tys_TG_1.
data: e_t_result type tyt_TG_1.
data: material_type like e_s_result-matl_type.
***************************************************
read master data in local table once
***************************************************
SELECT MATERIAL MATL_TYPE FROM /BI0/PMATERIAL
into corresponding fields of table i_t_material_type
WHERE MATERIAL = <RESULT_FIELDS>-material
AND objvers = 'A'.
***************************************************
Do the calculation and add the new rows
***************************************************
*>>
loop over the input result data package
loop at RESULT_PACKAGE into e_s_result.
get Counter
read table i_t_material_type into e_t_result with key
material = e_s_result-material.
move material_type to e_s_result-matl_type.
append e_s_result to e_t_result.
endloop.
add the lines to the output package
refresh RESULT_PACKAGE.
move e_t_result[] to RESULT_PACKAGE[].
$$ end of routine - insert your code only before this line -
ENDMETHOD. "end_routine
$$ end of routine - insert your code only before this line -
ENDMETHOD. "end_routine
I have the following error message :
E:"E_T_RESULT" cannot e converted to the line type of
"ME->I_T_MATERIAL_TYPE"
Question :
Can someone explain me what is the issue in my source code ?
Cheers,