2010 Oct 05 11:52 PM
HI
NEED HELP
do u know any FM or CONVERSION EXIT which remove thousand separator from quantity field.
Eg. 1,234,567.11 SHOULD be displayed as 1234567.11
2010 Oct 06 12:54 AM
HI
NEED HELP
do u know any FM or CONVERSION EXIT which remove thousand separator from quantity field.
Eg. 1,234,567.11 SHOULD be displayed as 1234567.11
2010 Oct 06 12:54 AM
2010 Oct 06 1:15 AM
Hi thanks for your answer ,but its not dat much simple ,
let take another example
1.123.45,12 should be displayed 112345.12
1,123,45.12 should be displayed 112345.12
means i need to remove all commas (thousand separator) and data should be displayed in decimals.
some times decimals may be more than 2 which depends on unit lets say in mm unit i want it more than 2 decimals.
the solution which u had given is fine but i am facing this problem frequently so i need to format every time.
if any fm is available then i can reuse it in proper way.
there is fm available for curreny as "CURRENCY_AMOUNT_SAP_TO_IDOC" and many more but not for quantity.
so if any one find solution for above problem , i will be thankful to him/her.
Thanks
2010 Oct 06 1:42 AM
Hi Chetanpatil.
Try this:
If your quantity has thousand separator as comma:
translate lv_quantity using ', '.
condense lv_quantity.
If your quantity has thousand separation as dot:
translate lv_quantity using '. '.
translate lv_quantity using ',.'.
condense lv_quantity.
You'll need to check for the user thousand separator configuration in table USR01 field DCPFM or by calling BAPI_USER_GET_DETAIL and act accordingly.
Regards,
Andres.
2010 Oct 06 9:05 AM
Hello All,
IMHO WRITE ... NO-GROUPING is the most fool-proof solution to handle different decimal separators.
Excerpt from the documentation:
... suppresses the thousands separator in the output of data objects of data types i or p ...
Source: [http://help.sap.com/abapdocu_70/en/ABAPWRITE_INT_OPTIONS.htm#&ABAP_ADDITION_5@5@]
BR,
Suhas
2010 Oct 06 7:37 AM
hi,
try this.
REPLACE ALL OCCURRENCES OF '.' IN lv_quantity WITH ''.
CONDENSE lv_quantity.
REPLACE ALL OCCURRENCES OF ',' IN lv_quantity WITH '.'.
Thanks ,
K.Kiranmayi
2010 Oct 06 8:12 AM
>
> hi,
>
> try this.
> REPLACE ALL OCCURRENCES OF '.' IN lv_quantity WITH ''.
> CONDENSE lv_quantity.
> REPLACE ALL OCCURRENCES OF ',' IN lv_quantity WITH '.'.
>
> Thanks ,
> K.Kiranmayi
Won't work with
1.123.45,12 should be displayed 112345.12
1,123,45.12 should be displayed 112345.12
2010 Oct 06 8:50 AM
Hi Chetan,
Try this:
CLEAR: w_dcpfm, w_thousand_sep.
SELECT SINGLE dcpfm
INTO w_dcpfm
FROM usr01
WHERE bname EQ sy-uname.
IF sy-subrc EQ 0.
IF w_dcpfm EQ 'X'.
w_thousand_sep = ','.
ELSEIF w_dcpfm EQ ' '.
w_thousand_sep = '.'.
ENDIF.
ENDIF.
REPLACE ALL OCCURRENCES OF w_thousand_sep IN l_quantity WITH ' '.
CONDENSE l_quantity NO-GAPS.
Regards,
Nisha Vengal.
2010 Oct 06 12:38 PM
Quantity fields do not contain anything other than 0-9, decimal and possibly sign. The thousands separators are "user-friendly" display characteristics of the value, not the data value!
If it's a true quantity field (or other true-numeric type, e.g., not N), output it to a file and look at the data value.
2010 Oct 06 1:00 PM
in your editor, enter WRITE.
Move back cursor. Press F1.
Look at NO-GROUPING.
Regards,
Clemens
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |