2006 Dec 19 5:22 AM
I have a character field and a currency field (kwert). How to modify these fields in such a way so that I get commas in them on the output?
I am doing them on sapscript.
Thanks a lot,
Krishen
2006 Dec 19 4:54 PM
Hi,
Check this example..
DATA: V_CURR TYPE KONV-KWERT.
DATA: V_CHAR(17).
V_CURR = '12000.00'.
WRITE: V_CURR TO V_CHAR.
Use the character variable V_CHAR in your sapscript..It will have commas..
Thanks,
Naren
2006 Dec 19 5:23 AM
change it to type P format.
data: curr type p decimals 3.
data:kwert type kwert.
curr = kwert.
write: curr.and than use this variable into sapscript.
kishan negi
2006 Dec 19 4:45 PM
It does n't seem to work. Any other suggestions please?
Thanks.
2006 Dec 19 5:01 PM
Hi!
You may try the WRITE command somehow like this:
WRITE lv_kwert TO lv_char USING EDIT MASK '___,___,___'
Check the help for other WRITE options also, there are many useful formatting options in it.
Regards
Tamá
2006 Dec 19 4:51 PM
Try this:
split char_field at '.' into lv1 lv2.
concatenate lv1 ',' lv2 into lv_char.
split curr_field at '.' into lv1 lv2.
concatenate lv1 ',' lv2 into lv_curr.
make sure you define the variables lv1 and lv2 as char fields.
Rewards if Helpful
Viky
2006 Dec 19 4:54 PM
Hi,
Check this example..
DATA: V_CURR TYPE KONV-KWERT.
DATA: V_CHAR(17).
V_CURR = '12000.00'.
WRITE: V_CURR TO V_CHAR.
Use the character variable V_CHAR in your sapscript..It will have commas..
Thanks,
Naren
2006 Dec 19 7:47 PM
Hi Naren,
Thank you very much!
What if i dont want those decimals and 00 after the result?
For example, from 12,000.00 , I am looking for only 12,000
Thanks again.
2006 Dec 19 7:50 PM
2006 Dec 19 7:50 PM
Hi,
Open Transaction SU3. Click on tab named DEFAULTS.
choose the decimal type on the right side of the screen. Save the User settings.
Now run your program and check whether you are able to view the values with commas.
Regards,
Vara
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |