cancel
Showing results for 
Search instead for 
Did you mean: 

abap statement

Former Member
0 Kudos
66

Hi

I have one variable X whose value is 'LONDON'.I have one other variable Y whose value should be first letter of X.

So Y=L

I wrote ABAP statement Y=X + 0(1) but its not working.How to do this?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

TuncayKaraca
Active Contributor
0 Kudos

Hi Simon,

DATA:

   x TYPE C LENGTH 10,

   y TYPE C LENGTH 1.

x = 'LONDON'.

CONDENSE x.

y = X(1).

Then y becomes 'L'.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Simon,

SHIFT X LEFT DELETING LEADING SPACE.

Y = X+0(1).

If X is stored as e.g. CHAR10, then it may look like '    LONDON'.

BR

Ondrej