Reading decimal data into a string

Hi,
I am having an issue in converting the non char data like decimal into character.  Here is my code In the output I see '#' signs where I am supoose to get certain amount values in the decimal format. I require it because I need to download the data into a file. Any thoughts?  Rest of the code looks fine. Thanks in advance,
VG
field-symbols: <fs_table> type standard table,
               <fs_wa>,
               <fs_string>.
     CREATE DATA v_dref Type table of (v_tabname).
      assign v_dref->* TO <fs_table>.
      select * from (v_tabname) into table <fs_table>.
      loop at <fs_table> assigning <fs_wa>.
          assign component sy-index of structure <fs_wa> to <fs_string> casting type c.
          if sy-subrc = 0.
            write:/ <fs_string>.
         else.
           write: <fs_string>.
          endif.
        endloop.
output:   10000100000001019999123120090101                                        ############0001

@-Clemens - I tried your code , some problems with decimals values , adds a * in front.
@Vinu - Just some rough modification to the code written by Clemens
PARAMETERS:p_table TYPE tabname.
DATA:wf_maximum TYPE i,
     wf_total_fields TYPE i,
     wi_count TYPE i,
     wf_ltype TYPE c,
     wf_length TYPE i,
     wi_index TYPE i.
DATA:i_comp TYPE cl_abap_structdescr=>component_table,
      wa_comp LIKE LINE OF i_comp,
     wa_fields TYPE abap_compdescr.
DATA:lr_data TYPE REF TO data,
     lr_line TYPE REF TO data,
     wf_data_str TYPE REF TO data,
     wf_type_struct TYPE REF TO cl_abap_structdescr.
FIELD-SYMBOLS:<fs_table> TYPE STANDARD TABLE,
<fs_wa>     TYPE ANY,
<fs_line> TYPE ANY,
<fs_field_s> TYPE ANY.
CREATE DATA lr_data TYPE TABLE OF (p_table).
ASSIGN lr_data->* TO <fs_table>.
CREATE DATA lr_line LIKE LINE OF <fs_table>.
ASSIGN lr_line->* TO <fs_line>.
SELECT * FROM (p_table) INTO TABLE <fs_table> UP TO 20 ROWS.
CLEAR:wf_ltype,wi_count.
DESCRIBE FIELD <fs_line> TYPE       wf_ltype
                           COMPONENTS wi_count.
LOOP AT <fs_table> ASSIGNING <fs_wa>.
  AT FIRST.
    wf_maximum = 0.
    wf_total_fields = wi_count.
    WHILE wi_count GT 0.
      wi_index = sy-index.
      ASSIGN COMPONENT wi_index OF STRUCTURE <fs_wa> TO <fs_field_s>.
      IF sy-subrc EQ 0.
        DESCRIBE FIELD <fs_field_s> TYPE          wf_ltype
                                    OUTPUT-LENGTH wf_length.
        IF wf_maximum LT wf_length.
          wf_maximum = wf_length.
        ENDIF.
      ENDIF.
      wi_count = wi_count - 1.
    ENDWHILE.
    CLEAR:wa_comp,i_comp[].
    wa_comp-name = 'FIELD'(005).
    wa_comp-type ?= cl_abap_elemdescr=>get_c( wf_maximum ).
    APPEND wa_comp TO i_comp.
    TRY.
        wf_type_struct =
        cl_abap_structdescr=>create( p_components = i_comp ).
      CATCH cx_sy_struct_creation.
    ENDTRY.
    CREATE DATA: wf_data_str TYPE HANDLE wf_type_struct.
    ASSIGN:wf_data_str->* TO <fs_line>.
  ENDAT.
  DO.
    ASSIGN COMPONENT sy-index OF STRUCTURE <fs_wa> TO <fs_line>.
    IF sy-subrc = 0.
      WRITE <fs_line>.
    ELSE.
      EXIT.
    ENDIF.
  ENDDO.
ENDLOOP.

Similar Messages

  • How to read a data file combining strings and data

    Hello,
    I'm having a data file combining strings and datas to read. I'm trying to read the filename, time, constants and comments into four seperate string indicators (the lines for the comments varies for different files). And read the data into a 2-D numeric array. How can I do this? Is there any function that can serch special characters in the spreadsheet file so I can exactly locate where I should start reading the specific data. The following is how the data file appears. Thank you very much.
    Best,
    Richard
    filename.dat
    14:59:00 12/31/2009
    Sample = 2451
    Frequency = 300, Wait time = 2500
    Temperature = 20
    some comments
    some comments
    some comments
    some comments
    some comments
    7.0000E+2    1.5810E-5
    7.0050E+2    1.5400E-5
    7.0100E+2    1.5500E-5
    7.0150E+2    1.5180E-5
    Message Edited by Richard1017 on 10-02-2009 03:10 PM
    Solved!
    Go to Solution.

    Hi,
         I'm fairly new to the NI forums too and I think you just have to wait longer.  Your post was done right.  I do a similiar function as to what you are talking about except I read in numbers from a file.  I create an ini file (just a notepad file of type *.ini) that is is set up with sections inside brackets [] and keys with whatever name followed by an = sign.  You may be able to use a *.dat file too, I just haven't.  Then the vi attached goes to that file and reads the keys from those sections.  You just repeat for the different sections and keys you want to read.  You can use similar provide VI's to write to that same file or create it.  Let me know how that works. 
    Attachments:
    Help1.ini ‏1 KB
    Help1.vi ‏10 KB

  • Parsing today's date into a String

    How can I parse today's date into a String using this format: dd.mm.yyyy??? I taken a look at SimpleDateFormat, but I couldn't figure it out...
    Herman Svensen

    Hi Herman
    this is copied from the api docs:
    // Format the current time.
    SimpleDateFormat formatter
         = new SimpleDateFormat ("yyyy.MM.dd G 'at' hh:mm:ss a zzz");
    Date currentTime_1 = new Date();
    String dateString = formatter.format(currentTime_1);
    http://java.sun.com/j2se/1.3/docs/api/java/text/SimpleDateFormat.html
    So what is the problem to figure out?

  • Problems reading xmp data into dng files

    Hi there,
    I am working on a Mac and have exported files as lossy dng for colour correction externally. They have done the work for LR 5 process (I am using CC) and returned xml files. I cannot seem to read this data into the dng files for further editing in Lightroom. I have tried re-importing them and I have tried reading metadata from file. Any help would be appreciated as I usually simply read the xmp to the original RAW but the RAW files are currently on an external drive in another country!!!
    Thanks,
    Andy

    Moominman wrote:
    I am basically trying to export xmp files from a set of low resolution dng files so that I can access my Lightroom edits in the RAW files. I have separated the RAW and dng files in different folders
    Hi Andy,
    I dunno how best to get extracted xmp files into the raw folders, but if you are comfortable with exiftool, you can use it to extract xmp sidecars from DNG files.
    If you want a turn-key solution which does not required you to futz with exiftool, then consider a free plugin I wrote:
    robcole.com - xEmP
    It will allow you to create xmp sidecars with all your DNG adjustments and metadata (which can then be applied to the non-dng raw files).
    However, if you won't need the DNGs in your catalog afterward, then the easiest way is to convert them back to proprietary raw format using this plugin (also free, and I wrote it):
    robcole.com - UnDNG
    Conceptually, you can think of it as converting the DNGs to proprietary raw format, but note: it doesn't convert anything, it just allows existing raw files that are NOT in the catalog, to replace the DNGs that are in the catalog. All adjustments and metadata and everything else will be preserved (just like when you convert a proprietary raw to DNG format).
    Rob

  • Set encoding to read a file into a string

    in my Coding i Want to read a file into a string like this
    File myFile = new File (Dateipfad);
            System.out.println("folgende Datei wird nun verarbeitet: " + Dateipfad);
             java.io.BufferedReader myBis = new java.io.BufferedReader(new java.io.FileReader(myFile.getAbsolutePath()));
      myBis.StringBuffer buf = new StringBuffer();
             String line = myBis.readLine();
             while (line != null)
                    buf.append(line);
                    line = myBis.readLine();
      myBis.close();
    ] now i just want to set an encoding "ISO-8859-1", so that all �`s, �`s or �`s dont get lost.
    Can Anyone help me please ?!

    You must use java.io.InputStreamReader to set the required encoding.
    See the API for more details.
    http://java.sun.com/j2se/1.3/docs/api/java/io/InputStreamReader.html
    HTH,
    Manuel Amago.

  • Read Write Data into a MS Word document

    The requirement I am fullfilling directly specifies the need to write data into a Microsoft Word Document and if Necessary, Read Back data from a Microsoft Word Document. The data will be simple text but as time goes on I anticipate the systems engineers may expand the requirement. I want to cross one bridge at a time so I am just concentrating on the text issue. I must do it from within a stand-alone application. Not through a server, not through ASP, not through a browser, just a stand alone application. It appears from my own investigation of the JAVA API that this is not possible. Regrettably, I am only a day or so away from switching to C# or VB to get this job done. My first question is
    1. Can Java Do this?
    2. If not, does Sun Microsystems have any plans to add this capabiliy?
    3. Can we make recommendations to Sun to add this capability to JAVA?

    1. Can Java Do this?Java can do anything but there is no built-in ability to do just that.
    2. If not, does Sun Microsystems have any plans to add
    this capabiliy?
    3. Can we make recommendations to Sun to add this
    capability to JAVA?Very doubtful! MS Office document formats are not completely open to the public - and they are weird! Supporting this capability would probably require an agreement with Microsoft and it would mean you had to change the API for every time Microsoft chooses to change the document formats.
    But there are some open source tools that claim to be rather good at reading and writing MS Office files. Take a look at this one:
    http://jakarta.apache.org/poi/index.html

  • How to read clob data into a table

    Hi we have application which take oracle reports(10G)  xml  file as input and runs the report and save the output(csv,pdf) in a table.
    so i need some idea to impliment the follwoin task .
    I need to read the  content of the out file whcih in table stored in CLOB(I have not checked yet) column and store the data into another table .
    FYI: The out put  of the report will have 10+ different column.
    could Some please point me to the right direction  to acomplis h the task .
    Thnaks In Advance.Edited by: 852112 on Apr 13, 2011 10:47 AM

    Welcome to the forum.
    See:
    http://www.oracle-base.com/articles/8i/ImportClob.php
    http://www.oracle-base.com/articles/8i/ImportBlob.php

  • How to read RMAN data into an ORACLE Table?

    Hallo,
    With regards to RMAN, how should we store the data into a database table, from the commands which can run only on RMAN prompt without using Recovery Catalog?
    For Example:
    RMAN> Report need backup days 3;
    RMAN DATA:
    RMAN-03022: compiling command: report
    Report of files whose recovery needs more than 3 days of archived logs
    File Days Name
    1 1203 D:\ORACLE\ORADATA\TEST\SYSTEM01.DBF
    2 1203 D:\ORACLE\ORADATA\TEST\RBS01.DBF
    3 1203 D:\ORACLE\ORADATA\TEST\USERS01.DBF
    Should it done via UTL_FILE?
    If so, could someone give simple example/code how to do that, in order to write this RMAN data into an Oracle Database table?
    I also set the utl_file_dir parameter to a particular directory in my database.
    Thanks
    W.Benvort

    Actually, I am not using Recovery Catalog, so the views like RC_database, Rc_tablespaces etc , which are specific to recovery catalog are not available.
    r.- this make sense at 100% because those views belong to the recovery catalog.
    So, I wanted that these information, which we can get via using the commands like above, transfer into an Oracle table
    r.- If you want to access the views of the Recovery Catalog to store part of that information in tables you have to have the database registered in a Recovery Catalog.
    Should we keep the Recovery Catalog in Control file? Instead of using separate Schema.
    r.- I recommend you to create a catalog for your database because the space the controlfile to store information regarding RMAN is reused and you can lose important information about your backups.
    Can we run Catrman.sql script as a sys in order to keep the recovery catalog in sys schema?
    r.- As you know, this is not recommended at all.
    Conclusion : Create a Recovery Catalog and you will be able to perform all that you want regardind what you mentioned above.
    I have a thread for this:
    RMAN ( CATALOG CREATION ) STEP BY STEP by Joel Pérez
    Joel Pérez
    http://otn.oracle.com/experts

  • JAXB: Read XML data from a String?

    Hi,
    I get XML data not from file but as a string and I wanted to use JAXB to parse it and get my Java Objects.
    The unmarshall methods wants an "InputStream", but "StringBufferInputStream" is deprecated, so that I don't know a way to use my String as InputStream.
    Can someone give me a hint other then writing the data in a file first?

    Hi FrankSch,
    The unmarshall methods wants an "InputStream", but
    "StringBufferInputStream" is deprecated, so that I
    don't know a way to use my String as InputStream.
    Can someone give me a hint other then writing the data
    in a file first?Yes, the class StringBufferInputStream is deprecated, and the deprecation notice reads:
    Deprecated. This class does not properly convert characters into bytes. As of JDK 1.1, the preferred way to create a stream from a string is via the StringReader class.
    The JDK API usually mentions an alternative to the deprecated method/class and in this case, you should use java.io.StringReader. It has one constructor and should suite you nicely:
    StringReader(String s) That way, you get an InputStream object; you can now use JAXB.
    Hope this helps,
    -ike, .si

  • Error reading XML data into a DOM

    Hi,
    I'm trying to read a SVG file from a URI into a DOM like this:
    String uri = "file://d:/mysvgfile.svg";
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document svgDoc = builder.parse(uri);
    When I execute the code the following exception is thrown:
    java.net.UnknownHostException: d
    I can't figure out why the exception is thrown. I can create a File object from the URI so the file exists and can be accessed for sure.
    Any help is greatly appreciated!
    Regards,
    Stefan

    try this:
    Document svgDoc = builder.parse("d:/mysvgfile.svg");

  • Reading controller data into LabVIEW through serial connections to controllers?

    I'd like to read data from environmental chamber controllers (System Plus) into LabVIEW through RS232 connections.  Has anyone done something similar?
    I see interfacing with the serial controllers as the biggest obstacle and although not directly related to LabVIEW programming, I'm hoping someone here can give me some advice or resources on how best to do so now days.
    My first thought is to write a program with VB or C++ to act as a terminal and write the data to a text file for LabVIEW to poll.  Aside from using Telix decades ago to work with BBSes, my only other serial experience consists of interfacing with a Kiethly multimeter using a C++ program. 
    I would rather not use multiple PCs but I have never worked with more than one serial port on a computer before in the past.  Perhaps LabVIEW itself already provides for multiple serial card communications (wouldn't that be perfect)?
    Any info would be great.
    Regards,
    Dave

    Thanks Dennis.
    I spoke with Envirotronics and they do not provide the driver for the System Plus controller any longer since there were issues with changing hardware and software.  Their IT department may be able to put something together for me.
    Using USB->RS232 connections would be nice given the abundant number of USB ports available on modern PCs.
    Without a driver I see parsing the serial text as a challenge in LabVIEW.  I know how to approach this with a traditional programming language but are there any examples around here of how this is done with LV (most recent version is fine)?
    Dave

  • How do i read form data into subject lines of email?

    I'm having a problem pulling form data and putting it in the subject line of my email.
    "mailto:[email protected]?subject=Formform form+ F_Name.rawValue + L_Name.rawValue";
    I thought this would read text fields from the form and print them in my subject line. Instead it tprints it without the data.
    I was wondering if someone could point me in the right directon on what i am doing wrong.
    Button2.event__click.submit.target  "mailto:[email protected]?subject=Formform form" + F_Name.rawValue + L_Name.rawValue;
    Button2.execEvent("click");
    Any help would be appreciated.
    jj
    Also if anyone would happen to know if there is a way to bypass the two email prompts and choose to directly send it using the users local email client would help or maybe its impossible.

    Button2.event__click.submit.target ="mailto:xxxxx.com?subject=FORM Form Form for " + topmostSubform.firstName.value;
    Can i use rawValue or value like this? Right after i put anything after those quotation marks that aren't more quotatin marks my button stops workin.

  • Reading HTML data into a DOM

    Hi,
    I am looking to develop DOM by parsing HTML data. I do not know of how to parse html.
    Could you please help ? Any tutorial, guide, assistance ?.
    Thanks in advance.
    THeo

    the key question is whether the html is well formed, or not. If it is, then it's is simple to just parse with DOM, just like any other xml.
    If it is not, you may have to use something like
    http://java-source.net/open-source/html-parsers

  • Insert data into a database table from a string

    Hi,
    I am need to insert data into a table from  the text file. I pull the data into an internal table using GUI_UPLoad. I read the data into an internal table and concatenate data into a string. I need to do this because the structure of the table is dynamic. it is used to upload a series of tables each with different structure, But the data is stored in the string v_tabledata.  How to do that.
    after uploading the data  from the textt file into a table
    oop at i_final.
       v_tabname = i_final-table_name.
      concatenate i_final-table_rec1 i_final-table_rec2 i_final-table_rec3
                  i_final-table_rec4 i_final-table_rec5 into v_tabledata.
    from  'v_table data'  i need to upload the data into a table and the structue of the table is known dynamically. Any thoughts using field symbols?
    Thanks,
    VG

    Let me see if I've understood your issue
    You have a file to be uploaded into an internal table but this file has many different layouts and then you don't know how to link these fields with the internal table...is it your issue?
    Then you've read the internal table, you've sent it to a string divided by space or something else and then are you trying to read this string to send it to a table?
    We could read the standard tables which maintain the program names, table names etc... (DD* tables, as the DD03L table) and then create some rules...
    We could create a parameter table to read your file/table dynamically...
    Please, try to rewrite in other words your problem...because there are a lot of ways to achieve your issue...
    Alexandre Mendes

  • Streaming data to disk, need help reading data into Power Spectrum/O​ctave vi

    I'm streaming data to disk in one loop, however once this finishes I'd like to read the data into power spectrum vi/Octave analysis vi in another loop. The data from the read vi is a string and power spectrum vi needs 1d waveform. Does anyone have experience with this process?

    From your general description, I gather you are streaming to a text based file (comma or tab separated spreadsheet format) and would like to analyse this data with a power spectrum or octave analysis when you finish. Since you are streaming, I assume you have a lot of data. Do you have more than one channel?
    In any case, you have two simple options (and lots of complex ones). You can either read the data back from disk and convert it to a 1D array (try the Read From Spreadsheet File.vi - will get a 2D array, take the first column or the column of your choice if you have more than one channel) or you can use the Spreadsheet String to Array primitive to create an array from your text data before you save it to disk.
    If your data rate is slow enough, you can analyze as you acquire and store.
    Taking your data as text is very inefficient. What you really want to do is read the data as binary, use that for your analysis, and use something like the Write to Spreadsheet File.vi to save text data to disk.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

Maybe you are looking for