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

present number or char AS BINARY

Former Member
0 Likes
362

i have number 1025 he have 4 bytes in the memory .

1. i want to present it as <b>BINARY</b>.

2. i want to present it as <b>Big Endian</b>--for software of motorolay if anyone work with it.

1 REPLY 1
Read only

athavanraja
Active Contributor
0 Likes
326

try this code

data: l_string type string ,
      l_xstring type xstring .

move: '1025' to l_string .
 call function 'SCMS_STRING_TO_XSTRING'
    exporting
      text = l_string
    IMPORTING
      BUFFER = l_xstring.

* Add the Byte Order Mark - UTF-16 Big Endian
  concatenate  cl_abap_char_utilities=>BYTE_ORDER_MARK_BIG
               l_xstring
               into l_xstring in byte mode.

Regards

Raja