07-30-2007 8:25 AM
hello friends,
I had declared a variable of variable type P(16) decimals 6 for price. The price is calculated accurately and stored in the variable. The value that got stored is 5094390.000000. I declared one more variable of type ekpo-netpr and moved that value into this field. In the fieldcatalog i used cfieldname = 'waers'.....while displaying through ALV for waers 'IDR' (no decimals should be displayed ) it is displaying as 509.439.000 instead of 5094390.
Could you tell me any one dd variable that can hold of type P(16) decimals 6 .
pls help me to resolve this issue. All helpful answers would be highly rewarded.
Thanks,
Ramineni
07-30-2007 8:34 AM
HI,
there is an option in ALV field cat...
<b>decimals_o</b>..By setting this you can increase or decrease the decimal places..
if you put 0 for that no decimals will be displayed..
regards,
Omkar.
07-30-2007 9:14 AM
Hi yanamala,
depending upon the currency field i have to display the decimals ....if i use decimals_o then for all fields decimals will be displayed in a similar format only.
07-30-2007 9:32 AM
07-30-2007 9:36 AM
07-30-2007 9:38 AM
Hi Dear,
Its very Simple Look at this code
data: amount(15) type c value '200,000,000.000'.
while sy-subrc = 0.
replace ',' with space into amount.
endwhile.
condense amount no-gaps.
write:/ amount.
Replace what ever it is comma or (.)
You said U will reward High so i will expect the same
If any further quries pls feel free to ask.
Regards,
Bohra.
07-30-2007 9:47 AM
depending upon the currency field i have to display the decimals ....i mean if the value is 53490700.000000
then if waers = ''IDR" it should be displayed as 53490700
if it is "USD" then it shouold display 53490700.00
like this i wanna print. if i use the method as you suggested above i have to display 53490700000000. which is not meaningful.
Thanx and regards,
Ramineni
07-30-2007 10:24 AM
Hi,
You have to mention currency in fieldcatlog,
i.e.
x_fieldcat-fieldname = 'NETPR'.
x_fieldcat-col_pos = '7'.
x_fieldcat-outputlen = '4'.
x_fieldcat-currency = 'USDN'.
x_fieldcat-reptext_ddic = 'Unit Price'.
APPEND x_fieldcat TO it_alv_fcat.
CLEAR x_fieldcat.
go to transaction OY04
There You can define the decimal lengths of Currency.
ALV will pick decimal length from here.
Regards,
Sarbpreet Multani
07-30-2007 10:38 AM
07-30-2007 11:58 AM
Hi,
Please try this code here u have to give name of field which contain Currency.
This will definitely work
x_fieldcat-fieldname = 'NETPR'.
x_fieldcat-col_pos = '7'.
x_fieldcat-outputlen = '4'.
<b>x_fieldcat-cfieldname = 'WAERS'.</b> Currency Fields
x_fieldcat-reptext_ddic = 'Unit Price'.
APPEND x_fieldcat TO it_alv_fcat.
CLEAR x_fieldcat.
and same u have to set decimals of Currency in OY04.
regards
sarbpreet multani
Message was edited by:
sarbpreet multani
07-30-2007 12:24 PM
Hi Ramineni,
Check this..
WA_FCAT-TABNAME = 'I_OUTTAB'.
WA_FCAT-FIELDNAME = 'AUFNR'.
WA_FCAT-REF_TABNAME = 'AUFK'.
WA_FCAT-HOTSPOT = 'X'.
APPEND WA_FCAT TO I_FCAT.
WA_FCAT-TABNAME = 'I_OUTTAB'.
WA_FCAT-FIELDNAME = 'ACTL'.
WA_FCAT-SELTEXT_M = 'Total Act Amount'(010).
WA_FCAT-QFIELDNAME = 'TWAER'.
WA_FCAT-QTABNAME = 'T_OUTTAB'.
wa_fcat-decimals_o = '0'.
APPEND WA_FCAT TO I_FCAT.
CLEAR WA_FCAT.
<b>Decimals in this will be restricted</b>
Regards,
Omkar.
07-30-2007 12:30 PM