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

Is length must while declaring TYPE 'P' variable

Former Member
0 Likes
1,562

Hi,

While declaring the type 'P' (Packed decimal) variable, should we provide the length. If we do not provide the length how munch length will it consider by default..?

I declared like below.

DATA: w_matprice TYPE P DECIMALS 3.

It didn't give any syntax error. So, will it provide length by default.

Please answer.

Thanks in advance.

Best Regards,

Paddu.

3 REPLIES 3
Read only

Former Member
0 Likes
1,315

By default the Packed type (P) has a length of 8.

From the TYPE help in SAP


   Type   Description of type        SL     Initial value 

    C     Character                  1      Space 
    N     Numeric string             1      '00...0' 
    D     Date        (YYYYMMDD)     8      '00000000' 
    T     Time:            HHMMSS)   6      '000000' 
    X     Byte (hexadecimal)         1      X'00' 
    I     Integer                    4      0 
    P     Packed number              8      0 
    F     Floating point number      8      '0.0' 

Read only

Former Member
0 Likes
1,315

Hi,

Check out the below details for your declaration ...


Type                 P
Length               8
Output length       17
Decimal places       3 

Read only

Former Member
0 Likes
1,315

i'm not sure...........