1 Create open hub as like below.
2 HEADER column is holding headers data and length is 200, you can change according to your requirement.
3 Do not map in transformation for
Header column.
4 And write below ABAP code in End Routine
data: t_rs type standard table of _ty_s_TG_1.
data: wa_rs type _ty_s_TG_1.
clear: t_rs.
wa_rs-header = 'HED;MATERIAL;MATERIAL_GROUP;MATERIAL_TYPE'.
append wa_rs to t_rs.
clear: wa_rs.
loop at RESULT_PACKAGE into wa_rs.
wa_rs-header = 'Header'.
append wa_rs to t_rs.
endloop.
clear: RESULT_PACKAGE.
RESULT_PACKAGE[] = t_rs[].
5 we will get Flat file output as like below
HED, MATERIAL, MATERIAL_GROUP, MATERIAL_TYPE--> Header information
Header;LUX,ZBC,HC--> Actual data