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

Shift Delete problem

Former Member
0 Likes
823

Hi Guys,

I have a Text as "ABCDEFGH"

I need to remove the Quotes ( " ) at the start and the end.

Kindly help.

Thanks and regards,

Frank

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
795

calculate the length of the string forst.

here in ur eg it is 10.

v_length = STRLEN( v_text )

v_next = 0.

v_count = 0.

DO v_length TIMES.

if v_text+v_next(v_length) = ' " '.

REPLACE ' " ' in v_text with ' ' into v_text.

ENDIF.

ENDDO.

v_text will hve value without ".

OR REPLACE ALL OCCURENCES OF ' " ' IN V_TEXT WITH ' ' INTO V_TEXT.

Edited by: Kalyan Chakravarthi on Feb 11, 2009 12:43 PM

Edited by: Kalyan Chakravarthi on Feb 11, 2009 12:47 PM

7 REPLIES 7
Read only

Former Member
0 Likes
796

calculate the length of the string forst.

here in ur eg it is 10.

v_length = STRLEN( v_text )

v_next = 0.

v_count = 0.

DO v_length TIMES.

if v_text+v_next(v_length) = ' " '.

REPLACE ' " ' in v_text with ' ' into v_text.

ENDIF.

ENDDO.

v_text will hve value without ".

OR REPLACE ALL OCCURENCES OF ' " ' IN V_TEXT WITH ' ' INTO V_TEXT.

Edited by: Kalyan Chakravarthi on Feb 11, 2009 12:43 PM

Edited by: Kalyan Chakravarthi on Feb 11, 2009 12:47 PM

Read only

Former Member
0 Likes
795

Hi Frank,

Kindly go through this link below:

Hope it helps

Regrds

Mansi

Read only

former_member222860
Active Contributor
0 Likes
795

Hi,

Use this:

data: v_char type string value '"ABCDF"'.

REPLACE ALL OCCURRENCES OF '"' IN v_char with space.
condense v_char.

WRITE:/ V_CHAR.

thanks\

Mahesh

Read only

Former Member
0 Likes
795

hi....

go with following code.

  • if w_obj has the text "ABCDEFGH"

data: w_i type i,

w_char type string.

w_i = strlen( w_obj ).

w_i = w_i - 1.

w_char = w_obj+1(w_i).

write: w_char.

Regard

Read only

Former Member
0 Likes
795

Hi Frank,

Try the following code:

DATA: v_str TYPE string VALUE '"ABCDFGH"'.

REPLACE ALL OCCURRENCES OF '"' IN v_str WITH space.

CONDENSE v_char.

Hope this will help.

Regards,

Nitin.

Read only

Former Member
0 Likes
795

Hi,

It is very simple.there are 2 approach for doing this:

1.

data:l_string(10) type c,
       l_string1(8) type c.

l_string = '"ABCDEFGH"'.
l_string1 = l_string+1(8). "this will read l_string A till H into l_string1
write: l_string1.

OR

2.

data:l_string(10) type c,
       l_string1(8) type c,
      l_len type i,
     counter type i.

l_string = '"ABCDEFGH"'.
l_len = strlen(l_string).
l_string1 = l_string+1(l_len -1). "this will read l_string A till H into l_string1

Hope this might help you.

Pooja

Edited by: Pooja Gupta on Feb 11, 2009 12:53 PM

Read only

Former Member
0 Likes
795

hi...

you can also go with...

data: w_char type string value '"ABCDEFGH"'.

REPLACE ALL OCCURRENCES OF '"' IN w_char with space.

condense w_char.

WRITE:/ W_CHAR.

regards