2020 Sep 24 11:58 AM
I have a value like dmbtr = 8000000.00 . So i need to write it to document in ths form ' 8 000 000.00 ' ,Can anyone please give any suggestions.
thanks in advance.
I have a value like dmbtr = 8000000.00 . So i need to write it to document in ths form ' 8 000 000.00 ' ,Can anyone please give any suggestions.
thanks in advance.
2020 Sep 24 11:58 AM
Hi and welcome to the SAP Community!
Thank you for visiting SAP Community to get
answers to your questions. Since you're asking a question here for the first
time, I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers (if you haven't already), as it provides
tips for preparing questions that draw responses from our members. For example,
you can outline what steps you took to find answers (and why they weren't
helpful) and share screenshots of what you've seen/done. The more details you
provide, the more likely it is that members will be able to assist
you.
Should you wish, you can revise your question by selecting Actions, then Edit
(although once someone answers your question, you'll lose the ability to edit the
question -- but if that happens, you can leave more details in a comment).
Finally, if you're hoping to connect with readers, please consider
adding a picture to your profile as it encourages readers to respond to you.
Here's how you do it: https://www.youtube.com/watch?v=F5JdUbyjfMA&list=PLpQebylHrdh5s3gwy-h6RtymfDpoz3vDS.
Best,
Lena
SAP Community Moderator
2020 Sep 24 12:04 PM
is this layout correspond to the parameters of your users (trans. SU3) or this layout should be always like that what ever the user specify in this parameters ?
2020 Sep 24 12:42 PM
2020 Sep 24 12:59 PM
bro if use write syntax , there write conv i(xxxx) to data(text), decimal part is lost. what i need to get is that '8 000 000.00'
yes i am coding in ABAP.
2020 Sep 24 12:50 PM
1) SET COUNTRY 'US'. is the most important step otherwise the WRITE statement will convert based on user parameters
2) Also note the ` ` back quotes in REPLACE otherwise it will not insert a blank
Tried with below code in my system and seems to be working.
Data: lv_dmbtr1 type dmbtr,
lv_conv type char50.
SET COUNTRY 'US'.
lv_dmbtr1 = ' 8000000.00'.
write lv_dmbtr1 to lv_conv.
CONDENSE lv_conv.
REPLACE ALL OCCURRENCES OF ',' IN lv_conv WITH ` `.
write lv_conv.
2020 Sep 25 7:34 AM
but outcome is 8 000 000 accroding your code, you can also check it out. code is skipping decimal part. output should be ' 8 000 000
.00'
2020 Sep 25 8:05 AM
2020 Sep 24 12:58 PM
i changed decimal notation to this form, but still outcome si the same in MS word .
no grouping .
2020 Sep 24 12:58 PM
2020 Sep 24 1:06 PM
This should be done automatically via user settings, not ABAP -> please answer Frederic question. If you have difficulties, can you explain what rendering technology you use? ("write" to what?)
2020 Sep 24 4:27 PM
T005X-XDEZP = "Y" is not what the OP expects, it corresponds to the format:
8 000 000,00SAP does not propose a number format for this format:
8 000 000.00
2020 Sep 24 4:29 PM
Answer almost like Bharat, and see Sergei ABAP link for more information about string templates:
DATA(dmbtr_text) = replace( val = |{ dmbtr COUNTRY 'US' }| sub = ',' with = '.' ).(make sure that US country has the format "# ### ###,##" in SM30 V_T005 - For information the number format of countries is stored internally in column XDEZP of table T005X, and value 'Y' is format "# ### ###,##")
2020 Sep 25 7:35 AM
I just optimized idea(code) of Bharat Pemmiredy.
data : lv_amount type dmbtr VALUE '8000000.00',
lv_num TYPE char50 .
write lv_amount to lv_num DECIMALS 2.
condense lv_num.
write:/ lv_num.
2020 Sep 25 8:10 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |