‎2006 Dec 12 1:30 AM
Hi SDNers,
I have an address field of length 100.But it has single quotes ( ' ).
I have to replace the single quote with space...can anyone suggest me
how it can be done...am using (contains pattern) but unsuccessful.
Thanks
Mahendhar Reddy
‎2006 Dec 12 1:32 AM
Please try with <b>TRANSLATE</b> statement.
Please check this example:
parameters: p_text(10) type c.
translate p_text using ''' '.
write:/ p_text.Kind Regards
Eswar
‎2006 Dec 12 1:32 AM
Please try with <b>TRANSLATE</b> statement.
Please check this example:
parameters: p_text(10) type c.
translate p_text using ''' '.
write:/ p_text.Kind Regards
Eswar
‎2006 Dec 12 1:33 AM
Populate the Single Quotes with Space.
CONSTANTS: C_QUOTE_SNG TYPE C VALUE ''''.
REPLACE ALL OCCURRENCES OF C_QUOTE_SNG IN V_STRING WITH SPACE.THis will slve your problem.
<b>Note:</b> Reward each useful post.
Raja T
Message was edited by:
Raja T
‎2006 Dec 12 1:41 AM
‎2006 Dec 12 1:42 AM
‎2006 Dec 12 1:46 AM
@ Rich
Maybe you have missed out while i was editing my post...:)
Kind Regards
Eswar
‎2006 Dec 12 1:48 AM
‎2006 Dec 12 1:59 AM
@ Rich
More Examples ---> Better Understanding.
So i guess it is never a problem.:)
Hope our examples will help Mahendhar...
Kind Regards
Eswar
‎2006 Dec 12 2:11 AM
Vow...you guys are very helpful man...
Thanks a lot.yaah...examples have not only solved my prblm but
taught several other things..thanks again
‎2006 Dec 12 1:43 AM
Hi Mahendhar,
Try this:
DATA: text TYPE STRING.
text = 'abcdefgh'.
REPLACE 'd' IN text WITH 'XXXX'.
returns: text = 'abcXXXXefgh', sy-subrc = 0
Rewards if the above helps.
Cheers,
Patrick