Problem solve Get help with specific problems with your technologies, process and projects.

What are the benefits of using work areas with tables, as opposed to header lines?

Curious about the benefits of using work areas with tables, as opposed to header lines? Learn from application development expert Matt Billingham. Also learn where work areas will be used in the future, and where header lines will continue to remain.

You recently responded to a question about work areas and header lines by saying that developers should use work areas as opposed to declaring an internal table with a header line because headers are no longer in fashion. That is not what an SAP developer like me wanted to hear! Personally I prefer addressing the table fields as declared with a t_ prefix.

Are there any technical or usage benefits of work areas over header lines -- e.g. speed, space or maintainability? Perhaps future SAP releases will be removing the option of header lines?

Well, if you want to show that it is a work area to a table, then why not call the table t_table, and the work area wt_table, etc.?

Classic ABAP tables with header lines will remain -- not only since ranges and select-options and function modules use them, but it would also be far too much work to rewrite all SAP and customer programs. In ABAP Objects, however, which is becoming increasingly important, tables with header lines are forbidden, and you must use a work area.

The usage benefits of work areas apply to the maintainability of tables. When you use a table with a header line, t_table could refer to either the table or its header line. This is ambiguous outside of context, and ambiguity is not good for maintainability.

Dig Deeper on SAP ABAP

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.