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

How to define an array in ABAP

Former Member
25,858

Hi experts,

Can we define an array in ABAP. if yes then How. plz help.

Regards.

Vaibhav Tiwari.

Hi experts,

Can we define an array in ABAP. if yes then How. plz help.

Regards.

Vaibhav Tiwari.

3 REPLIES 3
Read only

Former Member
6,444

data: begin of itab occurs 0,

str type string,

end of itab.

itab-str = '1 Record'. append itab.

itab-str = '2 Record'. append itab.

itab-str = '3 Record'. append itab.

itab-str = '4 Record'. append itab.

itab-str = '5 Record'. append itab.

itab-str = '6 Record'. append itab.

itab-str = '7 Record'. append itab.

itab-str = '8 Record'. append itab.

itab-str = '9 Record'. append itab.

read table itab index 5.

check sy-subrc = 0.

write:/ itab-str.

Read only

Former Member
0 Likes
6,444

Hi Vaibhav,

In ABAP we have much better version of array called as Internal table.

Regards,

Atish

Read only

former_member386202
Active Contributor
6,444

Hi,

There are no array concept in abap, instead of array there are internal table and field strings in abap.

Ex.

data : begin of itab occurs 10,

matnr like mara-matnr

mbrsh like mara-mbrsh,

end of itab.

data : begin of itab,

matnr like mara-matnr

mbrsh like mara-mbrsh,

end of itab.

Regards,

Prashant