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

hexadecimal problem

JayantkumarS
Participant
0 Likes
617

hi experts,

problme with hexadecial value.

   FIELD-symbols : <fs_x> TYPE X.

   ASSIGN 'A' TO <fs_x> casting.

in 2 different system im geting 2 diferent values in

<fs_X> = 0041 correct

<fs_X> = 4100 in correct

Please advice.

Rgs,

Jayant.

3 REPLIES 3
Read only

Former Member
0 Likes
542

FIELD-symbols : <fs_x> TYPE X. 

   ASSIGN 'A' TO <fs_x> casting.

in 2 different system im geting 2 diferent values in

<fs_X> = 0041 correct

<fs_X> = 4100 in correct

Either is it 0041/4100, The value of A will be the same.

For example,Try this.

FIELD-SYMBOLS : <fs_x> TYPE any.
DATA a TYPE string." VALUE '0100'.
ASSIGN 'A' TO <fs_x>." CASTING.
WRITE <fs_x>.

Here for me

1) In one server,The hexa decimal value of A is 4100

2)In other,The hexa decimal value of A is 41.

Here in both the cases,The value of <FS_X> = A irrespective of hexadecimal values

Thanks

Katrice

Read only

0 Likes
542

hi Katrice,

thank you for your comments. because that value is futher procesed in below code and it is not in ascii value range it is raplaced by '?'.

when i test with A is s being replaced by '?', which is wrong since ascii value is coming as 16440 not in 1- 127 range.

lv_acsii type i.

   ASSIGN 'A' TO <fs_x> casting.
    if <fs_x> is assigned.
      clear lv_ascii.
      MOVE <fs_x> TO lv_ascii.

      "Check if character lies in ASCII range
      if lv_ascii > 0 and lv_ascii < 127.
      else.
        o_text+lv_index(1) = '?'.
      endif.
    endif.

4100 / 16640(lv-ascii) - in correct asci value
0041 / 65 (lv-ascii)  - correct ascii value

Rgs,

Jay.

Read only

Former Member
0 Likes
542

Hi

Debug in both systems step by step then where is the problem or difference we can find right

(in mys sytem i getting 4100 ).

Regards

Mahesh