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

binary mode to text mode

Former Member
0 Likes
1,787

hi i am reading one file from application server. that is in binary mode .

i want to get it in text mode .how can i convert this ?

give your ideas.

10 REPLIES 10
Read only

Former Member
0 Likes
1,402

do u want to download it?

use cg3y and select ASC type instaed of BIN to get it in text mode

Read only

Former Member
0 Likes
1,402

hi,

use open dataset for input in text mode statement

Read only

abdul_hakim
Active Contributor
0 Likes
1,402

Hi

Use the below statement

OPEN DATASET <filename> FOR INPUT IN TEXT MODE ENCODING DEFAULT.

Cheers,

Hakim

Read only

mahaboob_pathan
Contributor
0 Likes
1,402

hi,

use

OPEN DATASET v_file FOR INPUT IN TEXT MODE ENCODING DEFAULT IGNORING CONVERSION ERRORS.

WHILE sy-subrc = 0.

READ DATASET v_file INTO l_data.

Read only

mahaboob_pathan
Contributor
0 Likes
1,402

hi,

OPEN DATASET v_file FOR INPUT IN TEXT MODE ENCODING DEFAULT IGNORING CONVERSION ERRORS.

READ DATASET v_file INTO l_data.

Read only

Former Member
0 Likes
1,402

Hi

Refer This Link [Convert BINARY code to TEXT|]

Ranga

Read only

Former Member
0 Likes
1,402

Hi

You can check the function module 'SCMS_BINARY_TO_TEXT' which will resolve your problem.

Refer This Link [Convert BINARY code to TEXT|]

Ranga

Read only

Former Member
0 Likes
1,402

OPEN DATASET wfilepath FOR OUTPUT.

would be replaced with

OPEN FOR OUTPUT DATASET wfilepath FOR OUTPUT IN TEXT MODE

OR

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = t_list

EXCEPTIONS

not_found = 1.

*****TEXT MODE

CALL FUNCTION 'LIST_TO_ASCI'

TABLES

listasci = o_list " list converted to ASCII

listobject = t_list

EXCEPTIONS

empty_list = 1

list_index_invalid = 2

OTHERS = 3.

Read only

0 Likes
1,402

hi is it in binary mode .i want this in text mode.when i read and write it comes like this,

/µÇRÛ#ÚC©#¥¶½nÿ#êËë··ó´KúcþÎS0ä×jÜ#f·×#¹#Q# ~©^uZÏkµï

_#ÛÛf6!½ó#óØï#NçÑáÿ#GeÓó###ò#÷NÉY###1V¯##¹*QiÛä×#ö#Ð0

qØq!/U­¼(~Ù$,)#õüå£#?å#Ë#bv#,>#=LF##sS#ùÚÏèµZ`»ZjÔ=äf

K#Ü,###8#íìZjî]ªä##Ü#Å##ò##GU.UrÑC9¹=Õ#®L.z('÷0;#ì<êë

:^#¼]$wüa#GU.Uò#@n¹#Ò#¹#¢ÚN@#¼[FÎ#Ñ×óªä½#r<áÛ¸#Þç#XFÎ

*¹è¡#¹Þù©N.z¨#xÈѳDÜH#\u00F4Pn<1##áÐ##ß#ízøn¯R%#=tè¥6ÄMôÁ

¥yl#R%#=tEÎw#Q#W±#ÉÛ¢#¦&¤ÙÿUÉE#M^`Í#"UrÑCSrÍ#]#\u00F4Ð#üÛ

II#3Ý@$$¡æk#P¶»('iÒURgâÌ4ýµ®úi#()"@#Wd¢:#}Vö#ç#¸¸/#rÝ

Õ~ûH°Ë#±&k##믹nÅEA#S#Z]Ûà#:W`ÖA¯íï²÷þ¶øö1C.Ùm#ho#ÖÏÁ

é{¦> >îV'ø#çy¬¤¥°ç#Ï#õ#¨#Ís>Tý#T#KÓ#¶j## >#Õ#±PíÞ õ#P

#U©#YÓ##ª#±*ÕsÞáò#:#«R½°#ª#ª#±#ólnóF#@##Õ##ëh#íÒ¸ôÊóõ

#¸Õ#¿÷tüÔsÉ#ß^½v£Û?ÿx}ûüån+#K¸a#«í#8¢V¿©mG÷¸ã#áöZ¸¡Q

j#¬9#òr #fá####¦Û$kÞ#<éÕ]Ã###Óm#5÷#PG+â6É##y(d$&#ÛãI

#6i##®VΪRX##¼W9«¸#߯###Gf#Ëý##ÁÕòMÏÒ¯#³#L6IÁñb¯»5#Û##

Edited by: sudheer b on Dec 3, 2008 1:04 PM

Read only

Former Member
0 Likes
1,402

how should ur programm know what kind of data this is?

use a suitable conversion routine

open dataset in binary mode into corresponding binary table.

then convert the data with a FM depending on ur datatyp

Regards

Stefan Seeburger