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

data declaration

Former Member
0 Likes
883

Abapers,

I am declaring internal table like this way in 4.7, will it work in ECC 6.0?

data : begin of i_mara occurs 0,

matkl like mara-matkl,

end of i_mara.

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
862

It does work in ECC 6, but the declaration of an internal table using OCCURS is obsolete. The EPC check will throw up a message when you use the declaration. Its better to declare a table using LIKE or TYPE referring to a field string or work area.


DATA:
  Begin of fs_string,
    matkl type mara-maktl,
  End of fs_string.

DATA:
  IT_Table like standard table
                 of fs_string
            initial size 0.

7 REPLIES 7
Read only

Former Member
0 Likes
862

Hi,

Yes it will work.

Note: Table with header line shows error in EPC in ecc 6.0.

Regards

Adil

Read only

Former Member
0 Likes
862

Yes it will work.



but instead of like better use type, if u use the like ther it will throw an EPC error so better use TYPE instead
of LIKE as showne below.
data :
   begin of i_mara occurs 0,
      matkl type mara-matkl,
   end of i_mara.

Read only

Former Member
0 Likes
862

it will work but use this.. it is better than that

types : begin of ty_mara ,

matkl like mara-matkl,

end of ty_mara.

data: itab type standard table of ty_mara with header line .

Read only

Former Member
0 Likes
862

hi,

yes it will work

Read only

Former Member
0 Likes
862

as also said by others it will work.

however it is obsolete statement in ECC 6.0, so we general avoid using OCCURS statement..

With luck,

Pritam.

Read only

Former Member
0 Likes
862

Hi,

yes You can use the statement in ECC6.0 also but now it is obsolete statement, so better not to use.

Read only

Former Member
0 Likes
863

It does work in ECC 6, but the declaration of an internal table using OCCURS is obsolete. The EPC check will throw up a message when you use the declaration. Its better to declare a table using LIKE or TYPE referring to a field string or work area.


DATA:
  Begin of fs_string,
    matkl type mara-maktl,
  End of fs_string.

DATA:
  IT_Table like standard table
                 of fs_string
            initial size 0.