Application Development 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: 

Deleting last character of a string

Former Member
0 Kudos

Hi Abapers,

I want to delete the last character of my workarea and then store into table.

The workarea says that it is FAX|

I have to remove the last character.

How to do tht.

Please reply.

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi use the offset values

data: test type string value '1234'.

write:/ test+0(3).

7 REPLIES 7

Former Member
0 Kudos

hi use the offset values

data: test type string value '1234'.

write:/ test+0(3).

Former Member
0 Kudos

Hi

Go through the link given below:

With Regards

Nikunj Shah

Former Member
0 Kudos

hiii

you can remove the last character by using OFFSET...take all work area data in one variable..suppose you have it like

w_var(10) type c.

w_var = wa_itab.

w_var+0(10) = ' '.

it will remove last character & will make it as space.

regards

twinkal.

Former Member
0 Kudos

hi,

Try this.

len = strlen (string).

subtract 1 from len.

substr = string+0(len).

Store Substr into the table.

Regards

Sumit Agarwal

Former Member
0 Kudos

hi rahul,

before storing in Internal table, do sumthing like;

length = strlen(wa-field)

length = length - 1.
wa-field = wa-field+0(length).

clear lenght

With luck,

Pritam.

Former Member
0 Kudos

hi

do this in following way

frist find the String length

let it will be

w_str = 'sdn is wonderfull'

now use.

w_len = strlen(w_str) .

now

w_result = w_str+0(w_len - 1).

Cheers

Snehi

Former Member
0 Kudos

Thanks