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: 

binary mode to text mode

Former Member
0 Kudos

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

Former Member
0 Kudos

do u want to download it?

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

Former Member
0 Kudos

hi,

use open dataset for input in text mode statement

abdul_hakim
Active Contributor
0 Kudos

Hi

Use the below statement

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

Cheers,

Hakim

mahaboob_pathan
Contributor
0 Kudos

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.

mahaboob_pathan
Contributor
0 Kudos

hi,

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

READ DATASET v_file INTO l_data.

Former Member
0 Kudos

Hi

Refer This Link [Convert BINARY code to TEXT|]

Ranga

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

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