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

Sting Reverse

Former Member
0 Likes
632

data : v_string1(20) type C.

data : v_string2(20) type C.

initialization.

v_string1 = 'RAMA'.

CALL FUNCTION 'STRING_REVERSE'

EXPORTING

string = v_string1

lang = sy-langu

IMPORTING

rstring = v_string2

EXCEPTIONS

too_small = 1

OTHERS = 2.

write 😕 v_string1,v_string2.

I am using this code to reverse the string.Works well.But in exporting parameter i gave lang = 'EN' instead of sy-langu.Its not working.Y?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
604

Hi,

Use 'E' instead of 'EN'. It will work.

data : v_string1(20) type C.
data : v_string2(20) type C.
initialization.
v_string1 = 'RAMA'.

CALL FUNCTION 'STRING_REVERSE'
EXPORTING
string = v_string1
lang = 'E'                  "Here change to E instead of EN
IMPORTING
rstring = v_string2
EXCEPTIONS
too_small = 1
OTHERS = 2.

write :/ v_string1,v_string2.

Thanks,

Sriram Ponna.

4 REPLIES 4
Read only

Former Member
0 Likes
605

Hi,

Use 'E' instead of 'EN'. It will work.

data : v_string1(20) type C.
data : v_string2(20) type C.
initialization.
v_string1 = 'RAMA'.

CALL FUNCTION 'STRING_REVERSE'
EXPORTING
string = v_string1
lang = 'E'                  "Here change to E instead of EN
IMPORTING
rstring = v_string2
EXCEPTIONS
too_small = 1
OTHERS = 2.

write :/ v_string1,v_string2.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
604

Hi Khanna,

Check this ..it should work now..


data : v_string1(20) type C.
data : v_string2(20) type C.
initialization.
v_string1 = 'RAMA'.

DATA : lang like sy-langu.
lang = 'EN'.

CALL FUNCTION 'STRING_REVERSE'
EXPORTING
string = v_string1
lang = lang
IMPORTING
rstring = v_string2
EXCEPTIONS
too_small = 1
OTHERS = 2.

write :/ v_string1,v_string2.

Read only

0 Likes
604

i tried using variable.not working

Read only

0 Likes
604

Hi,

Chnage EN to E, it will solve your problem.

Thanks,

Sri.