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: 

display without decimal

Former Member
0 Kudos

Hello Friends,

I have a quantity field in internal table which is having decimal 3 places

the data element is DZMENG.

I am using this internal table for ALV display.

User wants to see this quantity as number field, no decimal.

I tried with modifying field catalog with no decimal field & this I set to '0'.

But I still see the quantities separated by decimals.

Any idea how we can do without changing the field type in internal table.

Regards

Prashant

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Try changing the DATATYPE in the the fieldcatalog.

xfc-DATATYPE = 'QUAN'.
xfc-decimals_out = 0.

Regards,

RIch Heilman

7 REPLIES 7

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Try changing the DATATYPE in the the fieldcatalog.

xfc-DATATYPE = 'QUAN'.
xfc-decimals_out = 0.

Regards,

RIch Heilman

0 Kudos

Hello Rich,

This doesn't works.Thanks for the quick reply.

Regards,

Prashant

0 Kudos

Hello Prashant,

I am able to get required output.

Do not use reffield and ref table

see the following code :

internal table :

  • Internal Table for Output

data : begin of i_output occurs 0 ,

matnr like mara-matnr, " Material #

maktx like makt-maktx, " Material Desc

VPRSV like mbew-VPRSV, " Price Control Indicator

VERPR like mbew-VERPR, " Moving Avg Price

meins like mara-meins, " Base Unit of Measure

STPRS like mbew-STPRS, " Standard Price

LPLPR like mbew-LPLPR, " Current Planned Price

ZPLPR like mbew-ZPLPR, " Future Planned Price

VPLPR like mbew-VPLPR, " Previous Planned Price

kbetr like konp-kbetr, " Sales Price

KMEIN like konp-KMEIN, " Sales Unit

margin(5) type p decimals 2,

vmsta like mvke-vmsta, " Material Status.

end of i_output.

  • Standard Price

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'STPRS'.

LS_FIELDCAT-OUTPUTLEN = 11.

LS_FIELDCAT-TABNAME = 'I_OUTPUT'.

<b>ls_fieldcat-Decimals_out = 0.</b>

ls_fieldcat-seltext_L = 'Standard Price'.

APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.

Thanks

Seshu

0 Kudos

Hello Seshu,

for currencies it work i think but if it is quantity field , then it is not working.

I have the same coding which you suggested.

Regards

Prashant

0 Kudos

Hello Seshu,

I worked , I am sorry, the same code also works now.

Cheers

Prashant

Former Member
0 Kudos

try this

DATA pack TYPE p DECIMALS 4 VALUE '1234.5678'.

WRITE pack NO-GROUPING DECIMALS 0.

write your field to a local variable with above statement and move it to the catalogue.

A.

Former Member
0 Kudos

use Decimals_out in field catalog.The problem is because of reference field name and reference table name.Do not use this field in case of no decimals.

Thanks

Seshu