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: 

Can we display Quality fields with two decimals places on the screen?

Former Member
0 Kudos

Hi~everyone~

I have create a transparent table ZTSD001 with a Quality field KWMENG, which type KWMENG,like the field in vbap

KWMENGKWMENGQUAN153Order quantity

then,DATA: LT_ZTSD001 TYPE STANDARD TABLE OF ZTSD001.

i created a table control to output LT_ZTSD001,and for edit

my question is, since field kwmeng is defined as decimals 3,

can i set the colmun in table control to output as decimals 2?  and how ?

since the program is used for about half an year, there are some data sotred in the table

can i adjust the field "kwmneg" in table ztsd001 from decimals 3 to decimals 2?

thx~

1 ACCEPTED SOLUTION

Former Member
0 Kudos

why don't you make two decimals in transparent table ZTSD001?

7 REPLIES 7

Former Member
0 Kudos

why don't you make two decimals in transparent table ZTSD001?

0 Kudos

Hi,

     You may declare KWMENG type NETPR (currency) or

     Alternatively declare as a packed number like kwmeng(13) type P decimals 2.

     If you want only in the output then you may use Edit Mask.

0 Kudos

Hi Timothy,

ABAP includes a powerful handling of fields type currency and quantity. When defining ZTSD001 in data dictionary you are asked for a reference field for KWMENG of type UNIT. Put the unit field in the table and fill it accordingly. Yes, most unit fields are defined for 3 decimals output.

Table T006 controls the default setting of the individual units of measure. The T006-DECAN field gives the number of decimal places displayed and T006-ANDEC gives the number of decimal places on which you want to round the output.

If you go with the standard (which is based on world-wide used ISO rules), you are prepared for any kind of changes.

Still, you can always control the number of decimals in output in ALV field catalog or in a WRITE statement.

Regards

Clemens

0 Kudos

thx~

at April 2014, i developed the program for our oversea company to create so, which is much more efficient than va01. and then nobody mentioned about decimal points, so i defined the Quality field like standard so Quality field.

but now we have a new Company in our system,and the user asked to only two decimals

0 Kudos

thx~Clemens

i developed the program using screen, not alv

and  i also konw there is a attribute "ref. field"

but i cannot used to control decimal points

0 Kudos

Hi Timothy,

you still did not mention how you create the output.

I think I would add a parameter 'decimals' DEFAULT 3 to the selection screen. Then, depending on your specific output technique, set the number of decimals for the respective output fields.

BTW: I guess it is a quANTITY not quALITY field.

Regards

Clemens

0 Kudos

Hi,

I just tried and it works fine

DATA:

    kwmeng       TYPE vbap-kwmeng VALUE '12.345',

     netpr        TYPE vbap-netpr  VALUE '12.345'.

   WRITE:

     / kwmeng,

     / kwmeng unit 'KG',

     / kwmeng DECIMALS 2,

     / netpr,

     / netpr unit 'KG',

     / netpr DECIMALS 2.


Result is:


            12,345

            12,345

             12,35    <===========

          12,35

          12,35

          12,35

Where's the problem?

Regards

Clemens