Change character set used to write a file in application server.

Hello Experts,
                   I want to know if we can change the character set used to create a file in application server.(Is it posible to use a particular character set while creating a file in application server.
                  I will be very great full for any help.
Thanks in advance.
Sharath

Hello Sarath,
There is an extension CODE PAGE with OPEN DATASET stmt.
Can you please elaborate which character set you want to write to the application server?
BR,
Suhas

Similar Messages

  • Read PDF Formatted Spool and write PDF File to Application Server

    Hi Experts,
    After ECC 6.0, HR-W2 and W2C Form Spools are getting generated in PDF format.
    We have a requirement wherein we want to read the PDF Spool Programatically and write the PDF file to Application server (Using OPEN DATASET and CLOSE DATASET)
    PARAMETERS : p_spono LIKE tsp01-rqident.
    DATA: pdf_data type FPCONTENT.
    types: lt_pdf_table(1000) type x.
    data:  l_pdf_data type standard table of lt_pdf_table,
           l_pdf_line type lt_pdf_table,
           l_offset type i,
           l_len type i,
           p_file(100) VALUE '\sapout\DVH\pdf2.pdf'.
    *Read the spool content
    CALL FUNCTION 'FPCOMP_CREATE_PDF_FROM_SPOOL'
        EXPORTING
             i_spoolid = p_spono
             i_partnum = '1'
        IMPORTING
               e_pdf = pdf_data
    *         e_pdf_file = file
        EXCEPTIONS
             ads_error = 1
             usage_error = 2
             system_error = 3
             internal_error = 4
        OTHERS = 5.
    * Modify the spool  contents to prepare internal table
      l_len = xstrlen( pdf_data ).
      while l_len >= 1000.
        l_pdf_line = pdf_data+l_offset(1000).
        append l_pdf_line to l_pdf_data.
        add 1000 to l_offset.
        subtract 1000 from l_len.
      endwhile.
      if l_len > 0.
        l_pdf_line = pdf_data+l_offset(l_len).
        append l_pdf_line to l_pdf_data.
      endif.
    * GUI DOWNLOAD Works Fine
    * Now pdf contents is ready , lets store in local PC
    *CALL FUNCTION 'GUI_DOWNLOAD'
    *  EXPORTING
    *   filename                        = 'C:\Documents and Settings\Desktop\shital.pdf'
    *   filetype                        = 'BIN'
    *  TABLES
    *    data_tab                        = l_pdf_data.
    OPEN DATASET p_file FOR OUTPUT IN BINARY MODE.
    IF sy-subrc <> 0.
      MESSAGE ID '00' TYPE 'E' NUMBER '398' WITH 'sy-subrc:' sy-subrc
              ' Error opening file:'(Z03) p_file.
    ENDIF.
    LOOP AT l_pdf_data INTO l_pdf_line.
      TRANSFER l_pdf_line TO p_file.
    ENDLOOP.
    CLOSE DATASET p_file.
    IF sy-subrc <> 0.
      MESSAGE ID '00' TYPE 'E' NUMBER '398' WITH 'sy-subrc:' sy-subrc
              ' Error closing file:'(Z04) p_file.
    ENDIF.
    Currently as you can see I have commented out GUI_DOWNLOAD Function Module, But it works perfect when I try to Download file to Local Desktop.
    But when I try to pass the same Contents to Application server file and then try to open it by downloading file then it opens BLANK pdf file.
    As per requirements I should be able to write the file correctly on Application server and If I dowload it from there it should open PDF file correctly.
    Let me know if you require further details about the issue.
    Regards
    Shital
    Edited by: shital phadake on Apr 8, 2009 9:39 PM

    Thanks Selçuk for your reply and taking time for understanding the Issue,
    I went thru Functionality of the program you suggested but dont think it matches my requirement.
    Regards
    Shital

  • Write PDF file into application server.

    Hi Gurus,
    I have created a smartform and converted into PDF using function module as given below. Now I want to write this generated PDF file into application server. I am not generating any spool request too. How can I proceed from here?  Pls advice..
    CALL FUNCTION 'CONVERT_OTF_2_PDF'
        IMPORTING
          bin_filesize                 = lv_bin_filesize
        TABLES
          otf                              = ls_job_output_info-otfdata
          doctab_archive         = lt_docs
          lines                           = lt_lines
        EXCEPTIONS
          err_conv_not_possible  = 1
          err_otf_mc_noendmarker = 2
          OTHERS                 = 3.
    Thanks..
    Saj

    transfer all the data from ur itabs to one final itab declared as follow
    DATA: BEGIN OF final_itab OCCURS 0,
                     document  TYPE string,
               END OF final_itab.
    then finally,
    OPEN DATASET 'yourfile.pdf' FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      len = strlen( final_itab-DOCUMENT ).
      TRANSFER final_itab-DOCUMENT  TO 'yourfile.pdf'  LENGTH len.
    CLOSE DATASET 'yourfile.pdf'.
    This ends the coding mate.
    Enjoy it n have a good day.
    Cheers

  • Use of Open and close data set in to pick up files from application server

    Hi,
    As per my earlier posts i m making a programm which will pick excel sheet from application server and make auto PR by bapi and this all process will be handle by background processing (SM36, SM37). My concer is all proces are working fine but my files are not been picked by application server , when run on my own machine everything is working fine.I never used OPENDATA SET command before , so i have no idea how it will be used , can anyone provide me details with my set of codes where it should be used ....
    sou_dir_name = 'Y:\Sucess\'.
    tar_dir_name = 'Y:\destination\'.
    Open dataset sou_dir_name for input in text mode encoding default.
    if sy-subrc eq 0.
       do.
           read dataset sou_dir_name into file_table.
       if sy-subrc ne 0.
         exit.  " end of file.
    enddo.
    endif.
    CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
      EXPORTING
        DIRECTORY  = sou_dir_name
        FILTER     = '.'
      IMPORTING
        FILE_COUNT = file_count
        DIR_COUNT  = dir_count
      TABLES
        FILE_TABLE = file_table
        DIR_TABLE  = dir_table
      EXCEPTIONS
        CNTL_ERROR = 1
        OTHERS     = 2.
    IF SY-SUBRC <> 0.
    ENDIF.
    loop at file_table into wa_file_table.
    clear  :  strr , str1 , str2 , str3 .
      strr = wa_file_table-PATHNAME .
      concatenate sou_dir_name strr into str1 .
      concatenate tar_dir_name strr into str2 . " success
      concatenate tar_dir_name1 strr into str3 .         " failed
    FILE = STR1 .
    *start-of-selection.
    *&  Function For Retrieve Data From Excel
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = FILE
        i_begin_col                   = col_start
        i_begin_row                   = row_start
        i_end_col                     = col_end
        i_end_row                     = row_end
      tables
        intern                        = excel_bdcdata
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 2
       OTHERS                        = 3.
      IF sy-subrc NE 0.
    WRITE : / 'File Error'.
    EXIT.
    ENDIF.
      loop at excel_bdcdata.
        translate excel_bdcdata to upper case .
        move excel_bdcdata-col to it_index.
        assign component it_index of  structure  wa_file to <fs> .
        move excel_bdcdata-value to <fs>.
        at end of row.
          append wa_file to it_file .
            clear wa_file.
          endat.
      endloop.

    Parsing XML data:
    http://help.sap.com/saphelp_nw04/helpdata/en/86/8280ba12d511d5991b00508b6b8b11/frameset.htm
    or alternatively check out ABAP online help for "CALL TRANSFORMATION".
    For creating the material master look at BAPI_STANDARDMATERIAL_CREATE.
    Thomas

  • Write XML file in application server

    Experts,
    I'm using a transformation to generate a xml file:
      CALL TRANSFORMATION zdatafechomes
      SOURCE ficheiroexecucao = gt_source[]
      RESULT XML  xml_result.
    It's working fine. But i'm having problems in putting the "xml_result" (it's a type xtring) into the application server.
    Anyone knows how to do it ? Transaction cg3z it's different because the file comes from C:
    Best Regards,
    Mário.

    Hello Mario
    I do not see why the following logic should not work:
    *& Report  ZUS_SDN_XML_XSTRING_APPLSERVER
    REPORT  ZUS_SDN_XML_XSTRING_APPLSERVER.
    DATA:
      gd_dsn            type string,
      gd_xstring        type xstring,
      gt_kna1           type STANDARD TABLE OF kna1.
    start-of-selection.
      select * from kna1 into table gt_kna1 up to 10 rows.
      BREAK-POINT.
      call TRANSFORMATION id
        source itab = gt_kna1
        result xml = gd_xstring.
        gd_dsn = '/tmp/xml_as_xstring.file'.
        open DATASET gd_dsn for OUTPUT in BINARY MODE.
        check ( syst-subrc = 0 ).
        TRANSFER gd_xstring to gd_dsn.
        CLOSE DATASET gd_dsn.
    end-of-SELECTION.
    Regards
      Uwe

  • OPEN DATA SET to write files in application server folder - some of the files are missing

    Hi,
    I'm using OPEN DATASET statement in batch job to write the files in application server. what i'm experiencing is when i schedule the batch job all the files are not writing into the folder.
    If i run the report again to write the missed files, the files are writing into the application server folder.
    after opening the dataset, i'm closing it. do we need to give any delay between creation of the files? or until the first write operation is done, 2nd one can't start ..how can we achieve this.
    Thanks for your help in advance.
    Thanks,
    Adi.

    Hello Bathineni,
    Are you using the sy-subrc check after the OPEN DATASET statement.
    If not use a sy-subrc check and transfer the contents to file only when the OPEN DATASET returns value sy-subrc = 0.
    if sy-subrc is 8 repeat the same loop say for 3 attempts until the OPEN DATASET becomes 0.
    DO 3 TIMES. <---- put any number of attempts as you need
    OPEN DATASET.
    IF sy-subrc = 0.
       TRANSFER contents to file.
       EXIT.
    ENDIF.
    ENDDO.
    CLOSE DATASET.
    Regards,
    Thanga

  • Program for uploading file on application server...

    Hi,
    I have created a program to upload a file from presentation server (local desktop) to application server. But in this program I have to specify the file length. What should I do in given program so that I can upload file of any length on application server ?
    *& Report  Z_FILE_DOWNLOAD_TO_APP_SERVER                               *
    * This Program can be used to move flat files to application server from presentation server.
    REPORT  Z_FILE_DOWNLOAD_TO_APP_SERVER.
    PARAMETERS: P_FILE       LIKE IBIPPARMS-PATH,
               P_FILE1(20000) default 'E:CONVERSIONFLAT' lower case.
    DATA: WS_FILE TYPE STRING.
    DATA: BEGIN OF T_DATA OCCURS 0,
           RECORD(20000),
         END OF T_DATA.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      PROGRAM_NAME        = SYST-CPROG
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
    IMPORTING
      FILE_NAME           = P_FILE
    START-OF-SELECTION.
    WS_FILE = P_FILE.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
       FILENAME                      = WS_FILE
      FILETYPE                      = 'ASC'
    TABLES
       DATA_TAB                      = T_DATA
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    * Creating the file at Appl server............................
    OPEN DATASET P_FILE1 FOR OUTPUT IN TEXT MODE encoding utf-8.
    if sy-subrc ne 0.
    message e000(--) with 'Error in opening file'.
    endif.
    * Trasfer the records to file.............
    loop at t_data.
    transfer t_data to p_file1.
    endloop.
    close dataset p_file1.
    if sy-subrc eq 0.
    write: / 'Written the files at ', p_file1.
    write:/ 'Goto AL11 Transaction and then click on SAP Directory DIR_SAPUSERS to look for the file'.
    endif.
    Please advice.
    Regards,
    Rajesh

    Try declaring it as TYPE STRING. Not sure though.
    There are two predefined types in ABAP with variable length:
    STRING for character strings
    XSTRING for byte strings
    Thanks,
    SKJ

  • Problem opening file in application server received by FTP.

    Hi,
    I am using FTP_COPY to receive file in application server.
    I am receiving file from FTP but I am unable to open them because the mode was set as 640 as in attributes.
    Could you please help me in how to receive in readable format...
    Any suggestions to use FTP commands?
    Thanks in advance.

    If you do not have authorizations to open the file its easy: there is nothing you can do except contact the ftp admin.

  • Can any one tell me how to write open hubs to application server?

    Hello Everone,
    I created open hubs and my requirement is to write the file to application server. So, I created logical file name and logical paths as specified in below link.
    http://help.sap.com/SAPHELP_NW04S/helpdata/EN/8d/3e4ec2462a11d189000000e8323d3a/frameset.htm
    That is created 'logical file path defination' in 'FILE' transaction. Used the physical path as - 'bw/FTPOUT/BPR/GM/<FILENAME>' as given in above link..
    In logical file name I used the above logical file path.
    When I run the open hub, I'm getting the ABAP dump  "UNCAUGHT_EXCEPTION
    CX_RSB_WRITE_ERROR
    12/18/2008 09:00:40"
    Can any one tell me how to write open hubs to application server?

    Hi David,
    Goto transaction code - FILE
    1) Create a Logical File Path definition, enter the technical name and description by clicking new entries and save it.(z_ftp)
    2) create a Logical file name definition using cross client,
        enter the logical file name = z_ftp , name = ftp , physical file = ftp_test.txt,
    dataformat = ASC, Appln area = BW and Logical path = z_ftp(created from step 1).
    click SAVE button.
    3) Assignment of physical paths to logical paths, choose your logical path here.
    enter the syntax group = UNIX
    Physical path = /bwftp/....
    Save it .
    In the openhub,
    choose definition type = file
    Check the applicaion sever.
    servername = dev
    type of file name = Logical file
    Applin server file name = z_ftp
    separator = |
    Hope this helps and solve your problem.
    Thanks
    Sat

  • Files that used to be visible are now hidden in Mavericks. How can I change the setting to view the same files as before? I do not need the hidden files that are typically invisible.

    Files that used to be visible are now hidden in Mavericks 10.9.1. How can I change the setting to view the same files as before? I do not need the hidden files that are typically invisible.
    I am having trouble locating such files as PDF's INDD, AI etc. When I view all hidden files and try to open it in the program..it looks like it is really not on the drive. Has anyone come across a solution?

    You may need to rebuild permissions on your user account. To do this,boot to your Recovery partition (holding down the Command and R keys while booting) and open Terminal from the Utilities menu. In Terminal, type:  ‘resetpassword’ (without the ’s), hit return, and select the admin user. You are not going to reset your password. Click on the icon for your Macs hard drive at the top. From the drop down below it select the user account which is having issues. At the bottom of the window, you'll see an area labeled Restore Home Directory Permissions and ACLs. Click the reset button there. The process takes a few minutes. When complete, restart.   
    Repair User Permissions

  • How can I see KSC5602 character set using JDBC thin driver

    After I change character set from USASCII7 to KO16KSC5601, I
    cannot see korean from the clients
    using JDBC thin driver.
    But, I can see korean clearly using sqlplus at serer, or
    application using SQLNet.
    I use Oracle Enterprise Server 8.0.4.1.0, jdbc thin driver
    8.0.4.0.6 on Windows 98. I read that all bugs realated
    to multibyte language are fixed in Oracle8. What can I do to
    solve this problem?
    PS.server: Oracle 8.0.4.1 on Digital Unix 4.0b, client: jdk1.1.8
    on Windows98. I used the command.
    null

    The easiest thing to do is download it as an archive with your applet.
    Otherwise, you have to have the files on every client machine.
    For netscape, put the classes111.jar in the java classes folder typically:
    c:\ProgramFiles\Netscape\Communicator\Program\java\classes.
    I'd expect that IE would be setup in a similar way.

  • How can i change character set on forms9i runtime?

    Hi Every Body,
    i am a user on forms9i developer.
    i want to know how can i change character set definition when i run a form on web(with oc4j).
    is it any JAR file or another file that i can change display of characters on forms9i runtime on web?
    thanks a lot.
    f-badiee.

    hi frank,
    thanks a lot for your attention.
    i have a problem on persian language.
    whereas oracle dosn't support persian(farsi) language,
    i use arabic character set for simulation.
    in oracle developer6i (forms) i had no problem about displaying farsi fonts on runtime.
    but in forms9i that runs forms on web(java applet) i can't use farsi fonts correctly.
    for example when i type a word(boilerplate text) on farsi language in form builder i can see it correctly but when i run my forms on web , characters of that word have some displacement.
    i want to know that is there any configuration file for solving this problem?
    thanks a lot.
    be successful.
    f-badiee.

  • Getting ORA-01429 error while changing character set

    When I am changing character set from WE8DEC to AL32UTF8, I am getting ORA-01429 error
    SQL> ALTER DATABASE CHARACTER SET INTERNAL_USE AL32UTF8 ;
    ALTER DATABASE CHARACTER SET INTERNAL_USE AL32UTF8
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01429: Index-Organized Table: no data segment to store overflow row-pieces

    Chockalingam wrote:
    I am using above steps as per oracle doc only.
    http://docs.oracle.com/cd/B10500_01/server.920/a96529/ch10.htm
    No, you are not.
    - You are not using the correct version doc vs. Oracle server version. Try to find the same suggestion in the relevant doc.
    - The doc you reference specifically says "... it can be used only under special circumstances. The ALTER DATABASE CHARACTER SET statement does not perform any data conversion, so it can be used +if and only if the new character set is a strict superset of the current character set+." (emphasis is mine)
    You do not have a strict superset.
    - Also the special clauses you have used are not documented - for a reason.
    Please edit your posts above to remove the ill-advice (steps with internal use only clauses) that does not belong on a forum.
    Edited by: orafad on Mar 16, 2012 9:47 PM

  • Can i Change Character set WE8ISO8859P1 TO AR8MSWIN1256 IN ORACLE 8i

    I tried to change character set from WE8ISO8859P1 TO AR8MSWIN1256 on oracle 8i database.
    Getting the follwoing error for both character set and National character set.
    ORA-12712:New character set must be a superset of old character set.
    My question can i change or have to do export and import in arabic character set DB.
    null

    Hello Sarath,
    There is an extension CODE PAGE with OPEN DATASET stmt.
    Can you please elaborate which character set you want to write to the application server?
    BR,
    Suhas

  • To access pdf files from application server using web.show_document

    Hello!
    If my pdf file is copied in Oracle_home/forms90/java directory.Then using web.show_document i can access the pdf file.But I can't copy all the pdf files in /forms90/java directory.We have lacs of pdf files which I want to keep in my own directory.But my requirement is if my pdf file is in /home2/docs directory in (Linux application server) ie in my own directory where I store all the pdf files.Then web.show_document does not open the pdf file.It says page cannot be displayed.For that I think we have to configure the directory /home2/docs directory as a webserver.From otn I got something like forms90.conf file in application server where we have to set virtual directory mapping etc.If the pdf is in local machine then in orion-web.xml file we have to mention real path and save the file and shutdown oc4j instance and restart it again.I tried it.But it is not working.Can u give me step by step instructions to solve this problem.I found a few links in discussion forum.But is doesn't work out.My pdf file is in /home2/docs directory in Linux application server.Please treat it as urgent.
    Regards
    Jayashree

    Hi Sandeepmsandy,
    There is no available code sample for this scenario. You may write your own.
    Step 1: Get pdf URL from sqlite database. Please refer to the following MSDN blog and see a code sample.
    http://blogs.msdn.com/b/robertgreen/archive/2012/11/13/using-sqlite-in-windows-store-apps.aspx. Note, you need to retarget the project to 8.1 and then get two sqlite packages from NuGet before building this sample.
    Step 2: Use some special classes to get file from serer.
    HttpWebRequest can help download small pdf files. For more information to see
    https://social.msdn.microsoft.com/Forums/windowsapps/en-US/de96a61c-e089-4595-8349-612be5d23ee6/download-file-with-httpwebrequest?forum=winappswithcsharp. It’s easy for use, but if you want to download the larger or many files, it’s recommend to use
    BackgroundTransfer namespace. The classes in this namespace provide a power way to transfer files in the background. See a code sample from MSND.
    https://code.msdn.microsoft.com/windowsapps/Background-Transfer-Sample-d7833f61.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
    the survey.

Maybe you are looking for

  • Java Bouncing Balls Threads problem?

    Hello, I am working on a homework assignment to represent a java applet with some bouncing balls inside. So far so good. The balls bounce and behave as they are supposed. The only thing is that I want to make 2 buttons, Start and Stop (this is not pa

  • Problems switching back to BT .. Thanks, BT - now ...

    I've recently (1st June) switched back to BT .. but my old provider (Pipex) knows nothing about the switch yet BT are happily charging me for my new Unlimited Anytime Plan. So, what went wrong BT? More to the point HOW DO I GET SOMEONE AT BT TO CARE?

  • Create XML using data from Oracle

    Other than using OracleXMLQuery, how do I create an XML file from the data from a table in Oracle? Rgds, Seetesh

  • Why does Firefox keep opening new Windows rather than a new Tab in the current window?

    I have " Open a new Tab in the current Window" select in Preferences. Why then does this version (Version 4) keep opening new Windows, rather than new Tabs in the current Window. This feature worked fine in 3.6.1.3, but in Version 4, it is a frigging

  • Since Acrobat Pro XI can't print anymore !

    I updated few weeks ago Acrobat Pro. But since I intalled the XI version, the printer just block the application from  which I try to print the pdf. I need to force the software (Word, Excell, Illustrator...) to close because it is frozen... No issue