Hi
1).Create the structure with the required fields in it.
2) Then create the internal table and the work area.
3) write the select statement and then place the records in the internal table.
4).then write the loop statement.
pls write common fields present in the datasource and the table, write the appended field and appended table . If possible i will give the pseudo code.