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

converting string to charcater

Former Member
0 Likes
2,033

Hi experts

is there any function module or procedre to convert a string with special characters to character format. Urgent issue. plz let me know the solution.

Thanks and regards,

alson

3 REPLIES 3
Read only

Former Member
0 Likes
914

Hi,

Just declare one char field of length 500 and assign to that


data : v_str type string value 'aggf%@kkfak*',
         v_char(500).

v_char = v_str.

write v_char.

Read only

Former Member
0 Likes
914

alson,

You mean to say you want to remove special charectors form string or what?

If yesy...

REPORT ZTEST11 .

DATA : v_str type String,

V_len type i,

v_num type i,

V_TOT(60),

V_NUM2 TYPE I.

PARAMETERS : P_ID(30).

start-of-selection.

v_len = strlen( P_ID ).

v_tot = sy-abcde.

v_num = v_num + 1.

do V_LEN TIMES.

if P_ID+V_NUM2(v_num) na v_tot.

REPLACE P_ID+V_NUM2(v_num) WITH space INTO p_id.

endif.

v_num2 = v_num2 + 1.

enddo.

CONDENSE P_ID NO-GAPS.

write P_ID.

Don't forget ot reward if useful...

Read only

Former Member
0 Likes
914

Hi

check with FM CHECK_STRING_SPEC_CHARACTERS

Sandeep