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: 

regarding an abap statement

Former Member
0 Kudos

i have

field-symbols : <n> type x,

<pn> type c,

<dn1> type x.

data: rn type i,

rn1(4) type c,

n type c.

describe field P_I_UPLOAD type _c.

if _c eq 'u'.

l = strlen( PI_UPLOAD ).

_i = _l div 2.

do _l times.

a = sy-index - 1.

a1 = P_I_UPLOAD+a(1).

assign a1 to <n> casting.

move <n> to rn.

and so on

what is confusing is the last statement move <n> to rn

can anyone please tell me whats the effect of this?

the value in a1 = Z.

then

assign a1 to <n> casting.

this statement puts the value in <n> is 5A

and then

move <n> to rn.

puts he the value in rn = 90

can anyone tell me why is this happening?

assign a1 to <n> casting.

2 REPLIES 2

Former Member
0 Kudos

Hi Ashish,

See it converting value of Hexadecimal to type i.

If you check the value of hex then it comes like,

Dec Hx Oct Char Dec Hx Oct Char Dec Hx Oct Char Dec Hx Oct Char

26 1A 032 SUB (substitute) 58 3A 072 : <b>90 5A</b> 132 Z 122 7A 172 z

Reward if useful!

Former Member
0 Kudos

Hi,

When a1 = Z: ascii value of Z is 90. 90 converted to Hexadecimal is 5A. So, you are seeing 90 in rn and 5A in a1.

I hope I could make it clear.