Posts

Showing posts from October, 2018

ABAP Obsolete statements - REFRESH

Its time for another bite-sized post, This time with an obsolete statement. You have used it and I have used it, we all have used it whenever we wanted to clear the content of an internal table. Yes, I am talking about the REFRESH statement. Its almost second nature to use a CLEAR statement for clearing variables and Structures and REFRESH statements for Internal tables. To all the lovers of REFRESH statements, I have got bad news. It's Obsolete.  SO whats the replacement? its good old CLEAR statement, You might be wondering, why? It was a harmless statement. The way I see it, It became redundant with an Object-oriented setup. You see the statement REFRESH itab acts for internal tables like CLEAR itab[].  If the internal table itab has a header line , then the table body and not the header line is initialized. If the internal table itab has no header line , REFRESH itab acts like CLEAR itab. Now, Since the use of tables with header lines is obsolete and forbidden in classes, the