Download recods with '|' delimieter

Hi all,
I need to download records with delimieter '|' as txt file.
I used FM 'SAP_CONVERT_TO_TEX_FORMAT' to convert internal record to text with delemieter '|'.
But it works fine, but spaces between fields are truncated. So alignment in downloaded file  is not identical.
ex: 000001|aaaa|12/09/2010
      000002|bbb|21/09/2010 
But should be.
      000001|aaaa|12/09/2010
      000002|bbb  |21/09/2010 
Is any other FM avilable do the exactly same as above.
Thanks in advance.
Shruthi

Hi Shruti,
Try the below code
* itab to store data ready to be sent to csv file
  DATA: BEGIN OF wa_csvdata,
    line(4096),
  END OF wa_csvdata.
  DATA: gt_csvdata LIKE TABLE OF wa_csvdata.
* stores the field separator used throughtout the file output
  CONSTANTS const_sep VALUE '|'.
*&      Form  CONVERT_TO_CSV
*       text
*      -->IT_DATATAB any internal table
FORM convert_to_csv  TABLES   lt_datatab.
  FIELD-SYMBOLS: <wa_datatab> TYPE ANY.
  FIELD-SYMBOLS: <wa_field> TYPE ANY.
* character variable incase table fields are of a diff type (ie: int)
  DATA: lv_data TYPE string.
* set to X if the no data has been put into the csv workarea
  DATA: flag_firstcol TYPE xflag.
  REFRESH gt_csvdata.
  CLEAR wa_csvdata.
  LOOP AT lt_datatab ASSIGNING <wa_datatab>.
    flag_firstcol = 'X'.
    DO.
*  one by one assign each position of the structure to the field
      ASSIGN COMPONENT sy-index OF STRUCTURE <wa_datatab> TO <wa_field>.
      IF sy-subrc <> 0.
        EXIT.
      ELSE.
*  we use lv_data since concatenate fails for integer types
        lv_data = <wa_field>.
*  remove commas in the data
        WHILE sy-subrc = 0.
          REPLACE const_sep WITH '' INTO lv_data.
        ENDWHILE.
*       if this data belongs to the first non ignored column
        IF flag_firstcol = 'X'.
          wa_csvdata = lv_data.
          flag_firstcol = ''.
        ELSE.
          CONCATENATE wa_csvdata const_sep lv_data INTO wa_csvdata.
        ENDIF.
      ENDIF.
    ENDDO.
    APPEND wa_csvdata TO gt_csvdata.
    CLEAR wa_csvdata.
  ENDLOOP.
ENDFORM.                    " CONVERT_TO_CSV

Similar Messages

  • Relative path for Download directory folder.I created a firefox profile and i wanted to use this profile in multiple machines.I wanted to use a relative path for download directory with respect to the profile folder.I need this on Linux machines

    I have a use case where I need to use different download directories with different firefox profiles.I need to use this profiles in multiple linux machines.
    I need to have a relative path to my download directory with respect to the profile folder.
    Ex: I have a selenium test which opens a website and downloads it to my machine.I want this downloaded file to go into some specific folder relative to this profile folder.How do I do this??

    That is not a practically empty xinitrc - that file only needs one line: exec WM.  Other things are entirely optional, and some of them very useful, but I'd encourage you to stick with the simplest xinitrc that will do what you require.
    Is slim involved?  Probably.  That is the source of many problems.  But to start narrowing this down, I have 3 suggestions:
    1) temporarily (at least) change your inittab to default to runlevel 3 ... actually, is it currently set to 5 or 3? if it is currently 3 that would explain why slim doesn't start.
    2) at a tty in runlevel 3 use "xinit" instead of "startx".  Startx is fine most of the time, but it is essentially just a complex wrapper for xinit.  That complexity can often iadd useful functionality, but it *always* makes troubleshooting more difficult.  So for now just use a vanilla 'xinit'.
    3) remove dbus-launch from your exec line in xinitrc.  This is done by console-kit so it is redundant and potentially problematic.  Further BOTH of these are taken care of by slim, so I'd even suggest getting both a jump start on being ready for slim and simplifying troubleshooting by removing both of them.  Just make that line "exec openbox-session"
    Edit: adding one more:
    4) temporarily switch out openbox-session for openbox.  I suspect the reason feh's setting of the background is getting overridden is due to a script or setting in openbox's autostart settings - many of these are only invoked when "openbox-session" is called, while "openbox" starts *just* the window manager itself.
    Last edited by Trilby (2012-10-03 17:30:36)

  • HT203433 I downloaded apps with one appleid on my iphone.  When my account was disabled I set up a new appleid & account.  Now I cannot update apps on my iphone that were downloaded with original appleid when I login with my new apple id.  What do I need

    I downloaded apps with one appleid on my iphone.  When my account was disabled I set up a new appleid & account.  Now I cannot update apps on my iphone that were downloaded with original appleid when I login with my new apple id.  What do I need to do?

    You can write into support and ask for help reenabling the account through this link here:
    http://www.apple.com/support/itunes/contact/
    Since the applications were purchased on the older account, you will need to log into that account to update them. The newer account will not recognize the purchases because they are not a part of the purchase history for the specific account.

  • It's so annoying!! I have created a new Apple ID but after I click verify it just goes back to the previous page!!! It''s really frustrating I have tried for more than 4H, and the problem is not about the apple ID. I can download apps with the apple ID, w

    It's so annoying!! I have created a new Apple ID but after I click verify it just goes back to the previous page!!! It''s really frustrating I have tried for more than 4H, and the problem is not about the apple ID. I can download apps with the apple ID, which means IMessage is the problem! I restarted my iPad, I logged in and out of the apple ID in the store, AND YET IT STILL WON'T WORK, PLEASE HELP!

    Hi Vmanfromusa!
    It sounds like you are having an issue with activating your iMessage app on your iPad. An article outlining some troubleshooting steps for this issue can be found here:
    iOS: Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/ts4268
    Thanks for using the Apple Support Communities. Have a good one!
    -Braden

  • I have purchased a ringtone in the iTunes Store for my iPad, and I cannot find the download together with my music. I have received the invoice but I have no product. I am working with iOS6, if that helps. Can anybody help me?

    I have purchased a ringtone in the iTunes Store for my iPad, and I cannot find the download together with my music. I have received the invoice but I have no product. I am working with iOS6, if that helps. Can anybody help me?

    I am confused. Do you mean you found the music, not the tones, or you can't find either?
    If the former, then this is normal. You can't redownload tones from the Cloud.

  • I am trying to download ebooks with with the adobe reader

    I am trying to download ebooks with the adobe reader, i keep getting an error message saying it is an unsupported file.  how do i correct this?

    What is the format of e-books.
    Adobe Reader can only open PDF files.
    If you have e-books with epub format, you might need Adobe Digital Edition : http://www.adobe.com/in/products/digital-editions/download.html

  • I am trying to download words with friends app and it says it is no longer available from itunes.  I had already downloaded it and did a update in my I phone 4 and it is still not letting me download it?

    I am trying to download words with friends and itunes is saying it is no longer available for purchase.  What is going on??I

    First you need to research all the problems people are having with the higher OSX versions, & make sure you have a bootable clone of what you have just in case.
    then you must get 10.6 if they still have it, install it & update to 10.6.8 so you have the App Store to buy & download the huge 10.8 Installer.
    Snow Leopard/10.6.x Requirements...
    General requirements
       * Mac computer with an Intel processor
        * 1GB of memory (I say 4GB at least, more if you can afford it)
        * 5GB of available disk space (I say 30GB at least)
        * DVD drive for installation
        * Some features require a compatible Internet service provider; fees may apply.
        * Some features require Apple’s MobileMe service; fees and terms apply.
    Which apps work with Mac OS X 10.6?...
    http://snowleopard.wikidot.com/
    It's been pulled from the online store & Apple Stores, so you have to call Apple to buy it, last I heard.
    Call Apple Sales...in the US: 1-800-MY-APPLE. Or Support... 1-800-275-2273
    Other countries...
    http://support.apple.com/kb/HE57

  • I am trying to download lion with the thumb drive how do i back up my files is time machine good enough or must i transfer everything to my hard drive

    I am trying to download lion with the thumb drive how do i back up my files is time machine good enough or must i transfer everything to my hard drive

    A erase of the drive or boot partition is not always necessary.
    Flashing question mark at boot could be a easy fix, sometimes it's the firmware that simply forgot what bootable volume to boot from.
    Try holding the Option key down while booting the machine, a choice of bootable options appears, select your OS X and boot up.
    When you get in, head to System Preferences > Startup disk and set it again new. This will tell the firmware what to boot from. Test it to see.
    Now if you don't have a selection of bootable options, it could be that the drive is dead, or OS X is erased or corrupted so it can't boot.
    You'll have to run through this list of fixes to see what's going on, if you need a hardware fix or what, I've also included links if you can't fix it and need to recover your data etc.
    (If it's not remmebering your boot selection then also run through the list to reset things.)
    Step by Step to fix your Mac

  • How to download  file with Save As dialog

    I am trying to download files with a Save As dialog, according to Jason Hunter's instructions in Jave Enterprise Best Practices.
    String filename = "content.txt";
    // set the headers
    res.setContentType( "application/x-download" );
    res.setHeader( "Content-Disposition", "attachment; filename=" + filename);
    // send the file
    OutputStream out = res.getOutputStream();
    returnFile( filename, out);
    The file content.txt is in the root directory of my webapp. But I get this stack:
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    java.io.FileNotFoundException: content.txt (The system cannot find the file specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.(FileInputStream.java:64)
         at com.interwoven.cssdk.examples.servlets.FileDownloadServlet.returnFile(FileDownloadServlet.java:43)
         at com.interwoven.cssdk.examples.servlets.FileDownloadServlet.doGet(FileDownloadServlet.java:24)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
         at java.lang.Thread.run(Thread.java:484)

    The root of the webservers changes from server to server and
    sometimes it depends on the path you run webserver exe.
    The best i have found to overcome this kind of problems is by
    using getResourceAstream() method which basically looks at classpath locations only, but still this has some problems like it should kept at the
    specified classpath becoz the getResourceAsStrem() method is not static
    method and it always associated with the class object and the file
    accessing also should be in the same package/classpath.
    by using getResourceastream you cannot look at other places (except classpaths)
    and this should be used only if you looking for .properites definitions.
    the Second best method is
    see you have a file called "context.txt" right
    before you create a file, first create a directory at the root, let say
    "\tmp"
    and then create a file \tmp\context.txt
    and then open an output stream to it either using fileoutputstreamm...
    and then write all output content to servlet/client output stream.
    this will be the best becoz you are specifying the "\" the root
    and this is common for all operating systems and definitely it will create at the root directory either serverroot or harddiskdrives root
    so you will never missout and the exceptin will also not comes along the way
    cheers..
    if you get new thing , let me know
    bye
    with regards
    Lokesh T.C

  • How to download an app *not* from icloud that has been downloaded before with a different account?

    Greetings,
    If an app has been downloaded before even with an account other than the one I am signed in with, it shows the cloud icon and asks me for the password of the other account.
    How do I download it with the account I am currently logged in with?
    Thanks

    "I'm using the one on the computer, not the device."
    Well I said this is happening on an iPad. Reread what is happening from the beginning of the thread, and tell me if the instructions are correct for the iPad. Are you prompted for passwords from a different account that previously downloaded the app on the iPad?
    Again
    The app is Google Search.
    It is free.
    (I am always promoted for passwords for both free and paid apps.)
    The device is an iPad. That is why I posted this is the iPad discussion.
    I am logged in with my account, let's call it A. It shows account A next to Apple ID in the lower left of the Featured page.
    When I search for Google Search, and click the cloud download icon next next to the Google Search app, it prompts me for the password to a different account. Let's call it B.
    In the app store it shows a cloud download icon next to every app that has ever been downloaded on this iPad, regardless of whether it is account A, B, C, etc
    Have you tried logging in with a different account to test this?

  • HT201085 can you share downloaded music with family members?

    Can you share downloaded music with family members?

    Hi olddawg66,
    Welcome to the Apple Support Communities!
    There is a new process called Family Sharing that I would suggest you take a look at.
    Family Sharing
    Have a great day,
    Joe

  • I can't seem to be able to download apps with IOS 8. I have been able to with other IOS 7 and IOS 6. Any suggestions?

    I Can't seem to be able to download (or update) any apps on IOS 8.0, and I have been able to download apps on IOS 7 and IOS 6. I have 5.2 GB of available space on my iPad (4th generation) and I have only used 7.1 GB on my 16GB ipad. I have a full two bars of Internet. Again I have been able to download things with two bars in the past using IOS 7 and IOS 6. Any suggestions would be helpful. =3    Sorry for the incorrect spelling  

    You might try just waiting. There are millions of people activating their iPhones today and people still trying to get iOS8, so the servers are swamped. I'd give it a couple of days and if it still doesn't work then try some troubleshooting.

  • When I type on the address bar "w" it opens a download page with only a few sites. Some of the sites I would like to delete. How do I do this?

    I highlight the page and hit delete. It will go away at that moment but as soon as I type "w" on a new search it will pull the download page with the supposed to be deleted address.

    Do those websites have a yellow star at the far right?
    If they have a yellow star then that are bookmarks. You can open such a bookmark in a tab and click the yellow star to open the "Edit This Bookmark" dialog and click the Remove button.

  • How do I disable Firefox's Download functionality, I would like to use another download manager with Firefox...many thanks Bruce

    Hi I am using version 3.6.15 with Windows 7, I would like to use another download program in place of Firefox's default option, how can I disable this in Firefox
    Many thanks
    Bruce Baxter

    Use this extension to integrate an external download manager with Firefox. <br />
    https://addons.mozilla.org/firefox/220/<br />
    http://www.flashgot.net/whats

  • While installing a program (MediaCenter.exe) to handle audiobooks from the library, I erroneously associated the download site with Windows Media Player instead of the actual application (NetLibrary Media Center). How can I reverse/change this?

    While installing a program (MediaCenter.exe) to handle audiobooks from the library, I erroneously associated the download site with Windows Media Player instead of the actual application (NetLibrary Media Center). How can I reverse/change this? Reinstalling the application does not clear the error, so I'm assuming the association is somewhere in Firefox.

    Never mind -- I just found it under Tools/Options.../Applications, where I changed the incorrect association of "nlmcp" from Windows Media Player to the correct one, NetLibrary Media Center. Done!

Maybe you are looking for