Tuesday, April 15, 2008

How can I create a two-dimensional array in ABAP?

ABAP does not use an array concept, but anything you would do with a multidimensional array, you can do with ABAP.

The internal table is like a one-dimensional array of records. For two dimensions, you have a number of choices. You can put the second dimension as another key field. You can use nested tables -- where a field of the record is in a table itself. And if you really want to, you can create dynamic tables -- where the number of fields in a record isn't determined until run time.

Rather than look at the question of how to create a two-dimensional array in ABAP, the question you should be addressing is "How can I solve this business/data problem?" It is a mistake to apply the concepts of one programming language directly to another. A wider view gives better solutions.

No comments:

Blog Archive