2013 Jul 18 9:32 AM
HI Gurus, I need to change full stop with comma and i have used REPLACE ALL OCCURRENCES OF wa_overview-CATSHOURS '.' IN TEXT with ','. but its showing an error for '.'. Please let me know where i am doing wrong. Thanks Sankil
2013 Jul 18 9:42 AM
Hi Sankil,
REPLACE ALL OCCURRENCES OF '.' in wa_overview-CATSHOURS with ','.
Regards.
2013 Jul 18 10:37 AM
Hi sankil,
wa_overview-CATSHOURS may is of type date. so it is not stored in db with , or . but you can go to SU01 and into default tab try to alter the date to display as in your desired format.
Hope it helps,
Andrew
2013 Jul 18 10:53 AM
Hi sankil,
whatever you write the syntax for REPLACE ALL OCCURRENCES is correct, but the problem is your field CATSHOURS is having the type as 'QUAN'. we can't use the type qunatity(QUAN) in the REPLACE ALL OCCUREANCES (Only use C,N, D, T, STRING).
for that store that value wa_overview-CATSHOURS into another variable of type string, and use the following syntax.
REPLACE ALL OCCURRENCES OF '.' IN lv_temp WITH ','.
The following simple code will gives you more explanation:
DATA lv_hours TYPE catshours VALUE '12.03'.
DATA lv_temp TYPE string.
lv_temp = lv_hours.
REPLACE ALL OCCURRENCES OF '.' IN lv_temp WITH ','.
WRITE lv_temp.
Regards,
Chinni
2013 Jul 18 1:17 PM
2013 Jul 29 11:49 AM
Hi, If I am going to set the country like set country = 'DE', so the changes will done automatically or not means inplace of "." i will get "," or not in the output. Regards Sankil
2013 Jul 18 11:00 AM
Hi,
you read documentation of REPLACE ALL statement by pressing F4, Or
refer below link
http://help.sap.com/abapdocu_70/en/ABAPREPLACE_IN_PATTERN.htm
Or
you can try below statement..
TRANSLATE wa_overview-CATSHOURS USING '.,'
i.e in above statement after 'using' first is full stop and second is comma.
Regards
Tejas
2013 Jul 18 11:01 AM
Hi Sankil Pandya,
change you statement like this
REPLACE ALL OCCURRENCES OF '.' IN wa_overview-CATSHOURS with ','.
For example see this...
DATA : var TYPE char20 VALUE 'R.a.m.e.s.h'.
REPLACE ALL OCCURRENCES OF '.' IN var WITH ','.
WRITE : / var.
2013 Jul 18 11:22 AM
Hello
What i understood from your question
is converting a date like 01.02.2013 into 01,02,2013?
am i right?
First the wa_overview-CATSHOURS will be like 20130201
so first convert that to 01.02.2013
then use the replace all occurences
to convert 01022013 into 01.02.2013
use onvert_date_to_external fm
Hope it helps
2013 Jul 18 12:35 PM
Hi San,
"What ever you have the value just pass to the
"string variable then do the operation it will work fine.
DATA str type string VALUE 'akd.dfj.....'.
REPLACE ALL OCCURRENCES OF '.' in str WITH ','.
WRITE str.
Warm & Regards,
John.
2013 Jul 18 1:31 PM
Hi
Can you please show the value of wa_overview-CATSHOURS also your code. And also show the exact error message. Is it a dump?
2013 Jul 29 1:10 PM
2013 Jul 29 3:09 PM
Hi Sankil,
If you are trying to do a format change, then I suggest not to use a replace statement. Instead you try to find a conversion function module, or use 'WRITE TO' statement with mask/currency/country passed according to your requirement.
Thanks.