Hi Sangamesh,
You can use select statements only on a database object. Here in your case RESULT_ERTRAG is a result set, so you cant use select on the result set. Its like internal table in ABAP. On internal table we can only perform 'read' operation and not select. Thats the reason you are not able to see any values further.
And also you have declared matnr_ertrag variable (of type varchar(18)). It can hold only one value. If you see your operations, you are trying to fill entire column matnr in the variable(select "MATNR" into matnr_ertrag), logically it will not work this way.
Regards,
Vijay