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: 

Char to BIN/RAW conversion

Former Member
0 Kudos

Hi

Does anybody know any function module/method/class to convert character variable to a binary/raw type variable ?

I am working on R/34.7 .

Regards

Yogesh

Message was edited by: Yogesh Joshi

2 REPLIES 2

suresh_datti
Active Contributor
0 Kudos

Hi Yogesh,

Try SCMS_TEXT_TO_BINARY or SRET_TEXT_TO_BINARY

SO_RTF_TO_RAW or SO_RAW_CONVERT

Regards,

Suresh Datti

Former Member
0 Kudos

Hai Yogesh

Try with the following code

data : v_text(2) type c value 'A',

v_laiso(2) type c value 'EN',

v_xbuff(1) type x.

data : v_length type i.

CALL FUNCTION 'SRET_TEXT_TO_BINARY'

EXPORTING

TEXT = v_text

  • TEXT_LENGTH = -1

LAISO = v_laiso

  • IV_CATID = ' '

  • IV_RFC_FOR_INITIALIZE = ' '

IMPORTING

OUTPUT_LENGTH = v_length

XBUFFER = v_xbuff

EXCEPTIONS

FAILED = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

write : / v_length,

v_xbuff.

Thanks & Regards

Sreenivas P