08-16-2007 8:00 PM
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
08-16-2007 8:06 PM
08-16-2007 8:06 PM
08-16-2007 9:12 PM
Hello Rich,
This doesn't works.Thanks for the quick reply.
Regards,
Prashant
08-16-2007 9:17 PM
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
08-16-2007 10:02 PM
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
08-16-2007 10:05 PM
Hello Seshu,
I worked , I am sorry, the same code also works now.
Cheers
Prashant
08-16-2007 8:06 PM
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.
08-16-2007 8:10 PM
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