Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Declare Internal Table in Code or in Data Dictionary...Opinions needed?

Former Member
0 Likes
403

Is it better to define your internal table and all of its fields in a begin of/end of declaration stmt in your code's data definitions. Or, is it better to create a structure in the Data Dictionary, which means one line of code in your program? Why does one choose the method they prefer?

I am thinking it is best to declare in Data Dictionary, especially since ABAP is now leaning towrds objects. However, I am seeing a lot of field by field definitions in programs. I am very interested in how most programmers accomplish this and why.

Thank-You

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
354

I would say that if the internal table is to be used in more than one program, then I would create a structure and/or table type in the ABAP dictionary. If it is to be used in just one program, then I would define it locally.

Regards,

Rich Heilman

Is it better to define your internal table and all of its fields in a begin of/end of declaration stmt in your code's data definitions. Or, is it better to create a structure in the Data Dictionary, which means one line of code in your program? Why does one choose the method they prefer?

I am thinking it is best to declare in Data Dictionary, especially since ABAP is now leaning towrds objects. However, I am seeing a lot of field by field definitions in programs. I am very interested in how most programmers accomplish this and why.

Thank-You

1 REPLY 1
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
355

I would say that if the internal table is to be used in more than one program, then I would create a structure and/or table type in the ABAP dictionary. If it is to be used in just one program, then I would define it locally.

Regards,

Rich Heilman