Reading XMLDoc into Dataset
Hi,
Description of problem:
DataSet dsComp= Created dataset by calling stored procedure
In this dsComp, there is one table called tblContract which has 5 columns out of which one column has null value in every row. The stored proc correctly fetches 5 columns from database and dscomp also shows in tblContract 5 columns.
dsComp is loaded into xmldoc
xmlDocComp.LoadXml(dsComp.GetXml());
Reading that xmldoc, a new dataset dsAnk is made.
XmlNodeReader nodeRdrAnk = new XmlNodeReader(xmlNode);
DataSet dsAnk = new DataSet ();
dsAnk.ReadXml(nodeRdrAnk);
dsAnk shows in tblContract only 4 columns, the column with all null values gets negated.
How to retrieve 5 columns in contract table of dsAnk by reading the XMLDoc
One mistake leaps out at me, you have a <tt>j</tt> which should be <tt>c</tt>
db
edit That doesn't cause a problem only because the array is uniform in all dimensions. With a ragged array, it would blow up.
I am getting the following error: incompatible types required: double, found double[].Whenever seeking help with an error, post the entire error text (no paraphrasing) and indicate the line which threw the Exception or compile error.
edit2 And <tt>String#split(...)</tt> returns a <tt>String[]</tt>. You're throwing away the return value.
What were you trying to achieve with this? and what type do you think the expression evaluates to (if it didn't throw a runtime exception, which it would)?
new double[Double.parseDouble(line)]Edited by: Darryl Burke
Similar Messages
-
Problem with partial reads of HDF5 dataset
I'm having a problem figuring out how to to a partial read of an HDF5 dataset using LVHDF5 by Jason S. I can save a dataset in a file, and I can read it out whole, but I can't figure out how to read a portion of it. For example
I save a 235x235x1024 dataset in a file. I want to read a 5x5x1024 array from this dataset. I am trying the following:
- use H5Dopen.vi to open the dataset
- use H5Dget_space.vi to get a reference to a dataspace that I assume (guess) is the dataspace associated w/ the dataset
- use H5Sselect_hyperslab.vi to select my 5x5x1024 portion using the "block" input. My starting location is 0,0,0 and stride and count are 1,1,1
- use Create Matching DataSpace.vi to create a dataspace that is 5x5x1024 in size, with the same datatype as my dataset (float).
- read the data in the "hyperslab" into an array using H5Dread.vi followed by the Variant to Data function.
If I don't wire the file space input, H5Dread.vi reads the whole dataset. However, if I try to use the reference obtained w/ H5Dget_space.vi as the file space, I get an error from Variant to Data that says "The data type of the variant is not compatible with the data type wired to the type input.".
I would appreciate any help in getting this to work.
Solved!
Go to Solution.Aha. I found my problem. I have to use H5Dselect_hyperslab in my memory space as well as my file space.
-
Is it possible to export data from a PDF in Reader XI into an xfdf file?
Hello,
I am new to the forum and to Adobe Acrobat. Please bear with me as I explain what I need to do and what I have tried to do so far to accomplish this (based on reading numerous forum discussions and Adobe IAC/JavaScript manuals).
Operating system, Adobe and Microsoft products on my standalone PC:
OS: Windows 7 Professional
Adobe: Adobe Acrobat Pro XI
IAC Software (free download)
Adobe Reader XI
Microsoft: VisualStudio 2010 (VB.NET and C#.NET)
I need to export the data from a fillable PDF in Acrobat Reader XI into an .xfdf file that will allow me to pull the field data out of the .xfdf (xml-type) file and use it in a C# program. I tried using exportXFDF as a trusted function not knowing initially that Acrobat Reader XI will allow you to import, but not export. Is there any workaround for this problem?
Using the IAC I was able to write a program that allowed my to save the data in a fillable PDF in Acrobat to an xml-type file; however, that only worked when my executable was running on a PC that had Acrobat installed (not Acrobat Reader). I need to be able to do this out of Acrobat Reader XI, and we do not want to use Adobe LiveCycle to do this.
I feel like there is something very obvious that I am missing here.
kfreema7I hope you won't see this as rude, but what you are missing is the obvious point that Adobe are in business to make money. So they put as little in Adobe Reader as they can, so people are motivated to buy stuff. Every development intended for Reader has severe limitations on feasibility and techniques for this reason; it's a huge (but very common) mistake to just develop for Acrobat and assume Reader will follow.
-
I pull fiftyfour bytes of data from MicroProcessor's EEPROM using serial port. It works fine. I then send a request for 512 bytes and my "read" goes into loop condition, no bytes are delivered and system is lost
Hello,
You mention that you send a string to the microprocessor that tells it how many bytes to send. Instead of requesting 512 bytes, try reading 10 times and only requesting about 50 bytes at a time.
If that doesn�t help, try directly communicating with your microprocessor through HyperTerminal. If you are not on a Windows system, please let me know. Also, if you are using an NI serial board instead of your computer�s serial port, let me know.
In Windows XP, go to Start, Programs, Accessories, Communications, and select HyperTerminal.
Enter a name for the connection and click OK.
In the next pop-up dialog, choose the COM port you are using to communicate with your device and click OK.
In the final pop
-up dialog, set the communication settings for communicating with your device.
Type the same commands you sent through LabVIEW and observe if you can receive the first 54 bytes you mention. Also observe if data is returned from your 512 byte request or if HyperTerminal just waits.
If you do not receive the 512 byte request through HyperTerminal, your microprocessor is unable to communicate with your computer at a low level. LabVIEW uses the same Windows DLLs as HyperTerminal for serial communication. Double check the instrument user manual for any additional information that may be necessary to communicate.
Please let me know the results from the above test in HyperTerminal. We can then proceed from there.
Grant M.
National Instruments -
Read statement into an internal table
Hi Experts,
In my report i have several read statements, now my requirement is i want to put all the read statements into an internal table, how do i achieve it???
Thank you!Hello Maya,
i want to know how many number of times the read statement is used .
Two ways:
1. use a counter after each read statement in your program and increase it by 1 everytime there is read statement and display the final value of the counter in the report that you want.
2. If you just want to know press (CNTRL + F) enter "READ" , select the radio button "In Main program" and then you will get all the read statement and can count it manually.
Hope I have not answered your question wrong. But if I have, please be more specific about your requirement so that many an help you.
Thanks,
Jayant Sahu. -
Webdynpro reading context into table
Hi Guy,
I havent been able to find anything on this but I am assuming its a very common questions. I apologise in advance.
My question below:
I have a context 0..n
I would like to read this into table type t1.
Context and table are base on the same structure.
I understand I have to use get_static_attributes_ref or table. But I am not sure how to go about getting it and then casting it into type t1
Thanks in advance.
Moderator message: please post again in "Web Dynpro ABAP" forum
Edited by: Thomas Zloch on Oct 28, 2010 3:03 PMhi Nir..
may be you shud use the HSSF api.....
try this link....
<a href="http://www.koders.com/java/fid5636164FDE72156B90C9973AC12EBBF49048BA4E.aspx">HSSF_API</a>
Regards,
Sudheer -
In Thunderbird just now most of the folders that I put my read emails into have disappeared. All the old messages are in them . I need them and the folders too. I don't know what I did to make them disappear. Please help. Thanks.
this is a follow up from the profane post earlier....
i have done this twice in two other posts..
here is my problem.. i started off trying to update itunes, it failed twice and said i needed to install manually via tools.
the only place to get to tools is the pop up box that appears when you click check for updates.. if there is an available update then the pop up shows up with the quick time and itunes files to download. so i finally figured that out. i clicked on tools and manual update, four files were saved to a file. Apple mobile device support, another one similar, itunes, and another one i cant remember. I only downloaded the itunes file seeing as though thats all i needed to accomplish in the first place.
so then i restarted my computer bc you need to reboot and then reopen itunes for update to take effect. once i have itunes back open i plugged in my new 5s which i am trying to sync to my computer to get all my stuff back bc i lost my previous phone over the weekend.. once i plugged the phone in an error stating i needed to unistall the apple mobile device support and itunes and then reinstall. well i dont know where those files were originally stored on my computer AND since my itunes was updated, just not the other 3 associated files, when i click check for updates it says its up to date and then pop up containing the quick time and itunes does not pop up thus i cant get back to the tools tab to manually save the 4 files again.
so i was just going to uninstall itunes all together and then i thought well what happens if it erases all my photos apps songs etc... which would defeat the whole purpose in the first place of me trying to sync my new phone to get all my stuff back.
so i literally have no idea what to do at this point.. if you have read this you are probably just as confused as me... -
Urgent help on reading data into ByteBuffer
Hi,
I am trying to read data into ByteBuffer using SocketChannel.
The following code working fine but the problem is with ByteBuffer size.
The data varies from request to request .
How do I read data into ByteBuffer with out specifing size .
The problem with size is some records has more than 500 bytes and some are less than 500 bytes.
I want to read all the data .. ( even if it has more than 500 bytes ..)
How do i solve this problem ..
Is there any way to read data dynamically from socket channel ...
Any help on this please ...
The data I have to read is in the following format ..
XXX ... yyyyy
AAA
BBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCCCCCCC
DDDDDDDDDDDDDDDDDDDDDDd
etc ...
Here is my Code:
public ByteBuffer getResponse(byte[] request) throws Exception {
int lenth = 500;
InetSocketAddress isa = new InetSocketAddress("ip", port);
SocketChannel channel = SocketChannel.open(isa);
ByteBuffer requestBuffer = ByteBuffer.wrap(request);
channel.write(requestBuffer);
ByteBuffer responseByteBuffer = ByteBuffer.allocate(length);
int num = 0;
while (num == 0 ) {
responseByteBuffer.rewind();
num = channel.read(responseByteBuffer);
channel.close();
return responseByteBuffer;
Thanks.Two possible solutions
1. Read in as many bytes as you can until you hit the EOS OR you fill the byte buffer. If you fill the buffer (try checking for BufferUnderFlowException), you could move the read bytes into a dynamically allocated memory Collection such as an ArrayList. When you hit the EOF, you could then do whatever else you need to do from then on.
2. I use this option: Implement a site local protocol for transmitting data. Provide a header first containing 2 ints (compressed size, uncompressed size - so you can also use compression when sending), and send the remainder as a payload.
Therefore
Read in the header first (always 8 bytes)
Then extract those integer values. They will tell you how much is being sent. Set you byte buffer for the payload to be the correct size for this transmission.
Reset and wait for next connection -
Problems on reading PCM into digital form
Hi,
I'm now on a project doing heart rate detection.
Due to the project just started, therefore I do not got any device to measure my own heart rate, but I will be making up some PCM(analog) data, and try to read that into digital form and give me results of the heart rate.
I'm not sure am I on the right track now or not,
what I'm doing now is trying to convert a ".wav" into bytes array, then it should give me some data, however, I'm not sure how to relate that data into heart rate.
Please leave me any comment if u think it might help please.
Thanks,
tillI'm not too sure what should be the .wav should be, however, according to this acticle I got it from the web:
_2.1 Signal acquisition_
ECG signal frequency content lies between about 0.05Hz and
500Hz and has amplitude of few mV. The acquisition is provided
to be performed in three different ways: (i) using direct electrode
measurements, (ii) using ECG equipment with analogous output;
and (iii) using ECG equipment with digital output. For the first
two cases, a sampling rate of 8 kHz is assumed. In the third case,
the acquired discrete signals are accordingly resampled.
_2.2 Modulation_
The bandwidth of the phones voice channel is limited to the
range 300Hz-3300Hz. The signal amplitude at the microphone
input should not exceed 100mV. Modulation is performed through
multiplication with carrying sinusoidal signals. Five 500Hz-wide
channels are packed within the 500Hz-3000Hz band. The
resulting signal is appropriately refined in amplitude and directed
to the modulators output.
_2.3 Digitizing, storing and sending_
The complex signal is band-limited to 3300Hz. Therefore, a
standard sampling frequency of 8 kHz is used for its digitization.
A JAVA application performs that and in order to store the signal
intact, the signal is recorded in a lossless format such as pulsecode
modulation (PCM). The WAV audio file format implements
PCM and is used to store the recorded modulated ECG signals.
Once stored, the signals can be visualized, processed and sent by
the mobile phone.
Mobile phones firmware is accessible by programming
languages as C++ and JavaTM. Most mobile phones support
JavaTM runtime called Kilobyte Virtual Machine (KVM) [6]. This
language provides the ability to build a GUI application that could
support all the stages of recording, storing and transmitting of the
ECG signal. JSR-135 contains libraries of JavaME, which are
useful for capturing audio from the microphone's port of a mobile
phone. The above mentioned platform was used to create the
application software.
_2.4 Demodulation_
The procedure of demodulation is performed at the physicians
phone, following the reverse track of modulation. A digital band
pass filter is used to separate the spectra, corresponding to the
individual ECG signals. The filtered signal was then multiplied by
the corresponding carrier frequency and filtered with a low pass
filter, resulting in the original signal. The demodulated signals can
be stored in separate WAV files in the physicians phone.
_2.5 Matlab simulations_
In order to prove the principal feasibility of the approach, the
signal acquisition, processing and transmission procedures were
simulated in MATLAB. Five preliminary recorded ECG signals
were directly loaded and used. The signals acquisition parameters
were: 8-bit values, sampling rate of 250Hz and duration 10S.
Modulation and demodulation were programmed and performed
in a numerical way. Modulation was done by multiplication of the
ECG signals with carrying sinusoidal signals of frequencies
500Hz, 1000Hz, 1500Hz, 2000Hz, and 2500Hz. The
demodulation included first separating the spectrum of each
individual signal with the help of 4-th order 400Hz-wide bandpass
Butterword filters centered on the corresponding carrying
frequency. Next the filtered signals were multiplied with the same
carrier signals and eventually filtered with a low pass 4-th order
Butterworth filter (fc=200Hz).
btw, the system need to be implement into Symbian phone at the end,
but I'm just now testing on the PC atm =)
according to this article, what kind of wav I should be using ??
thanks a lot!!! -
Hi,
How can I read an xml.file read in an oracle table (invoice varchar2(20), invoice_line number, ship_date date, country varchar2(100))?
The xml looks like this:
<?xml version="1.0" encoding="utf-8" ?>
- <dataset xmlns="http://developer.cognos.com/schemas/xmldata/1/" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
- <!--
<dataset
xmlns="http://developer.cognos.com/schemas/xmldata/1/"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://developer.cognos.com/schemas/xmldata/1/ xmldata.xsd"
>
-->
- <metadata>
<item name="Invoice #" type="xs:string" length="42" />
<item name="Invoice Line" type="xs:string" length="10" />
<item name="Ship Date" type="xs:date" />
<item name="COUNTRY" type="xs:string" length="8" />
</metadata>
- <data>
- <row>
<value>26623</value>
<value>0001</value>
<value>2010-05-03</value>
<value>USA</value>
</row>
- <row>
<value>26624</value>
<value>0001</value>
<value>2010-05-03</value>
<value>USA</value>
</row>
- <row>
<value>26624</value>
<value>0003</value>
<value>2010-05-03</value>
<value>USA</value>
</row>
- <row>
<value>26625</value>
<value>0001</value>
<value>2010-05-03</value>
<value>USA</value>
</row>
</data>
</dataset>
Thnx, RobbertHi,
Possible solutions will depend on your db version, which you didn't give.
The following example assumes you're using 10gR2 :
CREATE TABLE invoices (
invoice varchar2(20),
invoice_line number,
ship_date date,
country varchar2(100)
DECLARE
xmldoc xmltype := xmltype(
'<?xml version="1.0" encoding="utf-8" ?>
<dataset xmlns="http://developer.cognos.com/schemas/xmldata/1/" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<metadata>
<item name="Invoice #" type="xs:string" length="42" />
<item name="Invoice Line" type="xs:string" length="10" />
<item name="Ship Date" type="xs:date" />
<item name="COUNTRY" type="xs:string" length="8" />
</metadata>
<data>
<row>
<value>26623</value>
<value>0001</value>
<value>2010-05-03</value>
<value>USA</value>
</row>
<row>
<value>26624</value>
<value>0001</value>
<value>2010-05-03</value>
<value>USA</value>
</row>
<row>
<value>26624</value>
<value>0003</value>
<value>2010-05-03</value>
<value>USA</value>
</row>
<row>
<value>26625</value>
<value>0001</value>
<value>2010-05-03</value>
<value>USA</value>
</row>
</data>
</dataset>'
BEGIN
INSERT INTO invoices (invoice, invoice_line, ship_date, country)
SELECT invoice, invoice_line, to_date(ship_date, 'YYYY-MM-DD'), country
FROM XMLTable(
XMLNamespaces(default 'http://developer.cognos.com/schemas/xmldata/1/'),
'/dataset/data/row'
passing xmldoc
columns
invoice varchar2(20) path 'value[1]',
invoice_line number path 'value[2]',
ship_date varchar2(10) path 'value[3]',
country varchar2(100) path 'value[4]'
END;
/If your XML document resides outside the database, you may also access it directly through a DIRECTORY object :
CREATE OR REPLACE DIRECTORY xmldir AS 'C:\oracle\invoices\xml';
INSERT INTO invoices (invoice, invoice_line, ship_date, country)
SELECT invoice, invoice_line, to_date(ship_date, 'YYYY-MM-DD'), country
FROM XMLTable(
XMLNamespaces(default 'http://developer.cognos.com/schemas/xmldata/1/'),
'/dataset/data/row'
passing xmltype( bfilename('XMLDIR', 'invoices.xml'), nls_charset_id('AL32UTF8') )
columns
invoice varchar2(20) path 'value[1]',
invoice_line number path 'value[2]',
ship_date varchar2(10) path 'value[3]',
country varchar2(100) path 'value[4]'
);Some docs about XMLTable and XML querying with Oracle :
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions228.htm#CIHGGHFB
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb_xquery.htm#ADXDB1700
Edited by: odie_63 on 24 juin 2010 20:07 -
How do I TRULY remove the CRLF (#) from the last field read in CSV dataset?
Good day, everyone!
PLEASE NOTE: I spent most of yesterday searching SDN and reading all kinds of threads on this topic. Yes, I know, there ARE other threads out there regarding this topic, but I spent all of yesterday afternoon trying every solution posted and nothing worked. So, to my knowledge, nobody has yet to post a definite solution to this problem.
I am reading a comma-delimited CSV file from our Application Server. It was originally in Microsoft Excel but saved as a CSV file. I open the file as follows:
OPEN DATASET p_fname FOR INPUT IN TEXT MODE ENCODING DEFAULT.
Here is my loop to read the entire file into an internal table, splitting it into individual fields:
READ DATASET p_fname INTO wa_unsplit.
WHILE sy-subrc EQ 0.
ADD 1 TO w_unsplit_tot.
SPLIT wa_unsplit AT w_comma INTO:
wa_split-massn
wa_split-massg
wa_split-curr
wa_split-persg
wa_split-pernr
wa_split-persid
wa_split-persk
wa_split-stat2
wa_split-fisc_year
wa_split-funds_center
wa_split-plans
wa_split-orgeh
wa_split-abkrs
wa_split-werks
wa_split-sem_posit
wa_split-ansal
wa_split-bsgrd
wa_split-adm_adj_amt
wa_split-hourly_rate.
APPEND wa_split TO it_split.
CLEAR: wa_unsplit,
wa_split.
READ DATASET p_fname INTO wa_unsplit.
ENDWHILE.
The problem is that the last field, wa_split-hourly_rate (defined as character length 17) gets a '#' appended to the end of it. This happens with each record, and it appears to be the CR/LF character (the value of it in hex is the same as cl_abap_char_utilities=>cr_lf).
I've tried everything previously recommended to strip this character from my hourly_rate field. I've tried another STRIP command. I've tried REPLACE and TRANSLATE and a whole slew of things. Despite all the threads that exist on SDN about this, I've yet to find something that truly works.
Certainly I can't be the first person reading a file from the Application Server and having this issue.
Please do NOT post links to solutions that DO NOT WORK! Full points will be awarded to anyone who can solve this challenge.
Thanks everyone!Success! Peluka and Naimesh, I had to combine your two recommendations, and I finally got it to work!
Thanks for the clarification, Rich. I ended up calling my "aux" field "junk" for lack of a better word, but in the end you confirmed what I thought it was.
For anyone else out there who has struggled finding a successful answer to this challenge, here's what worked for me:
CONSTANTS: c_comma(1) TYPE c VALUE ',',
c_crlf(1) TYPE c VALUE cl_abap_char_utilities=>cr_lf.
DATA: w_junk TYPE string.
READ DATASET p_fname INTO wa_unsplit.
WHILE sy-subrc EQ 0.
ADD 1 TO w_unsplit_tot.
SPLIT wa_unsplit AT c_comma INTO:
wa_split-massn
wa_split-massg
wa_split-curr
wa_split-persg
wa_split-pernr
wa_split-persid
wa_split-persk
wa_split-stat2
wa_split-fisc_year
wa_split-funds_center
wa_split-plans
wa_split-orgeh
wa_split-abkrs
wa_split-werks
wa_split-sem_posit
wa_split-ansal
wa_split-bsgrd
wa_split-adm_adj_amt
wa_split-hourly_rate.
And here is the line that removes the CR/LF character from the end of the Hourly Rate field!
SPLIT wa_split-hourly_rate AT c_crlf INTO:
wa_split-hourly_rate w_junk.
APPEND wa_split TO it_split.
CLEAR: wa_unsplit,
wa_split.
READ DATASET p_fname INTO wa_unsplit.
ENDWHILE.
Thanks so much, everyone! Once again, SDN folks save the day. Points awarded! -
Array of objects into dataset and then to datagrid
I have discovered amfphp (
http://amfphp.org). It's a really
cool way to move complex data objects from php to flash and back.
quote:
So I am successfully creating an array of items from my
database...an item that would otherwise be created like this:
items = array();
item[0] = new Object();
item[0].id = 7;
item[0].name= "Item 1";
item[0].styleNumber = "001";
item[1] = new Object();
etc.
I put DataSet and DataGrid objects on my stage called
productDataSet and productDataGrid, respectively, and tried this:
quote:
this.productDataSet.items = re.result;
trace('dataSet length:' + this.productDataSet.getLength());
this.productDataGrid.dataProvider =
this.productDataSet.dataProvider;
the trace appears to work correctly--several hundred
items--and the dataGrid shows my object property names (albeit in
reverse order) and the DataGrid appears to have several hundred
items in it but there is NO DATA THERE. All the list items are
blank.
I've had a bit of luck working with the component inspector
creating bindings and stuff but I'm hampered by my incomplete
understanding of how it works. All the tutorials I've found
instruct me to import an XML sample to create a schema. Since I
have no XML i cannot one.
I want to do just a couple of things:
1) put my data in the DataSet properly, ideally in one fell
swoop--i *think* i've done this correctly above
2) attach the DataGrid to the DataSet so that when i sort or
filter the data set, the datagrid shows the results and when i
select an item in the DataGrid, the DataSet knows that is the
currently selected item.
3) hide the 'id' field in the data grid and display
user-friendly names for the columns: "Style Number" rather than
"styleNumber".
Any help would be much appreciated. I *think* this is all
about understanding schemas but I don't really know.That *is* a very interesting article. Unfortunately, it
doesn't mention anything about DataSets. I haven't had any trouble
getting my data into my flash application. I've also been able to
put it into a DataGrid pretty easily (although not quite as
elegantly as that example did).
The problem is that I'm having issues when I introduce a
DataSet for filtering. I can't get the data from the DataSet into
the DataGrid like I want it. I haven't been able to hide the 'id'
column of my data and the column names unfortunately are *exactly*
what the Object property names are. I was hoping to put
user-friendly column headers on their like 'Product Name' rather
than 'name' or 'Style Number' rather than 'styleNumber'.
Also, the concept of a schema is still somewhat beyond me. I
tried changing the schema for my productDataSet to this and I got
the data to display. I added 'name, 'styleNumber', and 'id'
quote:
<-->dataProvider : Array
<-->deltaPacket : DeltaPacket
<-->items : Array
<-->selectedIndex: Number
<-->name : String
<-->styleNumber: String
<-->id : Integer
I have tried radically different shemas (schemae?) that seem
to also get the data in there but I don't really understand what
i'm doing here and I feel like I'm asking for trouble not knowing
how this stuff really works.
And, like I said before, i want to hide certain information
that's in the DataSet so that it doesn't get displayed. I'd also
like to Have some user-friendly names rather than the actual
field/property identifiers. -
I have to read a text file into my data objects until the end of file. I need help with this syntax
do
read dataset file into strfile
while end of file ?Hi Megan,
Hope this code helps you.
Start-of-selection.
open dataset fname for input in text mode.
if sy-subrc <> 0.
message s999(z1) with 'File not found or cannot be opened'.
stop.
endif.
do.
read dataset fname into i_upload.
if sy-subrc <> 0.
exit.
endif.
append i_upload.
clear i_upload.
enddo.
close dataset fname.
Thanks,
Srinivas -
I do have a rtf file stored on dataset
I'd like to read the rtf file and replace some tags within the file...
How can I should I read the file so that the content of the internal table is understandable
thkx in advanceHi,
You can use open dataset,Read dataset, write dataset and close dataset to do the canges in your rtf file.
i am sending one example below:
DATA :
w_fname(60) TYPE c VALUE 'yh1059_bkpf.rtf'.
OPEN DATASET w_fname FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc = 0.
DO.
READ DATASET w_fname INTO fs_bkpf.
IF sy-subrc <> 0.
EXIT.
ELSE.
APPEND fs_bkpf TO t_bkpf.
ENDIF. " IF sy-subrc <> 0.
ENDDO. " Do
ELSE.
WRITE sy-subrc.
ENDIF. " IF sy-subrc = 0.
CLOSE DATASET w_fname. -
I have the following XML file:
<fields>
<name>J. Postma</name>
<date>21-05-2004</date>
</fields>
I want to put the fields in a Hashtable. Name is the key and "J. Postma" is the value. How can I parse the XML and add the fields into a Hashtable?Dubwai, me too. But for only a half-day of effort,
you can make a few helper classes that vastly simplify
the day-to-day usage of DOM.Yes. I've done that too. To the OP, if you use DOM, realize that the text value of a single element may be in multiple Text nodes. You can't just grab the first one. You need to loop through all Text node children and concatenate their values.
Maybe you are looking for
-
HT5957 My 4th generation ipod won't update and says iOS 6.1.3 is up to date
My ipod isn't updating to any new update even though it's out and millions are using it. My ipod is connected to the internet and is a 4th generation. It just contiues to say iOS 6.1.3 is up to date. I have eveb tryed going though itunes store and on
-
I want to use weblogic's T3Services from within stateless session beans. But when I try to do this I get the following error java.rmi.RemoteException: java.lang.NoClassDefFoundError: weblogic/common/T3ServicesDef and when I try to put \weblogic\class
-
Installing two systems in one host - clarification
Hi Experts, We have requirement to install the R3 and BI development system in the same host. I have completed installation of the BI7 system. The database used is SQL server 2005. Now when we install the other system, I am not sure how to go about t
-
I get - Download Error - /Users/ffrasher//Desktop/Firefps 3.6.13.dmg could not be opened, because the associated helper app. does not Exist. Change the association in your Preferences. I run MOSX 1.3.9, Firefox 2.0.0.20. What can I do to upgrade. Fra
-
Insert error from dreamveaver to outlook
when i insert image to office out look using Dreamweaver some line and pictures are not centered as i designed please answer