Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FM for conversion of *,+

Former Member
0 Likes
784

hi,

are there any function modules which will convert the SAP wild cards to SQL wild cards %,_ by accepting the string.

please let me know.

thanks.

hi,

are there any function modules which will convert the SAP wild cards to SQL wild cards %,_ by accepting the string.

please let me know.

thanks.

7 REPLIES 7
Read only

Former Member
0 Likes
759

Hi,

I am not sure if there is any FM to convert.

Whats ur requirement, may be u can use REPLACE string option to convert the string to the required format.

DATA: text TYPE STRING.

text = 'MARA*'.

REPLACE '*' IN text WITH '%'.

Cheers

VJ

Message was edited by: Vijayendra Rao

Read only

0 Likes
759

Like VJ said there are no build in and you can use REPLACE for the same.

But why do you need it anyways?

Regards,

Ravi

Note : Please mark the helpful answers.

Read only

0 Likes
759

of course, i can use replace.

but when i use replace and write

REPLACE '*' IN STR1 WITH '%'

i get a syntax error

INTO expected not IN.

i m using 4.6B. i think it is not available in this.

Read only

0 Likes
759

hi

in this case if the no of strings are more which needs to be parsed ...why dont u create a function module using the string as the import parameters and in the souce code use REPLACE to convert the %,_ as required and pass it to the output parameters,one time job and same can be use time and time again!!

reward points if it helps!!

gunjan

Read only

Former Member
0 Likes
759

Sunitha,

Best way is use "TRANSLATE" statment.

Syntax..

TRANSLATE 'MAX' using '%'.

Cheers,

Nilesh

Read only

abdul_hakim
Active Contributor
0 Likes
759

Hi

there is no FM exists for this purpose.

use REPLACE or TRANSLATE..

Cheers,

Abdul

Read only

0 Likes
759

yes, translate work fine