Loop over table columns dynamically

In case of data cleanse activities there could be a necessity to loop over columns. Doing this dynamically will enable you to easily verify each column without writing to much ABAP code, as the code is valid for all columns.

Since everybody knows how to loop over rows but not over columns I began my quest of finding the most proper solution. I stumbled across this blog explaining me how to achieve this with just a couple lines of ABAP. The ABAP uses a standard SAP class cl_abap_typedescr to retrieve data.

Be sure to have a good look at this class since it has more nifty methods available which might get in handy during your developments in SAP BW.