Encoding in UNIX

I am trying to print unicode characters from my java program to unix console, even though my default file encoding is UTF8, My character is printing garbage.
here is my program and the output
System.out.println(System.getProperty("file.encoding"));
OutputStreamWriter osw = new OutputStreamWriter(System.out);
osw.write("\u0c37");
osw.flush();
The output is
UTF-8
���s
Any thoughts on how to print the character i want?

The default encoding being utf-8 does not mean that the console font can display all UNICODE characters. You need to set the console font to one that has glyphs for the characters you want to display.

Similar Messages

  • Writing to file with specific encoding in unix

    hi,
    I want to write html files which contain Turkish characters in unix operating system.
    I'm currently using FileWriter to write the files.
    I'm getting the file content from the database and I can see that the characters seem to be fine but when I write them into an html file, they are displayed with the question mark character (?).
    What can I do about this?
    Thanks

    FileWriter uses the default character encoding of whatever platform your program is running on. Beside the fact that the default encoding may vary from one machine to another, it may not be suitable for storing non-ASCII (Turkish) characters.
    Rather than using FileWriter, you can use an OutputStreamWriter and a FileOutputStream, which allows you to specify the character encoding you want. UTF-8 is generally a good choice, since it can encode just about anything. For example:FileOutputStream fos = new FileOutputStream("/some/file/name");
    OutputStreamWriter osw = new OutputStreamWriter(fos, "utf-8");
    osw.write("your text with Turkish characters...");Geoff

  • Force same character encoding in UNIX as in Windows

    My program reads a simple text file and outputs the same on the console. The file contains special characters like àéèéàöäül etc. The goal of this exercise is to make java recognize special characters both on the UNIX and on the Windows system in the same manner.
    I wrote the program on a Windows machine and then transferred the class file to the UNIX system and ran it there. It is giving two different outputs for the different systems.
    Here is the code
    public class LocaleFile {
    public static void main(String [] args ) throws IOException{
    System.out.println("Deafult Locale :: "+Locale.getDefault());
    System.out.println("Deafult Characterset :: "+Charset.defaultCharset());
    System.out.println("Resetting defailt local to de_DE ... ");
    Locale newLocale=new Locale(Locale.GERMAN.toString(), Locale.GERMANY.toString());
    Locale.setDefault(newLocale);
    System.out.println("After resetting Locale :: "+Locale.getDefault());
    BufferedReader bufferedReader=new BufferedReader( new InputStreamReader( new FileInputStream("helloworld.txt"), "ISO-8859-15"));
    String line=bufferedReader.readLine();
    do{
    System.out.println(line);
    line=bufferedReader.readLine();
    while(line!=null);
    bufferedReader.close();
    Windows Output
    Deafult Locale :: de_CH
    Deafult Characterset :: ISO-8859-1
    Resetting defailt local to de_DE ...
    After resetting Locale :: de_DE_DE
    Character set 1: Arijit
    Character set 2: è!éà£
    Character set 3: ü?öä$
    Character set 4: []{}
    End of Test
    UNIX Output
    bash-3.00$ java LocaleFile
    Deafult Locale :: en
    Deafult Characterset :: US-ASCII
    Resetting defailt local to de_DE ...
    After resetting Locale :: de_DE_DE
    Character set 1: Arijit
    Character set 2: ?!???
    Character set 3: ????$
    Character set 4: []{}
    End of Test
    bash-3.00$
    *Structure of helloworld.txt*
    Character set 1: Arijit
    Character set 2: è!éà£
    Character set 3: ü?öä$
    Character set 4: []{}
    End of Test
    Hope to hear from you soon guys.
    Thanks
    Arijit

    gimbal2 wrote:
    Just a thought, but I'd say that it is the character encoding of the command/bash prompt that is misleading you here. It probably actually has nothing to do with the code or the data, just the way the OS is displaying it.
    edit: ninja'd by Baftos. :)*@gimbal2*
    Well, thank you. That did raise a doubt. I changed the program slightly to write to a file say "recorded.txt" instead of printing it to the console.
    Code
    BufferedReader bufferedReader=new BufferedReader( new InputStreamReader( new FileInputStream("helloworld.txt"), "ISO-8859-15"));
    BufferedWriter bufferedWriter=new BufferedWriter( new OutputStreamWriter(new FileOutputStream("recorded.txt")));
    String line=bufferedReader.readLine();
    do{
    bufferedWriter.write(line.toString());
    System.out.println(line);
    line=bufferedReader.readLine();
    while(line!=null);
    bufferedReader.close();
    bufferedWriter.close();
    However the output remained the same

  • Character encoding in unix environment.

    Hi,
    Users try to download files from my application. These files are uploaded by others. They may contain characters from foreign languages as well. The file names are displayed properly on the screen, but when the user clicks on the link to download the file, the servlet set-up to read the file path is unable to read the file name on UNIX with jdk1.5.0_06. The same piece of code works perfectly well on windows with same jdk.
    This is how i get the file name from the request:
    String filePath = new String((httpRequest.getServletPath() + httpRequest.getPathInfo()).getBytes("ISO8859_1"), "UTF-8");
    Same line of code throws out junk characters in unix.
    Please advice
    ~sandeep

    I would like to add that in the windows environment, the application is deployed on tomcat 5.x, but on the production (unix) machine, the request is routed through apache http server onto the tomcat server. Does this make any difference?

  • Character Encoding and File Encoding issue

    Hi,
    I have a file which has a data encoded using default locale.
    I start jvm in same default locale and try to red the file.
    I took 2 approaches :
    1. Read the file using InputStreamReader() without specifying the encoding, so that default one based on locale will be picked up.
    -- This apprach worked fine.
    -- I also printed system property "file.encoding" which matched with current locales encoding (on unix cooand to get this is "locale charmap").
    2. In this approach, I read the file using InputStream as an array of raw bytes, and passed it to String contructor to convert bytes to String.
    -- The String contained garbled data, meaning encoding failed.
    I tried printing encoding used by JVM using internal class, and "file.encoding" property as well.
    These 2 values do not match, there is weird difference.
    For e.g. for locale ja_JP.eucjp on linux box :
    byte-character uses EUC_JP_LINUX encoding
    file.encoding system property is EUC-JP-LINUX
    To get byte to character encoding, I used following methods (sun.io.*):
    ByteToCharConverter btc = ByteToCharConverter.getDefault();
    System.out.println("BTC uses " + btc.getCharacterEncoding());
    Do you have any idea why is it failing ?
    My understanding was, file encoding and character encoding should always be same by default.
    But, because of this behaviour, I am little perplexed.

    But there's no character encoding set for this operation:baos.write("���".getBytes());

  • Oracle Export Utility

    Hi I have to export data from Oracle 9i to unix in flat file.
    My data in oracle is having Chinese Traditional and User defined word along with English words. I am using Oracle 9i database.
    In Oracle its in UTF8 encoding and i have to export data in BIG5 encoding in Unix.
    Please tell me the possible ways to export data from Oracle to Unix with encoding conversion(UTF-8 to BIG 5).
    Thanks for help in advance.
    Rgds,
    Anshu

    Hi Sergiusz,
    Thanks for reply.
    When i tried on DB that was on Solaris 8, it was no working and all Double Byte char were becoming as ?.
    But when i tried on DB that was on Solaris 10, It was giving correct values and this DB has following NLS_DATABASE_PARAMETERS values:
    NLS_NCHAR_CHARACTERSET : AL16UTF16
    NLS_CHARACTERSET : AL32UTF8
    If i have one DB which have following NLS_DATABASE_PARAMETERS values:
    NLS_NCHAR_CHARACTERSET : UTF8
    NLS_CHARACTERSET : UTF8
    Then still it will work fine?
    I can not check this on above DB(that having NLS_NCHAR_CHARACTERSET and NLS_CHARACTERSET as UTF8) as its productiona and i dont have access to test it.
    Pls suggest.
    Thanks in advance.
    rgds,
    Anshu

  • Oracle Export Utilty

    Hi I have to export data from Oracle 9i to unix in flat file.
    My data in oracle is having Chinese Traditional and User defined word along with English words. I am using Oracle 9i database.
    In Oracle its in UTF8 encoding and i have to export data in BIG5 encoding in Unix.
    Please tell me the possible ways to export data from Oracle to Unix with encoding conversion(UTF-8 to BIG 5).
    Thanks for help in advance.
    Rgds,
    Anshu

    You can not export this via exp utility.
    you have to write your own procedures or sql scripts to transform the data in the palin file format or SDF format
    but you have to open the file in binary form and save that in binary itself.
    You have to Use PRO*C to perform this operation.
    or you may user java program as
    change the insert sql statement in my JAVA program, by including convert function to convert 1 encoding to BIG5 encoding (my Oracle is BIG5).
    java program to get local encoding
    System.getProperty ("file.encoding"), it gives 'WE8ISO8859P15'.
    So change the INSERT sql to include conversion from 'WE8ISO8859P15' to BIG5 -->
    vlSqlQuery = "INSERT INTO anytable (str_myfield) VALUES (convert " str_myfield ", 'WE8ISO8859P15', 'ZHT16BIG5'))";
    str_myfield is data read from any txt file
    The result can be tested from 'UTF8', 'AL32UTF8', 'AL16UTF16', 'US7ASCII', 'UTFE' to 'ZHT16BIG5'
    Just try
    Good Luck

  • Released :: Web Server 6.1 SP11

    We are delighted to announce that Web Server 6.1 SP11 has been released. It can be publicly downloaded at:
    https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_SMI-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=SJWS-6.1-SP11-OTH-G-F@CDS-CDS_SMI
    The Release Notes are here: http://docs.sun.com/app/docs/doc/820-7659
    This service pack addresses around 15-bugs, which are mostly customer escalated issues. All users of Web Server 6.1 through Web Server 6.1 SP10 are encourage to upgrade.
    Thank you to the entire product team for another great release!
    On Behalf of WS Team!

    I did not understand very well what you told me.
    The directory server is on another machine ex(m1).
    I have other web server on another machine ex(m2). This web server working properly (solaris 10). And when I access to application, ldap error does not appear.
    This web server (windows, SP11), is installed on my PC.
    The ldap configuration on this instance is the same as another web instance (dbswitch.conf):
    directory default ldap://m1:port/<base dn>
    default:binddn <bind dn>
    default:encoded bindpw <passwd>
    From my PC I can communicate well with the server ldap, I used a ldap administration program, and users and groups tab of my web server (windows).
    I open a browser on my PC, and if I access the other web server works fine.
    if I access to my web server, the ldap error appear...
    There are commands to diagnose problems with ldap, something about the character encoding windows-unix?
    Thanks in advance

  • Error ldap Java System Web Server 6.1 SP11 Windows

    Hi,
    I have installed a web server SP11 windows, and the global settings I have configured correctly a ldap server.
    In User and Groups access to all users of the ldap server.
    In my web instance, I have configure the application to autenticate to this ldap server:
    acl "default";
    authenticate (user,group) {
    database = "default";
    method = "basic";
    prompt = "prompt";
    When I go with a browser, appears the user and password window.
    When I introduce user/password, in browser:
    Server Error
    This server has encountered an internal error which prevents it from fulfilling your request. The most likely cause is a misconfiguration. Please ask the administrator to look for messages in the server's error log.
    And the logs errors of the web instance:
    [11/Mar/2011:17:25:01] security ( 6088) https-webinstance:
         [NSACL4330] HTTP5094: while trying to get attribute "user"
         [NSACL4330] HTTP5094: while trying to get attribute "isvalid-password"
         [NSACL5860] HTTP5113: ldap password check: LDAP error: "Can't connect to the LDAP server"
         [NSACL4330] HTTP5094: while trying to get attribute "user"
    [11/Mar/2011:17:25:01] security ( 6088) https-webinstance: for host trying to GET /uri/servlet/ServletIni, acl-state reports: HTTP5187: access of ... denied because evaluation of ACL default directive 1 failed
    This error at solaris not appear...
    I need help...
    Thanks
    Jorge

    I did not understand very well what you told me.
    The directory server is on another machine ex(m1).
    I have other web server on another machine ex(m2). This web server working properly (solaris 10). And when I access to application, ldap error does not appear.
    This web server (windows, SP11), is installed on my PC.
    The ldap configuration on this instance is the same as another web instance (dbswitch.conf):
    directory default ldap://m1:port/<base dn>
    default:binddn <bind dn>
    default:encoded bindpw <passwd>
    From my PC I can communicate well with the server ldap, I used a ldap administration program, and users and groups tab of my web server (windows).
    I open a browser on my PC, and if I access the other web server works fine.
    if I access to my web server, the ldap error appear...
    There are commands to diagnose problems with ldap, something about the character encoding windows-unix?
    Thanks in advance

  • Base64Encode ==

    Hello.
    Just a quick question on Base64Encoding and MD5.
    I'm hashing passwords, then encoding to stuff into DB. All of my encoded data ends in '=='
    example:
    LN2vQZp6JLpt+b3xFInn2A==
    Can anyone tell me why they all end in '==' ?
    Thanks in advance.
    Vic.

    I have a question I am currently using MD5 to hash passwords and Base64Encoder to encode the string before inserting it in the database. I have a probelm though, I used UTF-8 to make the password platform independent for both Java on Windows and Java on Unix. However, it is not working...when the user creates a user on the Unix platform and tries to log in with that userid/password which was hashed/encoded on Unix platform, in a Windows platform, the password is different from what was stored on the Unix platform and what is passed in from the user hashed and encoded on the Windows platform. Do you have a solution for this. Here is my code below. Please HELP! Thanks so much!
    public String doIt(String test) {
    try {
    sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
    secret = new String(encrypt(test));
    //System.out.println("the encrypted result : " + secret);
    encoded=encoder.encode(secret.getBytes());
    System.out.print("Here is the encoded string in LIMDBO" + encoded);
    boolean ok = true;
    //String s = "";
    } catch (Exception e) {
    e.printStackTrace();
    return encoded;
    static byte[] encrypt(String x) throws Exception {
    java.security.MessageDigest d = null; //comment
    d = java.security.MessageDigest.getInstance("MD5"); //comment when released
    // d = java.security.MessageDigest.getInstance("SHA"); uncomment when released
    d.reset();
    d.update(x.getBytes("UTF-8"));
    return d.digest();
    }

  • MASSIVE Unix Encoding Problem

    Hi!
    Thanks to anyone in advance who tries a suggestion with this problem:
    I have a database (PostgreSQL, Encoding UNICODE) which stores a TEXT, which has a certain format. The problem with this format is, that I used as a end delimiter the section sign "�". This works very nice under windows, but unter unix, it doesn't get the delimiter.
    Here are some codesnippets to show you, what's going on:
    Resultset rs;
    String encodedText = rs.getString("text")
    [transferred to the GUI]
    public static final char DELIM_END = '�';
    [that was pretty stupid]
    BufferedReader = new BufferedReader(new StringReader(encodedText));Then I read the BufferedReader in for the delim signs, but the end sign is never found, which makes it pretty ugly as you can imagine. Under Unix (Linux or Mac) the sign, which is in the encodedString, when I debug my application is the "currency sign" (Unicode: 00A4, you can see it at http://www.decodeunicode.org/ when you typ in "00A4"). Interestingly the section sign has the unicode 00A7.
    I tried now so many different types of streams with different code pages and so on. Does anyone have an idea what I could do about this???

    Hi!
    Thanks to anyone in advance who tries a suggestion
    with this problem:
    I have a database (PostgreSQL, Encoding UNICODE)
    which stores a TEXT, which has a certain format. The
    problem with this format is, that I used as a end
    delimiter the section sign "�". This works very nice
    under windows, but unter unix, it doesn't get the
    delimiter.
    Here are some codesnippets to show you, what's going
    on:
    Resultset rs;
    String encodedText = rs.getString("text")
    [transferred to the GUI]
    public static final char DELIM_END = '�';
    [that was pretty stupid]
    BufferedReader = new BufferedReader(new
    StringReader(encodedText));Then I read the BufferedReader in for the delim
    signs, but the end sign is never found, which makes
    it pretty ugly as you can imagine. Under Unix (Linux
    or Mac) the sign, which is in the encodedString, when
    I debug my application is the "currency sign"
    (Unicode: 00A4, you can see it at
    http://www.decodeunicode.org/ when you typ in
    "00A4"). Interestingly the section sign has the
    unicode 00A7.
    I tried now so many different types of streams with
    different code pages and so on. Does anyone have an
    idea what I could do about this???My Linux machine has no problem with the following code:
    char DELIM_END = '�';
    String test = "This is a test�of using the section symbol as a delimiter";
    java.io.BufferedReader br = new java.io.BufferedReader(new java.io.StringReader(test));
    StringBuffer sb = new StringBuffer();
    int i;
    while ((i = br.read()) != -1) {
        if ((char)i != DELIM_END) {
            sb.append((char)i);
        } else {
            System.out.println(sb.toString());
            sb.delete(0, sb.length());
    System.out.println(sb.toString());The output is:
    This is a test
    of using the section symbol as a delimiter

  • Encode/Decode string from unix shell

    Hi,
    I am not sure I'm addressing my question properly, but simply I have a stream where I send commands to a shell and when these commands come back from the input stream they don't mean anything as shown below:
    inc show int status | inc |1/7|1/17|1/19|1/^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H$atus | inc show int status | inc |1/7|1/17|1/19|1/1 ^H^H^H^H^H^H^H^H^H8|1/6|1/8^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H show int status | inc |1/7|1/17|1/19|1/18|1/6|1/8| ^H^H^H^H^H^H^H^H^H1/16|1/15^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^Hstatus | inc |1/7|1/17|1/19|1/18|1/6|1/8|1/16|1/15| ^H^H^H^H^H^H^H^H^H1/13|1/14^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^Hnc |1/7|1/17|1/19|1/18|1/6|1/8|1/16|1/15|1/13|1/14| ^H^H^H^H^H^H^H^H^H1/12|1/11^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H17|1/19|1/18|1/6|1/8|1/16|1/15|1/13|1/14|1/12|1/11| ^H^H^H^H^H^H^H^H^H1/9|1/10
    I am using the utf-8 for encoding...do I need to decode it and how?
    Here is part of my code:
    OutputStreamWriter writer = new OutputStreamWriter(sess.getStdin(), "utf-8");
    writer.write("my string");
    writer.flush();
    class StreamGobbler implements Runnable {
            InputStream is;
            OutputStream oi;
            String type;
            ResultBean resultBean;
            StreamGobbler(InputStream is, String type, ResultBean returnValue) {
                this.is = is;
                this.type = type;
                this.resultBean = returnValue;
            @Override
            public void run() {
                try {
                    InputStreamReader isr = new InputStreamReader(is, "UTF-8");
                    BufferedReader br = new BufferedReader(isr);
                    String line = null;
                    while ((line = br.readLine()) != null) {
                        //System.out.println("TYPE[" + type +  "] COMES FROM STD_OUT THREAD: " + line);
                        this.resultBean.addResultLine(line);
                        this.resultBean.addMessage(line);
                } catch (IOException ioe) {
                    System.out.println("IOE Exception in StreamGobbler");
                    ioe.printStackTrace();
        }Thanks in advance, i never dealt with encoding/decoding text.

    kminev wrote:
    I am pretty sure it is an encoding issue, I'm not convinced because ^H is the ASCII backspace character. Maybe not as I originally thought just some padding but it looks like some form of formatting done the old fashioned way using control characters.
    because if I also send this output in an email format and the email renders it a bit differently, then if I copy and paste the text to html page and render it on the screen it look as it is suppose to be.It's definitely not HTML so this does not seem logical.
    >
    Here are the ios commands I am issuing:
    show int status | inc |gi1/2|gi1/3|gi1/5
    then I send an empty string to the shell so if there is more prompt I see all the outputted values.
    Does that help in any way?
    ThanksSorry I can't help.
    Bye

  • Problems with string codification under unix

    Hi people,
    I'm trying to insert Latin caracters as � or � in a string, and trying to insert them into an excel page. Everything goes fine, untl those latin caracters are inserted. They are shown as a question mark (?). I tryed using a charset set to UTF-16 and ISO-8859-1, which is the ISO Latin Alphabet No. 1. But it still is shown as '?'.
    I think the problem might be in the unix codification.
    But have no idea really.
    Any help please?
    Thanks to everyone for your help.

    No, the original post mentioned Excel. That's a Microsoft product so it's unreasonable to expect it to understand ISO-8859 encodings. A Windows encoding would have a better chance of working.

  • How to download files from Application Server of Unix o.s to local director

    Hi All,
    I am trying to download files from Apllication server of Unix operating Systems to local file in excel sheet format using a z-program.but whenever I am trying to use OPEN dataset ........
    it is showing sy-subrc = 8.
    Can I have any clew please.
    Thanks in advance,
    Regards,
    AMEER.

    Hi Sreekanth,
    Thanks a lot for quick reply.I have to download that files from z-program only. I am giving you my code below.
    *& Report  ZTRAK_DOWNLOAD                                         *
    REPORT  ZTRAK_DOWNLOAD  MESSAGE-ID ZCT                   .
    SELECTION-SCREEN BEGIN OF BLOCK DOWNLOAD WITH FRAME TITLE TEXT1.
      PARAMETERS :
           SERDIR LIKE RLGRAP-FILENAME DEFAULT '/usr/trak',
           LOCDIR LIKE RLGRAP-FILENAME DEFAULT 'C:\Trak'.
    SELECTION-SCREEN END OF BLOCK DOWNLOAD .
    SELECTION-SCREEN BEGIN OF BLOCK INFO2 WITH FRAME.
           SELECTION-SCREEN COMMENT 1(79) TEXT2.
           SELECTION-SCREEN SKIP.
           SELECTION-SCREEN COMMENT 1(79) TEXT3.
    SELECTION-SCREEN END OF BLOCK INFO2 .
    SELECTION-SCREEN BEGIN OF BLOCK INFO3 WITH FRAME.
           SELECTION-SCREEN COMMENT 1(79) TEXT4.
           SELECTION-SCREEN SKIP.
           SELECTION-SCREEN COMMENT 1(79) TEXT5.
            SELECTION-SCREEN SKIP.
           SELECTION-SCREEN COMMENT 1(79) TEXT6.
           SELECTION-SCREEN SKIP 1.
           SELECTION-SCREEN COMMENT 1(79) TEXT7.
           SELECTION-SCREEN SKIP 2.
           SELECTION-SCREEN COMMENT 1(79) TEXT8.
    SELECTION-SCREEN SKIP 1.
           SELECTION-SCREEN COMMENT 1(79) TEXT9.
    SELECTION-SCREEN END OF BLOCK INFO3.
    *- Internal Table to output data in Excel
    DATA: BEGIN OF tab_excel OCCURS 0,
            col1(50),
            col2(132),
            col3(255),
            col4(100),
            col5(100),
            col6(50),
            COL7(60),
            col8(30),
            col9(30),
            col10(30),
            col11(20),
            col12(15),
            col13(15),
          END OF tab_excel.
    DATA: FILE LIKE RLGRAP-FILENAME .
    DATA: W_DATASET(80).
    INITIALIZATION.
      TEXT1  = 'Download Reports'.
      TEXT2 = 'The Program downloads the reports generated by Trak'.
      TEXT3 = 'Utility from Server to Local PC.'.
      TEXT4 = 'Check the following before executing the Program.'.
      TEXT5 = '     1. A valid Server path is provided.'.
      TEXT6 = '     2. A valid Local PC path is provided.'.
      TEXT7 = '     3. Local PC has 10 MB free space.'.
      TEXT8 = 'The report can be executed in the forground.'.
    TEXT9 =
    'The report should be executed after execution of Transaction TRAK'.
    AT SELECTION-SCREEN.
    IF SERDIR EQ ''.
    MESSAGE E001(ZCT).
    ENDIF.
    IF LOCDIR EQ ''.
    MESSAGE E002(ZCT).
    ENDIF.
    START-OF-SELECTION.
    Download ABAP Development Summary Report
    FILE =  '\ABAP_Report_Developments.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/ABAP_Report_Developments.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download BDC Development Report
    FILE =  '\BDC_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/BDC_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Development Summary Report
    FILE = '\Developments_Summary_Report.XLS' .
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Developments_Summary_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Enhancement Development Report
    FILE =  '\Enhancement_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Enhancement_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download field exit Development Report
    FILE =  '\Field_Exit_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Field_Exit_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Frequency & Purpose Report
    FILE =  '\Frequency_And_Purpose_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Frequency_And_Purpose_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Function Group Developments Report
    FILE =  '\FunctionGroup_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/FunctionGroup_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Function Module Developments Report
    FILE = '\FunctionModule_Developments_Report.XLS' .
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/FunctionModule_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Include Developments Report
    FILE =  '\Include_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Include_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download UserGroup Developments Report
    FILE =  '\UserGroup_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/UserGroup_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Modified_Standard_SAP_Objects_Report
    FILE = '\Modified_Standard_SAP_Objects_Report.XLS' .
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Modified_Standard_SAP_Objects_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Include Developments Report
    *FILE =  '\Include_Developments_Report.XLS'.
    *CONCATENATE LOCDIR FILE INTO FILE.
    *W_DATASET = '/Include_Developments_Report.dat'.
    *CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    *PERFORM INIT.
    Download SAP Script Developments Report
    FILE =  '\SAP_Scipt_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/SAP_Scipt_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Transaction Developments Report
    FILE =  '\Transaction_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Transaction_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download User Exits Developments Report
    FILE =  '\UserExits_Reports.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/UserExits_Reports.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download ABAP Query Developments Report
    FILE =  '\ABAPQuery_Developments_Reports.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/ABAPQuery_Developments_Reports.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Functional Area Developments Report
    FILE =  '\FunctionalArea_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/FunctionalArea_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    MESSAGE S003(ZCT) WITH LOCDIR.
    END-OF-SELECTION.
    This routine checks whether file exists if yes downloads it to
    the Local PC
    FORM INIT.
    OPEN DATASET W_DATASET FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    DO.
       IF SY-SUBRC <> 0.
          EXIT.
       ENDIF.
       READ DATASET W_DATASET INTO  tab_excel.
       APPEND tab_excel.
       CLEAR tab_excel.
    ENDDO.
         PERFORM DOWNLOAD_FILE.
    ENDFORM.
    This routine downloads the data in an XL format on local PC
    FORM Download_File .
      CALL FUNCTION 'WS_DOWNLOAD'
                EXPORTING
                     FILENAME                = FILE
                     FILETYPE                = 'DAT'
                TABLES
                     DATA_TAB                = tab_excel
                EXCEPTIONS
                     FILE_OPEN_ERROR         = 1
                     FILE_WRITE_ERROR        = 2
                     INVALID_FILESIZE        = 3
                     INVALID_TYPE            = 4
                     NO_BATCH                = 5
                     UNKNOWN_ERROR           = 6
                     INVALID_TABLE_WIDTH     = 7
                     GUI_REFUSE_FILETRANSFER = 8
                     CUSTOMER_ERROR          = 9
                     OTHERS                  = 10.
        IF sy-subrc <> 0.
         message ''.       " Error in file transfer
        ELSE.
          CLEAR TAB_EXCEL.
          REFRESH TAB_EXCEL.
          FILE = ''.
          W_DATASET = ''.
        ENDIF.
    ENDFORM.
    I have created those files in Application Server running in another z-program in background mode.Then I am trying to download those files using above the program.I am creating those trak/Trak files manually and I can able to see those files in A.S level.But when downloading the same files I am facing the problem.
    regards,
    Ameer

  • Code page issue - Unix file(s) content display in a report output

    Hi All,
    I am trying to retrieve file from Unix server and display in my report output.
    I have written code as below:
    OPEN DATASET filename FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      DO.
        READ DATASET filename INTO i_tab-line.
      ENDDO.
    CLOSE DATASET.
    1. Now i am able to display files of type .txt in report output but with line numbers above each line.
    How can i avaoid it! I want to display as it looks in AL11 view.
    2. If i am displaying files of type .PDF it is giving dump with below message:
    A character set conversion is not possible.
    At the conversion of text from code page '4110' to '4102' is not possible.
    - a character was found that cannot be displayed in one of the two code pages;
    - or it was detected that this conversion is not supported.
    How can i display the .PDF (or) all types of files in my report as it is viewable in AL11.
    Can anybody solve this this.
    I have tried UTF-8 & NON-UNICODE options with ENCODE also they are also giving same dump.
    Can anybody resolve these issues!
    Thanks in advance.
    Thanks,
    Deep.

    Hi All,
    Any resolution for above posted issue!
    Thanks,
    Deep.

Maybe you are looking for

  • How to use open query in oracle select statement

    hi i have a requirement like this. I need to use the output of a procedure ( pl/sql table ) in developing a report like  (  SELECT * FROM <procedure name >) please help me.

  • Configuration steps for Quality and Batch Management.

    Hi Friends, We are implementing QM along with Batch Management for testing the material like purity,pathology tests. I am new to Quality and Batch Management. Could any one guide me, how to configure material master for QM and Batch to test the mater

  • Regarding message_type_x

    Hi Experts, During Upgrade from version 4.6c to Ecc6.0 I am facing the following runtime error with the standard include LKKBFF01. The error is due to MESSAGE_TYPE_X in the LKKBFF01. MESSAGE X000(0K) WITH L_MESSAGE L_LINE L_WORD. Can any one give the

  • Easy question about capturing audio

    Forgive me if this sounds noobish.... I would just like to know what kind of audio file Soundtrack Pro WRITES, not what kind of files it can export to. I'm just trying to save a step and eliminate the exporting time. Thanks!

  • Macbook pro - slow in opening folders

    Dear  All My Macbook pro is very slow in oening folders, it does not open immediatly as you would expect and takes about 30s or more. Please help! Here is the spec: OS X 10.8.3 2,3 Gz Intel Core i7 8GB 1600 MHz DDR3