cancel
Showing results for 
Search instead for 
Did you mean: 

Convert BINARY code to TEXT

Former Member
0 Kudos

Hai all,

i have one abap stmt which submits the report and exports list to memory.

then i have read list from memory using LIST_FROM_MEMORY

function. then i got data in binary format

now i want to convert this data into text format

(list is displaying correctly while using write_list and display_list functions)

i used SCMS_BINARY_TO_TEXT function but i am not getting anything.

please share an idea if you have come accross this situation,

thanks,

Accepted Solutions (0)

Answers (4)

Answers (4)

athavanraja
Active Contributor
0 Kudos

1. submit report exporting list to memory.

2. to get the output from memory

call function 'LIST_FROM_MEMORY'

tables

listobject = int_listobject

exceptions

not_found = 1.

3. to convert the list in binary format to text (ASCI)

call function 'LIST_TO_ASCI'

tables

listasci = int_listascii

listobject = int_listobject

exceptions

others = 1.

you dont need to use SCMS_BINARY_TO_TEXT

Regards

Raja

athavanraja
Active Contributor
0 Kudos

Hi innu pasala ,

If your question is answered, can you reward points to helpful answers by choosing appropriate radiobuttons in the answers and mark the thread as answered.

Regards

Raja

Former Member
0 Kudos

Hai all,

hope i explained my requirement wrongly...

actual requirement is when we submit a report

using EXPORT LIST TO MEMORY, then we 'll be able to read list from memory using LIST_FROM_MEMORY Function.

upto this i am ok.

i need the list in OTF Format..

Thanks in advance,

athavanraja
Active Contributor
0 Kudos

list you cannot convert to OTF.

if you have exported OTF ot memory you can us

READ_OTF_FROM_MEMORY

SAVE_OTF_TO_MEMORY

Regards

Raja

athavanraja
Active Contributor
0 Kudos

may be try this (i havent tried it myself)

submit report

list from memory

list to asci

now call CONVERT_OTF

call function 'CONVERT_OTF'

exporting format = 'ASCII'

max_linewidth = max_linewidth

ascii_bidi_vis2log = 'X'

importing bin_filesize = len

tables otf = content_txt

lines = content_out

exceptions err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

others = 4.

in the lines table parameter pass the asci table from list to asci

Regards

Raja

sbhutani1
Contributor
0 Kudos

Hi innu,

You can try

SCMS_BINARY_TO_STRING for this purpose

Regards

Sumit Bhutani

Former Member
0 Kudos

Hii

<b>SCMS_BINARY_TO_STRING .</b>

if you want the resulting string to be in an itab.

declare a itab type string.

data: stringtab type standard table of string.

append <result string from FM> to stringtab .

or

Use below function module inorder to convert as string from a given internal table .

CALL FUNCTION <b>'SCMS_TEXT_TO_XSTRING'</b>

  • EXPORTING

  • FIRST_LINE = 0

  • LAST_LINE = 0

  • MIMETYPE = ' '

IMPORTING

BUFFER = lv_XSTRING

TABLES

TEXT_TAB = LT_TEXT_OUT

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.

athavanraja
Active Contributor
0 Kudos

use FM LIST_TO_ASCI to convrt to text.

Regards

Raja