‎2006 Jun 06 7:20 AM
hello,
I have developed one program in SAP 4.7 version.Now i have copied it to 4.6C in SAP.When i tried to run this program it gives me error in
REPLACE ALL OCCURRENCES OF ':' IN l_col_time WITH ' '.this statement.this statement is working in 4.7 but not in 4.6C.What should i do to eliminate this replace statement?should i use any function module that replaces off occurrences of particular character with specified character.
‎2006 Jun 06 7:23 AM
REPORT abc.
DATA : BEGIN OF itab OCCURS 0,
str(50),
END OF itab.
DATA : cha(50) VALUE 'cha:sek:jskjfsjf',
str(2000).
SPLIT cha AT ':' INTO TABLE itab.
loop at itab.
concatenate str itab-str into str separated by space.
endloop.
write : str.
‎2006 Jun 06 7:42 AM
you can try this
data: raja(100) .
raja = '123:44:67:' .
translate raja using ': ' .Regards
Raja
‎2006 Jun 06 7:42 AM
hI,
This Replace statement wont work in 4.6C.
You can Split the string at ':' and then concatinate back seperated by SPACE.
Regards,
Tanveer.
<b>Please mark helpful answers</b>
‎2006 Jun 06 7:54 AM
hi,
try this
DO.
REPLACE ':' IN l_col_time WITH ' '.
IF SY-INDEX <> 0.
EXIT.
ENDIF.
ENDDO.
or
CLEAR lv_length.
lv_length = STRLEN( lv_format_sdata ).
*
DO lv_length TIMES.
*
REPLACE ',""' WITH ',' INTO lv_format_sdata.
*
IF sy-subrc <> 0.
EXIT.
ENDIF.
*
ENDDO.
This will solve ur problem.
<b>Mark Helpful answers</b>
Regards