Skip to Content

Is length must while declaring TYPE 'P' variable

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2008 at 03:00 PM

    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' 
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2008 at 03:03 PM

    Hi,

    Check out the below details for your declaration ...

    Type                 P
    Length               8
    Output length       17
    Decimal places       3 

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2008 at 03:03 PM

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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.