ABAP 怎么把A转换为B 的搬砖过程

Get Ascii Value A to 65

Posted onFeb 07, 2017 at 08:54 AM | 266 Views

Follow

RSS Feed

Data : LV_S type c.

DATA : LV_AN TYPE i.

FIELD-SYMBOLS: TYPE x.

LV_S = 'A'.

ASSIGN LV_S to CASTING.

MOVE to LV_AN.

Now get data in dubugging as ,

= 4100

LV_AN = 16640

Now i want lv_an = 65 ... but it is display lv_an = 16640.

kindly , give proper solution

Regards,

这个作者的问题是没有解决16640 怎么变成i类型
下面是解决的办法

DATA : lv_s TYPE c.

DATA : lv_an TYPE i.

DATA:c2 TYPE c LENGTH 2.

FIELD-SYMBOLS:  TYPE x.

lv_s = 'A'.

ASSIGN lv_s TO  CASTING.

MOVE  TO lv_an.
lv_an = lv_an / 256.
WRITE: / lv_an.

lv_an = lv_an + 1.


c2 = cl_abap_conv_in_ce=>uccpi( lv_an ).
WRITE: / c2.

你可能感兴趣的:(abap)