‎2007 Apr 17 7:43 AM
HI EXPERTS,
i m working on simple alv,,,using erfmg field of mseg table,in database table the value is entered in this format 5,000,but this comma is basically a decimal i.e ' . ' what i want is that instead of 5,000 the 5.000 sud come in the output list....for this what sud i do...
plz help me.
‎2007 Apr 17 7:44 AM
hi,
chk this.
*1,234,567.89 => 1.234.567,89.data: l_amnt(100) type c.
l_amnt = '1.234.567,89'.
replace all occurrences of ',' in l_amnt with '#'.
replace all occurrences of '.' in l_amnt with ','.
replace all occurrences of '#' in l_amnt with '.'.
write : l_amnt.Rgds
Anversha
‎2007 Apr 17 7:44 AM
hi,
chk this.
*1,234,567.89 => 1.234.567,89.data: l_amnt(100) type c.
l_amnt = '1.234.567,89'.
replace all occurrences of ',' in l_amnt with '#'.
replace all occurrences of '.' in l_amnt with ','.
replace all occurrences of '#' in l_amnt with '.'.
write : l_amnt.Rgds
Anversha
‎2007 Apr 17 7:48 AM
Hi..
<b>Replace all occurances of ',' in w_value with '.'.</b>
‎2007 Apr 17 7:49 AM
first move this integer type variable into a character type and now u can use..
TRANSLATE or REPLACE..
<b>data w_value(20) type c.
w_value = mseg-amount.
translate w_value using ',.'.
or
replace all occurrences of ',' in w_value with '.'.</b>
<b>Heay this ',' to '.' conversion depends on the user master settings for your user id. if it is , only then no need of this change !! take care of that also..</b>
regards,
sai ramesh
‎2007 Apr 17 7:52 AM
Hi,
For this you have to change user settings or else u can replace ',' with '.'.
<b>Replace all occurences of ',' in <var name> with '.'</b>.
Regards,
‎2007 Apr 17 8:02 AM
Hi..
data menge type ekpo-menge.
Use
Replace all occurrences of <b> ','</b> in menge with <b>'.'</b>.
Regards
Bala..
‎2007 Apr 17 8:09 AM
Hi Ravi,
Check this info
THIS PROCEDURE IS BY CHANGING SETTINGS :
In your user profile, change the decimal format you are currently using.
System->User Profile->Own data.
Go to defaults tab and then change your decimal notation.
THIS PROCEDURE IS WITHOUT CHANGING DEFAULT SETTINGS:
Check this sample code.
Report YH642_TEST.
TABLES:
mard.
DATA : W_mard_labst type p decimals 3,
w_dt1(18).
data:
W_N TYPE I.
SELECT SINGLE * FROM MARD INTO MARD WHERE LABST = '10000.00'.
WRITE: mard-labst .
W_mard_labst = mard-labst.
WRITE:/ W_mard_labst .
w_dt1 = w_mard_labst .
write W_mard_labst to w_dt1.
W_N = STRLEN( W_DT1 ).
W_N = W_N - 4.
OR , Try this way.
REPLACE ALL OCCURRENCES OF ',' IN W_DT1 WITH '.' .
REPLACE ALL OCCURRENCES OF '.'
IN SECTION OFFSET W_N LENGTH 4 OF W_DT1 WITH ','.
WRITE: / W_DT1.
Hope this resolves your query.
Reward all the helpful answers.
Regards
‎2007 Apr 17 8:09 AM
Also check the decimal notation settings in the user profile...if its set to , system will output 500,00.
Hope this helps.
‎2007 May 14 2:32 PM
if u want to display in required manner , goto system->userprofile->owndata->defaults
in this so many representions are there. select required format and save the profile. no need to write any in the program.