Application Development 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: 

declaring packed field in types in OO context

Former Member
0 Kudos

hi,

i'm declaring an internal table of type sorted and using a type for that in a method. however, i have problem using 'P' as data type for one of my fields.

types : BEGIN OF ty_test,

field1(10) type c,

field2(12) type c,

packedfield TYPE P DECIMALS 4,

END OF ty_test.

during syntax check it says 'explicit length specification are necessary with types C,P....'

Thanks,

KK.

1 REPLY 1

former_member787646
Contributor
0 Kudos

Hi,

For packed data types you have to mention the size specification to allocate memory.

Try this.

types : BEGIN OF ty_test,

field1(10) type c,

field2(12) type c,

packedfield(5) TYPE P DECIMALS 4,

END OF ty_test.

Hope it helps you.

Murthy.