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

String Right Trim

Former Member
0 Likes
578

Hi,

I have to right trim a string which is not working when I tried the below,

eg : var = "abcdefgh ".

In the above I want to remove the trailing 2 spaces

I tried

shift var right deleting trailing space.

which completely cleared var.

Please help me on resolving this...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
511

Hi,

Try using CONDENSE Statement.

2 REPLIES 2
Read only

Sm1tje
Active Contributor
0 Likes
511

So what exactly is not working? It created following program, and it seems to be working just fine...


DATA : var TYPE char10 VALUE 'abcdefgh  ',
             length TYPE i.

length = NUMOFCHAR( var ).
WRITE:/1 length.
SHIFT var RIGHT DELETING TRAILING space.

length = NUMOFCHAR( var ).
WRITE:/1 var.
WRITE:/1 length.

Read only

Former Member
0 Likes
512

Hi,

Try using CONDENSE Statement.