‎2013 Apr 03 7:25 AM
Hello experts,
When a smartform is out, the number with decimal places is display in this way, '459.89,00'. The format I want is '459,89.00'. How can I control the output format of decimal places?
‎2013 Apr 03 8:25 AM
Navigate, System->User Profile-> Own Data or Transaction code - SU3 . Change Default decimal notation to 1,234,567.89. It will work.
But for permanent solution and for all country specific user you can use 'SET COUNTRY <Country Key> ' before the decimal amount printed on the form.
Ref:
http://help.sap.com/abapdocu_70/en/ABAPSET_COUNTRY.htm
-SS-
‎2013 Apr 03 7:29 AM
Hi,
1.Goto SU3.
2.Defaults tab.
3. Change the decimals notation
Hope it helps. Please do let us know if you are still facing the issue.
Regards
Purnand
‎2013 Apr 03 7:39 AM
Hi Purnand,
It works and thank you. I also want to know the universal setting of smartforms independent of users. Because it wastes time to go to SU3 for each end user. Thanx.
Best regards,
ts
‎2013 Apr 03 7:40 AM
Hi,
Please try the follwoing code.it formats the output in user format:-
FORM change_user_format CHANGING p_value.
DATA: lv_amount(14) TYPE p DECIMALS 3
,l_user_decimal TYPE usr01-dcpfm
,lv_str(15) TYPE c
,lv_str1(15) TYPE c
,lv_str_unit(15) TYPE c
,lv_frac TYPE p DECIMALS 3
,lv_count TYPE i
.
SPLIT p_value AT space INTO lv_str lv_str_unit.
SELECT SINGLE dcpfm "Decimal notaion
FROM usr01 "User master record (runtime data)
INTO l_user_decimal
WHERE bname EQ sy-uname.
CASE l_user_decimal.
WHEN ' '. " Decimal point is comma
TRANSLATE lv_str USING '. '.
TRANSLATE lv_str USING ',.'.
WHEN 'X'. " Decimal point is period: N,NNN.NN
TRANSLATE lv_str USING ', '.
WHEN 'Y'. " Decimal p
TRANSLATE lv_str USING ',.'.
ENDCASE.
CONDENSE lv_str NO-GAPS.
TRY.
lv_amount = lv_str.
CATCH cx_sy_conversion_no_number.
EXIT.
ENDTRY.
lv_frac = frac( lv_amount ).
IF lv_frac > 0.
WRITE lv_amount TO lv_str DECIMALS 1.
ELSE.
WRITE lv_amount TO lv_str DECIMALS 0.
ENDIF.
CONCATENATE lv_str lv_str_unit INTO p_value SEPARATED BY space.
ENDFORM. "change_user_format
Hope it helps,
BR,
Nitin
‎2013 Apr 03 8:25 AM
Navigate, System->User Profile-> Own Data or Transaction code - SU3 . Change Default decimal notation to 1,234,567.89. It will work.
But for permanent solution and for all country specific user you can use 'SET COUNTRY <Country Key> ' before the decimal amount printed on the form.
Ref:
http://help.sap.com/abapdocu_70/en/ABAPSET_COUNTRY.htm
-SS-
‎2014 Dec 31 2:24 PM
Hi SS,
I have the same issue and I tried to use SET COUNTRY <Country Key> statement in the driver program before calling the smartform's FM and also in the initialization of the smartform.
But it doesn’t seems to work for me, It’s still picking the format from user profile irrespective of the country.
Please assist me on this.
Thanks,
Anand
‎2014 Dec 31 5:07 PM
Hi,
Try:
Output formatting techniques in scripts and smartforms - Code Exchange - SCN Wiki
Also try using the currency key
regards.