关于abap:ABAP-怎么把A转换为B-的搬砖过程

84次阅读

共计 538 个字符,预计需要花费 2 分钟才能阅读完成。

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: <fc> TYPE x.

LV_S = ‘A’.

ASSIGN LV_S to <fc> CASTING.

MOVE <fc> to LV_AN.

Now get data in dubugging as ,

<fc> = 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: <fc> TYPE x.

lv_s = 'A'.

ASSIGN lv_s TO <fc> CASTING.

MOVE <fc> 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.

正文完
 0