Skip to Content
author's profile photo Former Member
Former Member

Using Packed no in Program

REPORT ZSGTEST2.

Hello I used the simple code, but is giving me error or overflowing ? Is packed no defined in (4) show only int value like (1234) or it stores with decimals ?

Now with this declaration how much space it will occupy ??

data : var1(10) type c ,

var2 type i ,

var3(4) type p decimals 3 ,

var4 type f .

var1 = 'Saurabh Garg'.

var2 = '23.23' .

var3 = '12345.283' .

var4 = '23.23' .

write : var1 , var2 , var3 ,var4 .

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 15, 2005 at 10:17 AM

    Dear

    try this

    DATA : var1(10) TYPE c ,

    var2 TYPE i ,

    var3(8) TYPE p DECIMALS 3 ,

    var4 TYPE f .

    var1 = 'Saurabh Garg'.

    var2 = '23.23' .

    var3 = '12345.283' .

    var4 = '23.23' .

    WRITE : var1 , var2 , var3 ,var4 .

    in var3 variable precision in 5 digits and scale is 3 digits so total are 8, you specify 3 for decimal so left 5 are for precision.

    its up to you, that you want to specify the 8 in lenght, if not specify by default it would be 8.

    Rai

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 15, 2005 at 07:15 AM

    just remove the length specification for type P field.

    var3 type p decimals 3 ,

    this will work.

    Regards

    Raja

    Add a comment
    10|10000 characters needed characters exceeded

    • <i>Im getting output '12.355,283' instead of '12,355.283'

      Why ?</i>

      to change the decimal notation goto systems->user profile->own data->defaults

      there you will see an option to maintain decimal notation.

      Regards

      Raja

      can you go to your original question click on the pencil button and mark it as a question and reward the answers which were helpful to you.

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.