2008 May 31 7:32 AM
I am having a field of char type with the format
9/1/4519 I want its value to be 9\1\4519 otherwise it is creating problem in excel sheet.
how to do it.
2008 May 31 7:36 AM
use REPLACE <str1> WITH <str2> INTO <c> [LENGTH <l>].
hope will work
I am having a field of char type with the format
9/1/4519 I want its value to be 9\1\4519 otherwise it is creating problem in excel sheet.
how to do it.
2008 May 31 7:36 AM
use REPLACE <str1> WITH <str2> INTO <c> [LENGTH <l>].
hope will work
2008 May 31 7:44 AM
Here is the example
see to it..
DATA: T(10) VALUE '9/02/2008',
STRING LIKE T,
STR1(4) VALUE '/',
STR2(4) VALUE '\',
STR3(2) VALUE 'kl',
STR4(6) VALUE 'klmnop',
LEN TYPE I VALUE 2.
STRING = T.
WRITE STRING.
REPLACE STR1 WITH STR2 INTO STRING.
WRITE / STRING.
The output appears as follows:
9/02/2008
9\02\2008
Regards
Manish.
2008 May 31 7:45 AM
demo code for replace:
DATA: T(10) VALUE 'abcdefghij',
STRING LIKE T,
STR1(4) VALUE 'cdef',
STR2(4) VALUE 'klmn',
STR3(2) VALUE 'kl',
STR4(6) VALUE 'klmnop',
LEN TYPE I VALUE 2.
STRING = T.
WRITE STRING.
REPLACE STR1 WITH STR2 INTO STRING.
WRITE / STRING.
STRING = T.
REPLACE STR1 WITH STR2 INTO STRING LENGTH LEN.
WRITE / STRING.
STRING = T.
REPLACE STR1 WITH STR3 INTO STRING.
WRITE / STRING.
STRING = T.
REPLACE STR1 WITH STR4 INTO STRING.
WRITE / STRING.
The output appears as follows:
abcdefghij
abklmnghij
abklmnefgh
abklghij
abklmnopgh
2008 May 31 7:48 AM
Hi,
before processing it into Excel sheet. Loop the intenal table and chage that particular field as.
replace all occurrences of '/' in field name with '\'.
modify the internal table by transfering the field.
Thanks,
Arunprasad.P
2008 May 31 12:00 PM
hi,
try out this . this will transalte every occurance of / with \
data: a(8) type c.
a = '9/1/4519'.
TRANSLATE a USING '/\'.
write : a.
reward points if useful and and mark the post answered if u got the solution .....