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

Convert Binary Format to Text Format

Former Member
0 Likes
3,421

Hello,

I have a binary file (format 0 and 1) and I need to convert it to a text format.

I surch this forum and I tryed some solutions and I didn't have good results.

For example, in the bin file I have '00110001 00110010 00110011' and I should return '123'... but I am not to obtain the expected result.

Can you help me, please.

Best Regards,

Joana Leitner Gaspar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,444

Use FM

SCMS_BINARY_TO_TEXT

SRET_BINARY_TO_TEXT

Hope this helps...

6 REPLIES 6
Read only

Former Member
0 Likes
1,445

Use FM

SCMS_BINARY_TO_TEXT

SRET_BINARY_TO_TEXT

Hope this helps...

Read only

Former Member
0 Likes
1,444

Hi Joana,

try below,


DATA rec TYPE string.
CALL FUNCTION 'SCMS_BINARY_TO_STRING'
EXPORTING
input_length = 32000
FIRST_LINE = 1
LAST_LINE = 28

MIMETYPE = ' ' 
IMPORTING
text_buffer = rec

OUTPUT_LENGTH = 
TABLES
binary_tab = l_pdf
EXCEPTIONS 
FAILED = 1 
OTHERS = 2 

hope this may useful.

Regards!

Read only

Former Member
0 Likes
1,444

Hi ,

To convert Binary format to text use the Function Module:

SCMS_BINARY_TO_TEXT

Regards,

Radhika.

Read only

Former Member
0 Likes
1,444

hi,

check this thread

hope it helps you.

thanks

Sachin

Read only

Former Member
0 Likes
1,444

Thank you all for your help... But... using your ideas I don't obtain correct values.

Any ideas? I'm going to be crazy with this!!

Best Regards,

Joana

Read only

0 Likes
1,444

try using cg3y and cg3z tr. use appropriate formats BIN and ASC.