06-28-2007 6:55 AM
Hi to all abapers,
I have to show only upto 2 decimals in the field of an alv report but it is of type p and decimals 4.I dont want to change its type to 2 decimals due to some calculations.So can we show upto 2 decimals in the report?
Thanks in Advance,
Salish
06-28-2007 7:02 AM
try this it may work
fieldcat-decimals_out = '2'.
for that field..
regards
shiba dutta
06-28-2007 8:08 AM
Hi,
Sorry there is no field like decimals_out but there is a field decimals_o i tried that
as w_field-decimals_o = '2' but its not working.
Thanks for the response.
Regards.
06-28-2007 8:17 AM
Hi
Check this...hope its useful
http://help.sap.com/saphelp_nw04/helpdata/en/ec/e7eb40c4f8712ae10000000a155106/frameset.htm
Regards
Raj
06-28-2007 8:18 AM
Hi Salisha ,
Are u implementing the ALV using Objects or FM.
If it is FM then in the catalog as shiba said there is a field called decimals_out , and if it is objects there is one called DECIMALS .
Try using them.
Regards
Arun
06-28-2007 8:35 AM
Hi,
Thanks for the reply. I tried with decimals also but still its not coming.
Do it have any other options.
Thanks and Regards,
Salish.
06-28-2007 8:59 AM
Could you please poste your code here so that we can have a look at it.
Regards,
Arun
06-28-2007 10:04 AM
Hi,
Here is the code
<b>Here act_pckeff is of type p decimals 4 and i want it upto 2 decimals in the output.</b>
PERFORM fldcat USING i_fieldcat 'ACT_PCKEFF' 'DEC' 'Actual Efficiency "Packed"' ''."13
FORM fldcat USING p_ifieldcat TYPE lvc_t_fcat
value(p_name)
value(p_type)
value(p_desc)
value(p_key).
DATA: w_fldcat TYPE LINE OF lvc_t_fcat.
CLEAR w_fldcat.
w_fldcat-fieldname = p_name.
w_fldcat-datatype = p_type.
w_fldcat-reptext = p_desc.
w_fldcat-key = p_key.
IF w_fldcat-fieldname = 'AUFNR'.
w_fldcat-no_zero = 'X'.
ENDIF.
IF p_type = 'CURR' OR p_type = 'QUAN'..
w_fldcat-do_sum = 'X'.
ENDIF.
<b>IF p_name = 'ACT_PCKEFF'.
w_fldcat-decimals = 2.
w_fldcat-do_sum = 'C'.
ENDIF</b>.
APPEND w_fldcat TO p_ifieldcat.
ENDFORM. " fldcat
Regards,
Salish.
06-28-2007 10:16 AM
Hi,
Just try this.
IF p_name = 'ACT_PCKEFF'.
w_fldcat-decimals_o = 2.
w_fldcat-DECMLFIELD = 'ACT_PCKEFF'.
ENDIF.
06-29-2007 6:44 AM
Hi,
I tried the above code, but a runtime error is coming as <b>WRITE_ROUND_TOO_SMALL</b>
i dont know y this error is coming Can anyboby tell me what is the error?
Regards,
Salish