Problem in file format OPEN DATASET

Hi all,
   i am upgrading the systemm 4.7 to ECC6.0
  In one of the programs OPEN dataset statement is being used to download the file to unix server, but when i run the same program in ECC6.0 version an try to opn in notepad the same file it is coming in single line (i.e end of line delimiter is being ignored.)
Hence I tried using WITH WINDOWS LINEFEED addition
it is displayed correctlyin notepad but when i see thru
transaction AL11 character'#' is displayed after every end of line also when i take a printout now one extra new line is added
the delimiter which i have used here is
C type c value CL_ABAP_CHAR_UTILITIES=>CR_LF
Can anyone suggest a better method to solve the problem?

DATA L_MSG1 TYPE STRING.
CONSTANTS: C_TAB1 TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
*-- Open Dataset
    OPEN DATASET p_aosvr FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc EQ 0.
      DO.
*-- Read Dataset and Populate Input file data to Internal Table
        READ DATASET unix_filename INTO L_MSG1.
        IF sy-subrc EQ 0.
          SPLIT L_MSG1 AT C_TAB1 INTO it_final-field1
                    it_final-field2
                    it_final-field3
                    it_final-field4
                    it_final-filed5.
          APPEND it_final.
          CLEAR  it_final.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
    ELSE.
      MESSAGE e000 WITH 'Error while uploading data'(013).
    ENDIF.
*-- Close Dataset
    CLOSE DATASET p_aosvr.

Similar Messages

  • Unicode file formats ( open dataset)

    Hi,
    We are sending Unicode file with encoding as UTF-8( open dataset) containing Greek character to Legacy system. Legacy system( Sql server) is not able to understand this file format. As a workaround legacy side team coverts the file to Unicode UCS-2 using notepad ( by selecting encoding option as Unicode) and then uploading it to SQL server..
    Is there anyway to convert the UTF-8 file to other Unicode file format ( say UCS-2 )within SAP or generate the desired file format.

    Hi Martin,
    Thanks for the help!!!
    I tried  to convert the file format from UTF-8 to UCS-2  using the methods of the class mentioned but it didn't fulfill my requirement.  I have Greek character in UTF-8 format and when I convert it to any other other format then Greek character are displayed as #.
    Problem is legacy SQL server don't support UTF-8 format.  I tried open data set with binary mode & also legacy text mode with all available code pages but result were not fruitful.
    ( Program RSCP_CONVERT_FILE to convert code page - I used target code page as all possible UTF* , UCD* & Greek code page but no luck ).
    I am just wondering whether SAP can convert UTF-8 to UCS-2 or not. Other option I am thinking is to have the file converted by Unix script  that is application server external command which can be executed via FTP.

  • Problem with file in open dataset

    Hi experts ,
    i m  getting output in a standard way . all the fields are displaying in one column .
    this is my code .
      DATA: L_DATA LIKE RLGRAP-FILENAME VALUE '/usr/sap/dev/sys/global/substanc' .
      OPEN DATASET L_DATA FOR OUTPUT IN TEXT MODE ENCODING DEFAULT  .
      IF SY-SUBRC <> 0.
        MESSAGE E208(00) WITH 'Error Opening File'.
      ENDIF.
      LOOP AT I_DOWNLOAD INTO I_WA.
        TRANSFER I_WA-WERKS TO L_DATA.
        TRANSFER I_WA-MATNR TO L_DATA .
        TRANSFER I_WA-MAKTX TO L_DATA.
        TRANSFER I_WA-MEINS TO L_DATA.
        TRANSFER I_WA-PQTY TO L_DATA.
        TRANSFER I_WA-FKLMG1 TO L_DATA.
        TRANSFER I_WA-DQTY TO L_DATA.
        TRANSFER I_WA-DOFORCAST TO L_DATA.
        TRANSFER I_WA-DUFORCAST TO L_DATA.
        TRANSFER I_WA-WAQTY TO L_DATA.
        TRANSFER I_WA-OFORCAST TO L_DATA.
        TRANSFER I_WA-UFORCAST TO L_DATA.
      ENDLOOP.
      CLOSE DATASET L_DATA.
      IF SY-SUBRC <> 0.
        MESSAGE E208(00) WITH 'Error Closing File'.
      ENDIF.
    Thanks,
    Ashish Gupta
    Moderator Message: Basic and Duplicate Post.
    Edited by: kishan P on Dec 10, 2010 3:05 PM

    Hi Sravan,
    Thanks for replay .
    I did the same but  i was getting error message .
    "I_WA" cannot be a table, a reference, a string, or contain any of
    these objects. any of these objects
    This is my internal table and work area definition.
    DATA : I_DOWNLOAD TYPE TABLE OF TY_DOWNLOAD WITH HEADER LINE,
           I_WA TYPE TY_DOWNLOAD.
    Thanks ,
    Ashish Gupta

  • Error while opening pdf in reader in windows 8:Can't open this file. There's a problem with file format

    I have a problem with a pdf file which does not open with reader in windows 8 but it opens properly with adobe pdf reader. All other pdf can be opened in reader.But when i open a pdf(see this link for pdf for which i got error http://incometaxsoft.com/temp/Form.pdf)
    it gives error as "Can't open this file. There's a problem with file format".
    The same file opens properly in adobe pdf reader.You can check the pdf file which i have mentioned in the link above.But the reader which comes with windows 8 can open some other pdf in the same PC.What may be the error causing this??

    This has turned out to be an enormous issue for me as I sell PDF files as ebooks. I have done a fair amount of investigating this for my system.
    My files have to be compatible not just across readers but across operating systems.
    To date, I have over 200 PDFs that have functioned flawlessly across Mac, PC (Windows 7 and below), Android, iPhone/iPad, Linux.
    I personally test my PDFs using a variety of readers and PDF editors including
    PDF XChange (my favorite)
    Foxit (runner up for me and I recommend for most people)
    Adobe (the bloated monster)
    Nitro 9 (great for moving graphical elements around)
    ABBYY
    And the Nuance PDF Create toolsets
    Those are off the top of my head. There are a bunch on Android that I test with too.
    I am running the Windows 10 Pro Tech Preview and I have this same problem so I know it isn't fixed yet in any kind of pre-release way (-sigh-)
    Here is what I've learned for my situation
    The PDFs I created using NUANCE'S PDF CREATE PROFESSIONAL VERSION 8
    all fail using the built-in Windows 8/10 PDF reader.
    When I look at the PDF properties for these Nuance created files, the underlying engine used to write them is called "ImageToPDF". Using ABBYY it indicates their own engine as does everyone else that I've tried. It is easy for you to check to see
    what created your PDF by doing a "Control D" (look at the document properties). Perhaps there's a common engine causing issues.
    If I use the exact same source files to create a PDF using any of my other tools I have no issues. I checked the PDF versions made by the tools and they are all set to 1.5.
    A customer mentioned being able to convert them in a way they worked by saving them without having to do any kind of extraction, but I have not been able to duplicate that. Perhaps he did a "print" which seems like it could work.
    In summary, the workaround everyone is talking about, using an alternate reader, of course works. But not everyone wants to change.
     The culprit I have found is my Nuance PDF Creation tools that are using the ImageToPDF engine.
    I hope it gets FIXED as I really don't want to have to regenerate all of my PDF files.

  • File transfer Open dataset CSV file Problem

    Hi Experts,
    I have an issue in transferring Korean characters to a .CSV file using open dataset.
    data : c_file(200) TYPE c value '
    INTERFACES\In\test8.CSV'.
    I have tried
    open dataset  c_file for output LEGACY TEXT MODE CODE PAGE '4103'.
    open dataset  c_file for output    in TEXT MODE ENCODING NON-UNICODE.
    open dataset  c_file for output    in TEXT MODE ENCODING Default.
    Nothing is working.
    But to download to the presentation server the below code is working. How can the same be achieved for uploading the file to application server.
    CALL METHOD cl_gui_frontend_services=>gui_download
          EXPORTING
            filename                = 'D:/test123.xls'
            filetype                = 'ASC'
            write_field_separator   = 'X'
            dat_mode                = 'X'
            codepage                = '4103'
            write_bom               = 'X'
          CHANGING
            data_tab                = t_tab
          EXCEPTIONS
            file_write_error        = 1
            no_batch                = 2
            gui_refuse_filetransfer = 3
            invalid_type            = 4
            no_authority            = 5
            unknown_error           = 6
            header_not_allowed      = 7
            separator_not_allowed   = 8
            filesize_not_allowed    = 9
            header_too_long         = 10
            dp_error_create         = 11
            dp_error_send           = 12
            dp_error_write          = 13
            unknown_dp_error        = 14
            access_denied           = 15
            dp_out_of_memory        = 16
            disk_full               = 17
            dp_timeout              = 18
            file_not_found          = 19
            dataprovider_exception  = 20
            control_flush_error     = 21
            not_supported_by_gui    = 22
            error_no_gui            = 23
            OTHERS                  = 24.

    Hi,
    I would recommend to use OPEN DATASET ... ENCODING UTF-8 ...
    If your excel version is unable to open this format, you can convert from 4110 to 4103 with report RSCP_CONVERT_FILE.
    Please also have a look at
    File upload: Special character
    Best regards,
    Nils Buerckel

  • Problem in accessing application server file using open dataset

    Hi All,
    I am trying to access application server file using open dataset command, its working fine for normal path which imention. But when i am giving path of XI server file, its not working. How to access XI server file using open dataset. Please let me know.
    Thanks in advance.
    Regards,
    Vishal

    Hi Vishal,
    You need to verify if the location where you are trying to save the file is in the same server of SAP. In case that the location is in other server you need to map that directy into the same server of SAP.
    You need to point always to a location in the same server of SAP, in order that the open dataset could work.
    Regards,
    Eric

  • How to open a pdf file using OPEN DATASET

    Im trying to convert a pdf into binary format. So im trying to read the contents of the pdf into a XSTRING. Using the FM 'SCMS_XSTRING_TO_BINARY' i can convert the XSTRING to binary format.
    How to open a pdf file using OPEN DATASET and transfer its contents in a XSTRING variable.
    What i've tried is....
    DATA: f_name type string value 'C:\rep_output_pdf.pdf',
          x1 type xstring,
          LT_DATA TYPE STANDARD TABLE OF X255.
    OPEN DATASET f_name FOR input IN BINARY MODE.
    READ DATASET f_name INTO x1.
    CLOSE DATASET f_name.
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          BUFFER     = x1
        TABLES
          BINARY_TAB = LT_DATA.
    Im getting a short dump .
    Short text: The file is not open.
    Plz help me out.

    Hello Rajesh,
    You are trying to do use OPEN DATASET with a local file. NOT POSSIBLE
    You have to have the file in the app server to use OPEN DATASET.
    BR,
    Suhas

  • Japanies characters are converting to # in output file in open dataset

    Hi Experts,
    I am trying to transfer data from my internal table to application server. When i use
    Open Dataset e_file for output in text mode encoding NON-UNICODE ignoring convertion errors.
    All Japanies and chines characters(double byte characters) are converting to "#" in output file. I have used set locale language commend also.Still same problem is there.
    Could you please any one help me on this.
    Thanks
    Srinivas

    hi
    problem exporting text in hebrew
    Similar kind of problem has been solved here.. check that link first
    Use the class CL_ABAP_CONV_OUT_CE and use it to convert file from unicode to ascii.
    After that you should call OPEN DATASET IN LEGACY MODE and write the file.
    you have to find the Code Page format for japanese here..
    Is your system Unicode enables, if not please check whether you have japanese installed on your system.
    Run the program RSCINST in SE38 which throws a pop up if u work on a Unicode system and also shows what are the language packs currently installed on ur system.... if u dont have Japanese installed then u need to contact Basis People for installion of that language pack

  • Download file using open dataset

    Hi all,
    I download a .CSV file to sap server using open dataset. I have a column which stores a number with length upto 30 char. I get the output in this format '2.34234E+25' for '23423423423423400000000000' in that particular column.
    Please send your suggestions to solve this issue.
    Rajesh.

    Do you want to use the csv file in Excel or in another application.
    If you display the CSV file created by open dataset using Notepad, you will probably see the 30 digit number.  This is fine for many applications, but not Excel!
    Excel cannot store a 30 digit number internally.  Try entering a 30 digit number into an Excel cell and see what happens - it is converted to scientific format with only 14 decimal places.
    If you need to see the number in Excel, you need to have it displayed as Text and not a number.  There are a few options:
    1. Put a character at the start of the field
    2. Don't use CSV, but use OLE to start Excel and put the data in the cell with text format (complicated I know).
    3. Save as a file with a .txt extension, open in Excel, and in the Text import wizard (step 3)  specify that the column data format is Text
    Michael

  • Create Tab-delimited text file with OPEN DATASET

    Hi everyone,
    My problem goes like this: the text file that I am writing using OPEN DATASET needs to be tab-delimited.  Originally the file was to be delimited using the pipe ( '|' ) character.
    I read in one of the threads that to put in tab delimiters you need to use something like this:
    DATA v_tab TYPE x value '09'.
    CONCATENATE  wa-field1 wa-field2
      INTO wa_output SEPARATED BY v_tab.
    I also encountered the same problem, the error that I can't concatenate the v_tab with the other fields.
    What, therefore, is the correct way to declare the fields to be used?
    Thanks.

    Try this. It worked for me:
    class cl_abap_char_utilities definition load.
    constants:
        tab  type c value cl_abap_char_utilities=>horizontal_tab.

  • Create an Excel File Using OPEN DATASET Command

    Hey, everyone.
    How can I create an Excel file by using OPEN DATASET command ??
    The file is created but the columns are no seperated like thay should.
    I need to seperate the internal table's fields with a comma - How can I do it ?
    Here's my code:
    OPEN DATASET filename1 FOR OUTPUT IN TEXT MODE.
    IF SY-SUBRC = 0.
       LOOP AT gt_vend_info into gwa_vend_info.
         TRANSFER gwa_vend_info TO filename1.
         IF SY-SUBRC <> 0.
           EXIT.
         ENDIF.
       ENDLOOP.
    ENDIF.
    Thanks in advance.

    Hi Beki,
    REPORT  ZTESTAA.
    TYPE-POOLS:TRUXS.
    DATA: BEGIN OF ITAB OCCURS 0,
          VBELN LIKE VBAP-VBELN,
          POSNR LIKE VBAP-POSNR,
          END OF ITAB.
    DATA:
    ITAB1 TYPE TRUXS_T_TEXT_DATA.
    SELECT  VBELN
            POSNR
         UP TO 10 ROWS
         FROM VBAP
         INTO TABLE ITAB.
    CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
      EXPORTING
        I_FIELD_SEPERATOR    = ';'
      TABLES
        I_TAB_SAP_DATA       = ITAB
      CHANGING
        I_TAB_CONVERTED_DATA = ITAB1
      EXCEPTIONS
        CONVERSION_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.
    OPEN DATASET filename1 FOR OUTPUT IN TEXT MODE.
    IF SY-SUBRC = 0.
    LOOP AT gt_vend_info into gwa_vend_info.
    TRANSFER gwa_vend_info TO filename1.
    IF SY-SUBRC <> 0.
    EXIT.
    ENDIF.
    ENDLOOP.
    ENDIF.
    the above code give CSV format file, all fields will be separated by ';'
    Regards
    vijay

  • CFZIP problems - Unsupported File Format

    [I tried researching this via Google, but the terms are so generic I didn't find any relevant hits]
    I am working with files that originate via incoming emails as attachments.  In CF I detach them from the emails and hand them off to other jobs for processing. Sometimes they are zipped files, and I have been using CFZIP to extract the actual data file and process it.
    I started getting new files from a client and they are zipped (.ZIP file type), and if I open them from Outlook WinZip opens them just fine.  If I open them in Notepad, they all start with "PK" which I have always believed to mean that they were zip (PKZIP) format, as opposed to other flavors such as GZip.  But when the CF script tries to open that same file with CFZIP, it throws an Unsupported File Format error.
    Any thoughts of diagnosing this error, to determine if it really is a valid ZIP format file?  Are there any utilities out there that would give me info on exactly what program/algorithm was used for the compression process? 
    In the past when I've had these problems it was because the file was .GZ (Gzip format) and not .ZIP, and in those cases even Winzip indicated as much when it opened the file.  But this is perplexing because Winzip seems to think the file is just fine, and CF doesn't.
    Thanks for any ideas!
    -reed

    Winzip supports some functionality that doesn't work with other zip programs, if I recall correctly. Perhaps these zip files use that functionality.
    Dave Watts, CTO, Fig Leaf Software
    http://www.figleaf.com/
    http://training.figleaf.com/
    Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
    GSA Schedule, and provides the highest caliber vendor-authorized
    instruction at our training centers, online, or onsite.
    Read this before you post:
    http://forums.adobe.com/thread/607238

  • YouTube app problem: Same file formats, cannot view some videos

    This is weird. I uploaded several videos to YouTube with the same file format (.mkv) that YouTube supports.
    I have two Playlists. Only the videos in one of those Playlists are playable on my touch. But the videos in the other Playlist are not supported by the touch:
    Video Unavailable
    This video does not currently support iPod.
    Now why, if 100% of my videos are of the same format and uploaded exactly the same way, do only the videos in one of my Playlists are viewable on my touch and the others are not?
    I am viewing the videos from My Videos folder instead of the Playlists folder but it doesn't matter.
    Frustrating, to be sure.

    I have to make a correction that makes this even more frustrating.
    I found a few videos in that Playlist that I said can play on my touch that CANNOT be viewed on my touch! Some of the playable videos are marked private and others are marked unlisted but that doesn't seem to be part of the problem.
    So this problem seems to be totally random. A few videos can be viewed on my touch, the others cannot.
    HELP!

  • Problems getting files to open in browser from SP 2010 search results page

    We are in day 4 of having upgraded from MOSS 2007 to SharePoitn 2010 via database attach.
    When a user looks in their document library, and clicks on a PDF, they are asked if they want to check out and open or just open, and when they make the selection, acrobat reader opens the doc.
    When a user performs a search on the same library, and clicks on a PDF in the results page, the user is prompted if they wish to download the file, and then, after they save it, the file is downloaded and nothing else happens.
    The users do not want their disks filled with unnecessary copies of files.
    Note that I did add an "application/pdf" mime type to the allowedInlineDownloadedMimeTypes property .
    This is only occuring when using the download results page.
    Does anyone know a fix for this?
    Thank you.

    Hi lwvirden,
    Generally, if the PDF is added to the Web Application's AllowedInlineDownloadedMimeTypes property , the PDF files will open in browser when clicking them regardless of on the search result page or the document library.
    I recommend to delete the PDF from the Web Application's AllowedInlineDownloadedMimeTypes property and then re-add it to see if the issue still occurs.
    Here is a table summarizes the various PDF rendering behaviors in search and library in the link below(same for SharePoint 2010):
    http://stevemannspath.blogspot.in/2013/04/sharepoint-2013-pdf-support-and.html
    More reference:
    http://social.technet.microsoft.com/wiki/contents/articles/8073.sharepoint-browser-file-handling-deep-dive.aspx#DownloadFunctions
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Problem viewing files to open in Elements 12

    I have just upgraded from Elements 9 to 12 -- and now it will not open folders or files in the "open" command. I get the typical screen showing "My Pictures" -- but the box below shows nothing. I can view everything in windows explorer, and can open folders and files in Breeze Blower -- but cannot access them in Elements. Needless to say -- that makes the new download useless! How do I fix it?

    I never used the organizer function in Elements 9, and in Elements 12 I've tried to just use the "Edit" page. I did go to Organizer and tried the things you suggested, but when I go to Edit, I still cannot open my files. In Edit, I go to OPEN and I see the top box showing the basic files, but the larger box, that is supposed to show the details, is empty. If I close Elements, shut down the computer, and restart everything, sometimes it then works -- mostly not.
    A friend suggested that I had a corrupted "DLL" file. Following his suggestions, I first unistalled Elements 9 (which had had the same problem recently), the restarted the computer. He thought perhaps since 9 was still installed, the installation of 12 just used the old DLL file (which he told me means "dynamic link library"  -- all of this lingo is foreign to me). elements 12 seemed to work for while, but now it is back to the old problem -- I cannot view files in Edit.
    He has suggested that I uninstall E12, then shut down the computer, then reinstall. I might try that, but since my E12 was a download and I had a lot of trouble loading it the first time, I'm a little hesitant. The files are there in my download folder -- so maybe that will work. Any further suggestions are appreciated.
    Bob
    Robert C. Glotzhober
    Emeritus Curator, Natural History, Ohio Historical Society
    Naturalist, Speaker, Photographer, Writer
    3942 Millstone Road
    Columbus, Ohio 43207
    [email protected]

Maybe you are looking for

  • Web template varaints

    hi, I want to change via program (abap or java) values in web template variants, but I dont know where this information is stored. Thanks for advice pp

  • Feedback Request for OS X 10.8.3 and Logic 9.1.8

    Can anyone who has updated their system to 10.8.3 and is still noticing the lag/unresponsive button press issue with Logic Pro 9.1.8, reply to this thread with the following info please 1) System specs (inc Amount of memory, Processor speed, Insteran

  • Photoshop Elements 13 Icons too small

    After recently installing Photoshop Elements 13 onto my new Dell laptop, all the icons are rather small, yet they show they are at the largest size.  When taking a photography class and we uploaded a RAW photo, the instructions were too tiny to read

  • Buggy/Instable when scrolling in Iphoto

    And also when you're in an event?  My sister and I are both having the same problem.  It's seems like since the last update a week or so ago it started acting like this.  You can't scroll smoothly....track pad is very jumpy and in an event the same t

  • URGENT : extracting an application from webtool

    Hi all, I hope someone can help me with this one... I need to extract applications deployed in webtool services somehow and move them to another AS10g. I have ssh access to the server , however i am unable to find the application files anywhere - any