Transfer to Unix file

It gives me trash in the output file.
Table Zzz has data types, and decimals..and it gives me trash in that types.
Output file:
SNSNNEDE00  {{{{{{
Example:
DATA itab LIKE Zzz OCCURS 0 WITH HEADER LINE.
OPEN DATASET fich_out FOR OUTPUT IN TEXT MODE.
  ENDIF.
  LOOP AT itab.
      TRANSFER itab TO fich_out.
  ENDLOOP.
  CLOSE DATASET fich_out.
How can i resolve this.
Thanks.

Hi,
If you are opening the file in text mode, your itab fields have to be character type fields. So define another itab with fields of character type with lengths defined as per your output requirements.
You have understand that if you have floating, decimal fields, currency or quantity fields in your itab, they are know to SAP only, once you try to download such records, converting them into character form needs to happen.
Did you try the binary mode with your 'open dataset' statement?
Srinivas

Similar Messages

  • Using File Adapter to transfer files from directories on unix file server.

    I have this scenario. I have a PI server on hpus45 and I want to use it to transfer files from a source directory to a destination directory on a unix file server. The unix file server is on a different box eg hpus30.
    What do I configure in SLD and Integration Directory? All the examples I have seen is transfering files from directories on the PI server but none on a different box.'
    Is it possible? I need help asap. I need to determine what the best approach is by today.

    Hi Agasthuri Doss,
    I'm using PI 7.1. I'm not seeing your instructions in ID.
    The objects in PI 71. are in this order
    Unassigned Objects
    Party
    communication component
    communication channel
    receiver determination
    interface determination
    sender agreement
    receiver agreement
    direct connection
    integrated configurations
    configuration scenario
    value mapping group.

  • Transfer string to unix file

    Hi Gurus,
    I am converting data in an internal table (consisting of 5000 records) into XML string using CALL TRANSFORMATION. All data is stored in XML format in a variable of type STRING.
    I am trying to write this data in a Unix file using TRANSFER statement.
    The problem is all data is not copied into the file!
    Can anyone suggest a suitable solution so that complete data in the string variable will be reflected in the file?
    Regards,
    Jack

    Hi,
    If you are opening the file in text mode, your itab fields have to be character type fields. So define another itab with fields of character type with lengths defined as per your output requirements.
    You have understand that if you have floating, decimal fields, currency or quantity fields in your itab, they are know to SAP only, once you try to download such records, converting them into character form needs to happen.
    Did you try the binary mode with your 'open dataset' statement?
    Srinivas

  • How to delete string or line from unix file(dataset) of application server

    Hi  All,
    After transfer workarea information or all records into dataset(unix file). When I see the file in application server automatically the last line is shown a blank line. I am not passing any blank line.
    I have tried for single record than also the file generates the last line(2nd line) also a blank line.
    When I m reading the dataset, it is not reading the last blank line but why it is showing the last blank line?
    How to delete string or line from unix file(dataset) of application server?
    Please give your comments to resolve this.
    Thanks
    Tirumula Rao Chinni

    Hi Rio,
    I faced similar kind of issue working with files on UNIX platform.
    The line is a line feed to remove it use
    DATA : lv_carr_linefd TYPE abap_cr_lf VALUE cl_abap_char_utilities=>cr_lf. 
      DATA : lv_carr_return TYPE char1,                                   
             lv_line_feed   TYPE char1.                                          
      lv_line_feed   = lv_carr_linefd(1).
      lv_carr_return = lv_carr_linefd+1(1).
    Note: IMP: The character in ' ' is not space but is a special
    character set by pressing ALT and +255 simultaneosly
      REPLACE ALL OCCURRENCES OF lv_line_feed IN l_string WITH ' '.
      REPLACE ALL OCCURRENCES OF lv_carr_return IN l_string WITH ' '.

  • URGENT : Writing to UNIX file problem !

    Hi friends,
    I am stuck at a crucial point while uploading a UNIX file from ABAP program.
    I am using open dataset & then transfer to...the file path.
    But when I go and check the UNIX file it is split into 2 lines (it is supposed to be a
    record with 1 line with 1500 characters) ! It shows a maximum of 255 chars in one line.Moreover,while I download to a text file via Txn CG3Y,some data are missing or truncated etc.
    Please suggest how can I create a record with 1500 characters in UNIX and download it successfully with full data or how can I ensure proper data has been transferred as the record display is truncated.I checked the program its fine,only after transferring I get the problem.
    Thanks,
    Sandip.

    The files would not get truncated. The file actually exists in App. server but you will be able to see only uptil 255 characters. You can check the same by downloading it onto Pres. server by specifying  file type as BIN when you are downloading through CG3Y

  • How to upload pdf file format in unix file directory?

    how to upload pdf file format in unix file directory?

    Hi Karthikeyan,
    If you have PDF internal table with you, You can follow the below method to upload into Unix directory.
        DATA:file_path TYPE char100 VALUE '/usr/sap/tmp/rep_out.PDF'.
        OPEN DATASET file_path FOR OUTPUT IN BINARY MODE.
        IF sy-subrc EQ 0.
          LOOP AT it_pdf.
            TRANSFER it_pdf TO file_path.
          ENDLOOP.
        ENDIF.
        CLOSE DATASET file_path.
    Thanks
    Venkat.O

  • Unix file to be converted to proper excel format

    Hi Ima writing data to unix file but when i want to download from there in excel format i data is not not aligned in excel format
    please let me know the seperator to be used to upload to unix which can be converted to excel with good alignment.
    i tried  seperator '09'  but didn't work and my version is 4.6 c so i can not use the encoding command or the classes.
    pls guide
    OPEN DATASET p_unix FOR OUTPUT IN TEXT MODE MESSAGE v_message .
      IF NOT sy-subrc IS INITIAL.
        MESSAGE e398(00) WITH text-008 p_unix v_message space.
      ENDIF.
    ** Write header to unix file
      LOOP AT gt_fieldcat1 INTO st_fieldcat1.
        CONCATENATE st_rec st_fieldcat1-seltext_l
               INTO st_rec
               SEPARATED BY ','.
      ENDLOOP.
    CONDENSE st_rec.
      TRANSFER st_rec TO p_unix.
    ** Write data to unix file
      LOOP AT  <fs_table>  ASSIGNING <fs_struc>.
        CLEAR: st_rec.
        DO.
          ASSIGN COMPONENT sy-index OF STRUCTURE <fs_struc> TO
                                                 <field>.
          IF sy-subrc NE 0.
            EXIT.
          ENDIF.
          v_field = <field>.
          IF v_field IS INITIAL.
            CONCATENATE st_rec v_field ','
                INTO st_rec .
          ELSE.
            CONCATENATE st_rec v_field ','
                INTO st_rec.
          ENDIF.
        ENDDO.
        TRANSFER st_rec TO p_unix.
      ENDLOOP.
    Close unix file
      CLOSE DATASET p_unix.

    Although I dislike MPEG-1 because of the large file size those .mpg files are commonly used on the Web. They can be played by nearly any computer and are not "Player" dependent like WMP or QuickTime so each user can decide how to view them.
    As a bonus they are a "playback" format which makes editing and repurposing them a bit more difficult so your media is a bit more "secure".
    I'll stick to QuickTime formats (avoiding H.264 video codec) and force QuickTime down their WiMPy throats. Millions of PC's have QuickTime installed (because of iTunes) and others can easily download the free Player and browser plug-in. By avoiding H.264 my files can be viewed on Mac's and PC's that can't install QuickTime 7.

  • About download file into unix file

    Hi expert,
    i use the openset to write file into unix file server.
    but why there are some space at the end of every line.
    by the way, i works very well in windows server
       DATA: DATA_TRANSFER(70).
        Data: DATA_TRANSFER type string.
        data: fine_riga1(1) TYPE X VALUE '0D0A'.
        DATA: gt_data TYPE STANDARD TABLE OF ty_data.
        Constants: ascii_tab type x value ','.
        field-symbols: <f> type any, <delim> type any.
        "Assign delimiter field such as tab or comma.
        assign ASCII_tab to <delim>.
        CLEAR VN_CNT.
        concatenate DSNU 'employee' PN-BEGDA SY-UZEIT into P_UNIX.
        OPEN DATASET P_UNIX in legacy text MODE FOR OUTPUT. " IN TEXT MODE encoding UTF-8.
        IF SY-SUBRC <> 0.
          WRITE: / 'Error on file open:', P_UNIX.
        ELSE.
          LOOP AT TI_DATA .
            CLEAR DATA_TRANSFER.
            concatenate TI_DATA-TYPE
                              TI_DATA-PERNR
                              TI_DATA-ZAUSW
                              TI_DATA-ENAME
                              TI_DATA-TERID
                              INTO DATA_TRANSFER separated by cl_abap_char_utilities=>HORIZONTAL_TAB.
            CONDENSE DATA_TRANSFER NO-GAPS.
            TRANSFER DATA_TRANSFER TO P_UNIX.
            ADD 1 TO VN_CNT.
            CLEAR DATA_TRANSFER.
          ENDLOOP.
          CLOSE DATASET P_UNIX.
        ENDIF.
        WRITE: / P_UNIX,
               / 'Transfered', VN_CNT, 'records'.
    Best Regards,
    Kevin

    Hi,
    Try this way...
    TRANSFER dobj TO dset [LENGTH len]
                                          [NO END OF LINE].
    Addition 1
    ... LENGTH len
    Effect
    This addition determines how many characters or how many bytes of data object dobj are written to the file. len is expected to be a data object of type i that contains the number of characters or bytes. In text files, the content of len specifies the number of characters that are written from the storage. For binary files, legacy text file, and legacy binary files, len specifies the number of bytes that are written to the file. The first len characters or bytes are transferred and alignment gaps are included in the structures. If the addition LENGTH is not specified, all characters or bytes are transferred.
    If the value of len is less than or equal to 0, no characters or bytes are transferred. If the file is opened as a (legacy) text file, however, a line end marker is inserted into the file by default. If the value of len is greater than the number of characters or bytes in dobj, hexadecimal 0 or blank characters are transferred to the file instead of the missing bytes or characters, depending on whether the file was opened as a (legacy) text file or a (legacy) binary file.

  • Trailing space issue in Unix File

    Hi All,
    I am facing an issue with the trailing space in Unix file content.
    When the file is being created in Unix server the trailing space is getting trimmed automatically.
    As per the requirement,this space should be retained in the Unix file as it is when the file is being downloaded to PC.
    Is there any solution for this issue? Request your help for resolving this.
    Thanks in Advance,
    Savitha

    Hi,
    When you're writing youd data to the file (assume you're using the TRANSFER command), you could try explicitly specifying the length of the data line to write, ie.
    TRANSFER data(200) TO DATASET filename.
    Regards,   Andy

  • Transfering trailing space to unix file.

    I have a variable of length (400) type c.
    When I transfer this variable to a unix file and if
    <b>the variable is blank or assigned 400</b> spaces nothing seems to show up in the unix file(not even the spaces).
    This is the also true for structures that end with a
    char component and are space filled. <b>When transferred the trailing spaces in a line are truncated</b>.
    How can i overcome this if i have to write even these spaces into the file?

    Hi,
    Use the TRANSFER statement with LENGTH.
    TRANSFER <f> to <dsn> [LENGTH <len>].
    You can specify the length of the data you want to transfer using the LENGTH addition. The system then transfers the first <len> bytes into the file. If <len> is too short, excess bytes are truncated. If <len> is greater than the length of the field, the system adds trailing blanks.
    OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE.
    TRANSFER: RECORD TO FNAME LENGTH 400,
    CLOSE DATASET FNAME.
    Regards,
    Maha

  • Old mac audio files now appear as executable unix files

    a long time mac user, back in 95 & 96 i had a PB165 that allowed me to record some of my daughters first words as she spoke into the computer. long ago i saved them to floppy disks. i got an external floppy drive with a usb port and was all ready to transfer these files and create a cd of these sounds but they now appear as "Executable Unix files". First i blindly tried to open one of them using iTunes but there was no luck there. Then i searched this site on how to open "executable unix files" and got some information about using Terminal. Have never used Terminal before and tried to follow the directions but had no luck.
    I've probably missed something easy, but have spent a bit of time trying to do this without any luck. So am humbly asking for help as I try to retrieve these nuggets of sounds that can not be reproduced.
    thanks,
    david

    Just adding an extension won't change what is in the file. If you know what the file is (.wav, .aif, etc), then adding the appropriate extension will help the system figure out what to open them as.
    Do the files have any extensions now? If iTunes can't open them they may be in an old format, such as a System 7 sound. In that case, you might give PlaySound a try.
    Edit: Other converter applications for those old sound files are SystemSound (free) and File Juicer (not free).

  • Fonts changed to Unix files when saved to a remote server

    Hi all, I read an archived thread regarding this, but not sure if my situation is related somehow. The issues others have had was that their font files were converted to Unix files at 0KB, when stuffed.
    My issue is I backed up fonts (PS and TT) from my Mac to a remote server (PC based). When that server is accessed by Mac users, some saw the file as a Unix file at 0KB. However, there were some (including myself) that saw the actual font file.
    That was a few months ago, we've retired that server since, but before doing so I transferred all the fonts to a new server. It's now a raid drive run off a Mac Xserve. After the transfer, I checked to see if the fonts were still okay, and they were showing full Mac file (no Unix). I didn't go into the new server for a couple of months, but when I did I noticed that all the fonts had been changed to Unix files. Some were at 8KB, others at 60KB. But no 0KB files. +Note: because the initial transfers was a success, the original files from the old server were deleted along with it. So there is no way of retrieving the original files. As well, were were running 10.4.10 with the original server and files. Switched to 10.5.x when files were transferred to the new server.+
    I've tried the tips here (using the Terminal method and the FileUtilsCM script) http://discussions.apple.com/message.jspa?messageID=6041364 but to no avail. I'd hate to think these fonts are scrap. As they were all purchased (and there's a whole load of them). Any input in saving these files would be of great help.
    Thanks in advance.

    The real font information is stored in a resource fork, not the data fork fo the file.  Depending type type of file system you copied them to, how you copied them, and what method you are using to look at them, you may not be seeing the resource fork.
    You can see more detail about files usng a Terminal command such as
    ls -leaO@ file
    If there is a resource fork, it will be displayed.
    If the file system was not a Mac OS X external file system, then you might want to look for a file with a similar name only starting with a leading period to make it invisible to the Finder
    ls -leaO@ /the/directory/with/your/fonts

  • Write incorrect record to Unix file and not load to PSA

    Hi,
    Is there anyway to write an incorrect record to a file from the transfer rules, such as if the record is not found after a search through one of the master data table, it should not load to the PSA but write to a UNIX file? What would be the ABAP code?
    Thanks,
    Will

    Hi Will,
    Transfer rules are processed after data are loaded to PSA. So you can only avoid that records are updated to info providers and write them to a file on your application server.
    If you really want to manipulate records in PSA you need to load required data to PSA within a process chain and to add a report that deletes the records from PSA and writes them to a file.
    The steps are
    1. Transfer rules
         1.create a start routine
         2.load required masterdata to an internal table
         3.loop at datapak
         4.delete records according to conditions
         5.append records to an internal table
         6.load file from internal table
    2. PSA
         1..Create a report
         2. Load PSA request into an intenal table
         3.load required masterdata to an internal table
         4. loop at ‘internal’ PSA
         5 .delete records according to conditions
         6.append records to an internal table
         7.load file from internal table
    Hope this helps
    Joe

  • How can I transfer a sound file from my "Voice Memos" app on my iPhone to my iPad?

    How can I transfer a sound file from my "Voice Memos" app on my iPhone to my iPad?

    In iTunes with your iPhone connected, click on the iPhone device, select the Apps tab, scroll down to the File Sharing section and pick an app that plays Quicktimes ("Files Connect" works in this example, but I'm open to suggestions of better apps for playing transferred Quicktimes) and drag your Quicktime from Finder to the Documents pane for the File Sharing app.   Once the file transfer is complete, go to the app on your iPhone to play the Quicktime.

  • I dropped my macbook pro and the screen is broken can i still use it with an external monitor? Or can I or how do I transfer hard drive files to my mac mini?

    I dropped my 17" macbook pro and the screen is broken. Can I still use it with an external monitor? When I plugged it into a monitor I had used it with before, I'm not able to see anything on the macbook screen to control it. It came on but I just got the blue screen with nothing else after typing in my password. (Didn't see the password form just assumed it was there somewhere and it did go from space to blue screen but no desktop icons, files, dock strip at top or anything else, just blank blue screen) so I can't access the system preferences.
    Or can I / or how do I, transfer hard drive files to my mac mini? If not salvageable as is can I pull out the hard drive and make it an external harddrive? In otherwords is anything salvageable? It seems it's coming on I just can't access anything. BTW I was told it would cost aprox $1000 to replace the screen! I paid almost $4000 for this thing and it was running great - makes me sick to lose it!

    I'd like to promise you that everything will be fine if you just get the monitor going - but it's hard to know what the hardware damage might be. It might be the monitor, or the damage might be greater.
    Your best solution would be visit your local Apple Store and let them know what your situation is. They have access to diagnostics you don't, and they might be able to the best way to save your data and keep you computing. It's still not covered, but they can tell you what your current options are.
    Um, you might consider investing in a backup drive.
    And there other repair options, too. Powerbook Medic http://www.powerbookmedic.com/xcart1/pages.php?pageid=67 offers reliable repairs, and quotes prices well under Apple's.

Maybe you are looking for