Xml file to csv.
Dear Friends,
Can anyone share blog to convert file from XML file to CSV.. which can handle multiple records.
my source structure is :
<ROOT>
<HEADER>
A1
B1
</HEADER>
<ITEM>
C1
D1
</ITEM>
</ROOT>
any inputs please ..
Thanks & Regards,
Suman
Hi,
What is the occurance of Header and Item based on that ur FCC will be decided.
refer the below link
Receiver FCC no need of Endseparator
File Adapter (Receiver) - Are we "really" sure about the concepts?
Receiver-
File Receiver with Content Conversion
chirag
Similar Messages
-
Parsing an XML file to a table
Hi,
I am looking at a scenario where right now we have a daily data feed that is an xml file that is approx between 1 to 2 GB in size. Using Java code, this file is parsed and one by one, the records are inserted into the DB (Oracle 10.2). But as the data feed is growing larger, so is the file size -- which is resulting in more time taken for this process to run.
I do realize that the ideal scenario would be to stop using the file as a source of feed. But this is beyond our control.
I looked at using sqlLoader but as I understand it requires a csv based file. In my case, I would have to convert the xml file to csv, which again might be a huge operation to be carried out daily. (Edit: Am I wrong? can we use Sql Loader here?)
Thus I am exploring options if there could be a way to write a PL/SQL procedure that would parse after taking this xml file as an input and load the data into a table. Any suggestions/directions will be hugely appreciated.
Thanks,
Ak
Edit:
I also browsed through a few questions asked previously here and I came across this: Import Large XML File to Table
My situation is similar and as per the suggestion here by A_Non, SECUREFILE BINARY XML storage can be used. But the problem I have is that I am on Oracle 10.2 while this option is only available in a later version, if I am right.
Edited by: Aditya Kumar on Nov 21, 2012 10:49 PM
Edited by: Aditya Kumar on Nov 22, 2012 12:20 AMThanks a lot for your reply Odie.
Exact Oracle version is Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
A couple of doubts here:
1. The file size would range 1-2 GB (and can go beyond) Is SQLLoader also an option feasible in this scenario?
2. The link you mentioned has this line: Storing the XML document in Oracle Database using Binary File (BFILE) -- How is this different from Binary XML in 11g? I am confused.
3. With respect to storage space usage, should we be concerned about the storage space/ memory that the operation of loading the file in this (temporary) table will take? Because right now, the xml feed file is residing in the webserver where java code iterates through it and inserts each record in the table. Now this will change and technically this file will have to go in the DB box.
We do not have the xsd for it as right now we retrieve a few selected tags from this xml, parse and store it in a table (columns mapped to tags). Below is the sample xml. This is one such record and there are thousands below it. I had to change things because of data confidentiality but it mimics the original.
<?xml version="1.0" encoding="windows-1250"?>
<Involvements xmlns="com/xyz/us/abc/v0/ijkdatatypes" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ijk:Involvement xmlns:ijk="com/xyz/us/abc/v0/ijkdatatypes">
<ijk:PCenterData>
<ijk:HPCenterData>
<ijk:HPCenter/>
<ijk:HPCName/>
</ijk:HPCenterData>
</ijk:PCenterData>
<ijk:BillableWBSCode>00000000</ijk:BillableWBSCode>
<ijk:EDescription/>
<ijk:InvolvementType>0</ijk:InvolvementType>
<ijk:ProductData>
<ijk:ICode/>
<ijk:Product/>
<ijk:ProductName/>
</ijk:ProductData>
<ijk:PartnerData>
<ijk:BPartnerData>
<ijk:BPartnerNumber/>
</ijk:BPartnerData>
<ijk:PPartnerData>
<ijk:PPartnerNumber/>
</ijk:PPartnerData>
<ijk:LeadPartnerData>
<ijk:LeadCSPNumber/>
</ijk:LeadPartnerData>
</ijk:PartnerData>
<ijk:ManagerData>
<ijk:BManagerInformation>
<ijk:BManagerNumber/>
</ijk:BManagerInformation>
<ijk:PerformanceManagerInformation>
<ijk:PerformanceManagerNumber/>
</ijk:PerformanceManagerInformation>
</ijk:ManagerData>
<ijk:InvolvementDateData>
<ijk:InvolvementstartDate/>
<ijk:InvolvementTerminationDate/>
</ijk:InvolvementDateData>
<ijk:HostRegion/>
<ijk:WBSD>
<ijk:WBSC>00000000</ijk:WBSC>
<ijk:WBSDescription/>
<ijk:ContractCode/>
<ijk:ContractLine/>
<ijk:ContractLineDescription/>
</ijk:WBSD>
<ijk:PDIndicator>false</ijk:PDIndicator>
<ijk:CompanyCode/>
<ijk:ClientCode/>
<ijk:ContractCode/>
</ijk:Involvement>
</Involvements> -
How to extract data from an arbitrary xml file and export in a nice csv file?
Hallo,
I'm facing big problems in the use of XML files. I have an
application which generates XML files with clusters containing arrays
and scalars like in the example pasted below. My task is to
read it and export the data in a human-friendly CSV document.
Since I don't know the actual content of the cluster, I need some kind
of intelligent vi which goes through the XML file looking for arrays
and other data structures in order to export them properly in the CSV
format (columns with headers).
Thank you
<Cluster>
<Name></Name>
<NumElts>3</NumElts>
<Array>
<Name></Name>
<Dimsize>6</Dimsize>
<I32>
<Name></Name>
<Val>0</Val>
</I32>
<I32>
<Name></Name>
<Val>1</Val>
</I32>
<I32>
<Name></Name>
<Val>2</Val>
</I32>
<I32>
<Name></Name>
<Val>3</Val>
</I32>
<I32>
<Name></Name>
<Val>4</Val>
</I32>
<I32>
<Name></Name>
<Val>5</Val>
</I32>
</Array>
<DBL>
<Name></Name>
<Val>3.14159265358979</Val>
</DBL>
<String>
<Name></Name>
<Val>ciao</Val>
</String>
</Cluster>
Solved!
Go to Solution.Thank you again,
I'm forwarding my vi draft with many comments and an xml file sample.
Data in cluster is stored according to the LabVIEW schema, infact it is generated by LabVIEW.
What I'm trying to do is to access the element of the cluster and read their content using the Invoke node and Property node functions. Could you give it a look, there may be something wrong, I'm not able to access cluster children.
Which funcions should I use? Could you give me an example? You may use the draft I enclosed...
Then write these data in a csv file
should be the easier part.
BODY{font:x-small 'Verdana';margin-right:1.5em}
.c{cursor:hand}
.b{color:red;font-family:'Courier New';font-weight:bold;text-decoration:none}
.e{margin-left:1em;text-indent:-1em;margin-right:1em}
.k{margin-left:1em;text-indent:-1em;margin-right:1em}
.t{color:#990000}
.xt{color:#990099}
.ns{color:red}
.dt{color:green}
.m{color:blue}
.tx{font-weight:bold}
.db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px solid #CCCCCC;font:small Courier}
.di{font:small Courier}
.d{color:blue}
.pi{color:blue}
.cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small Courier;color:#888888}
.ci{font:small Courier;color:#888888}
PRE{margin:0px;display:inline}
<?xml
version="1.0" encoding="iso-8859-1" ?>
<Contents type="Data"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="XMLSection.xsd">
<section name="beta"
date="7/31/2009" time="3:43:03 PM" version="1.0">
<Cluster>
<Name />
<NumElts>1</NumElts>
<Array>
<Name />
<Dimsize>4</Dimsize>
<DBL>
<Name>number: 0 to 1</Name>
<Val>0.93317638164326</Val>
</DBL>
<DBL>
<Name>number: 0 to 1</Name>
<Val>0.79233924020314</Val>
</DBL>
<DBL>
<Name>number: 0 to 1</Name>
<Val>0.39199947274518</Val>
</DBL>
<DBL>
<Name>number: 0 to 1</Name>
<Val>0.74817197429441</Val>
</DBL>
</Array>
</Cluster>
</section>
</Contents>
Attachments:
read_array.vi 12 KB -
Can I automate the creation of a cluster in LabView using the data structure created in an auto generated .CSV, C header, or XML file? I'm trying to take the data structure defined in one or more of those files listed and have LabView automatically create a cluster with identical structure and data types. (Ideally, I would like to do this with a C header file only.) Basically, I'm trying to avoid having to create the cluster by hand, as the number of cluster elements could be very large. I've looked into EasyXML and contacted the rep for the add-on. Unfortunately, this capability has not been created yet. Has anyone done something like this before? Thanks in advance for the help.
Message Edited by PhilipJoeP on 04-29-2009 04:54 PM
Solved!
Go to Solution.smercurio_fc wrote:
Is this something you're trying to do at runtime? Clusters are fixed data structures so you can't change them programmatically. Or, are you just trying to create some typedef cluster controls so that you can use them for coding? What would your clusters basically look like? Perhaps another way of holding the information like an array of variants?
You can try LabVIEW scripting, though be aware that this is not supported by NI.
Wow! Thanks for the quick response! We would use this cluster as a fixed data structure. No need to change the structure during runtime. The cluster would be a cluster of clusters with multiple levels. There would be not pattern as to how deep these levels would go, or how many elements would be in each. Here is the application. I would like to be able to autocode a Simulink model file into a DLL. The model DLL would accept a Simulink bus object of a certain data structure (bus of buses), pick out which elements of the bus is needed for the model calculation, and then pass the bus object. I then will take the DLL file and use the DLL VI block to pass a cluster into the DLL block (with identical structure as the bus in Simulink). To save time, I would like to auto generate the C header file using Simulink to define the bus structure and then have LabView read that header file and create the cluster automatically. Right now I can do everything but the auto creation of the cluster. I can manually build the cluster to match the Simulink model bus structure and it runs fine. But this is only for an example model with a small structure. Need to make the cluster creation automated so it can handle large structures with minimal brute force. Thanks! -
Extracting data from a tag of xml file which is(xml) in a Field of Csv.
We have a xlm script which is stored in the clob column of the csv file. we have to extract one value from the <tag> and reject remaining data.
Sample:-
<ROW>
<ID>100</ID>
<ORDER_DATE>2000.12.20</ORDER_DATE>
<SHIPTO_NAME>Adrian Howard</SHIPTO_NAME>
<SHIPTO_STREET>500 Marine World Parkway</SHIPTO_STREET>
<SHIPTO_CITY>Redwood City</SHIPTO_CITY>
<SHIPTO_STATE>CA</SHIPTO_STATE>
<SHIPTO_ZIP>94065</SHIPTO_ZIP>
</ROW>
Required Output:-
We have to extract the "500 Marine World Parkway"
from tag <SHIPTO_STREET>
and the above sample xml file is in one of the column which is clob datatype
Any idea How to perform the above activity in PL/SQL ?As BP suggested you can use an XPATH query to extract that information from your XML. However it depends a bit on your XML data.
Here are two examples:
one row XML
select extractvalue(xmltype('<ROW>
<ID>100</ID>
<ORDER_DATE>2000.12.20</ORDER_DATE>
<SHIPTO_NAME>Adrian Howard</SHIPTO_NAME>
<SHIPTO_STREET>500 Marine World Parkway</SHIPTO_STREET>
<SHIPTO_CITY>Redwood City</SHIPTO_CITY>
<SHIPTO_STATE>CA</SHIPTO_STATE>
<SHIPTO_ZIP>94065</SHIPTO_ZIP>
</ROW>')
,'//SHIPTO_STREET/text()') as result
from dual;
RESULT
500 Marine World Parkway
multi rows XML
select extractvalue(column_value,'SHIPTO_STREET/text()') as result
from table(xmlsequence(extract(xmltype('<ROWS>
<ROW>
<ID>100</ID>
<ORDER_DATE>2000.12.20</ORDER_DATE>
<SHIPTO_NAME>Adrian Howard</SHIPTO_NAME>
<SHIPTO_STREET>500 Marine World Parkway</SHIPTO_STREET>
<SHIPTO_CITY>Redwood City</SHIPTO_CITY>
<SHIPTO_STATE>CA</SHIPTO_STATE>
<SHIPTO_ZIP>94065</SHIPTO_ZIP>
</ROW>
<ROW>
<ID>200</ID>
<ORDER_DATE>2000.12.20</ORDER_DATE>
<SHIPTO_NAME>Adrian Howard</SHIPTO_NAME>
<SHIPTO_STREET>Test</SHIPTO_STREET>
<SHIPTO_CITY>Redwood City</SHIPTO_CITY>
<SHIPTO_STATE>CA</SHIPTO_STATE>
<SHIPTO_ZIP>94065</SHIPTO_ZIP>
</ROW>
</ROWS>'
),'ROWS/ROW/SHIPTO_STREET')));
RESULT
500 Marine World Parkway
Test -
Splitting of a CSV File with Multiple Records into Multiple XML File
Dear All,
<b> I am doing a Scenario of CSV to XML Files. I am using BPM for the same. My incoming CSV File has got multiple records. I want to break this Multiple records into Multiple XML Files having one record each.</b>
Can someone suggest how can I break this rather Split this into Multiple XML Files.
Is Multimapping absoltely necesaary for this. Can't we do this without Multimapping. Can we have some workaround in the FCC parameters that we use in the Integration Directory.
Kindly reply ASAP. Thanks a lot to all in anticipation.
Pls Help.
Best Regards
Chakra and SomnathDear All,
I am trying to do the Multimapping, and have 0....unbounded also. Someways it is not working.
<b>
Smitha please tell me one thing...Assigning the Recordsets per Message to 1, does it mean that it will write multiple XML Files as I want.</b>
Also I am usinf Set to Read only. So once the File is read it becomes RA from A. Then will it write the other Records.
I have to use a BPM because there are certain dependencies that are there for the entire Process Flow. I cannot do without a BPM.
Awaiting a reply. Thanks a lot in anticipation.
Best Regards
Chakra and Somnath -
Filtering columns in a .csv file v .xml file
Hi everyone,
The following code fragment apparently creates a dataset from an xml file. The first line creates the dsStates dataset from an xml file called states.xm. The second line seems to be pulling in the list of cities into the dsCities dataset from the same xml file. I mean I assume this is what it's doing since it's accessing {dsStates::url} and then "/state/cities/city".
var dsStates = new Spry.Data.XMLDataSet("../../data/states/states.xml", "/states/state");
var dsCities = new Spry.Data.XMLDataSet("../../data/states/{dsStates::url}", "/state/cities/city");
My question is that since I'm not using xml as the source file for the dataset I'm creating but instead I'm using a .csv file, I'm wondering whether I can create two similar constructor functions like the above xml versions. I assumed that the first line would be as follows:
var dsTypes = new Spry.Data.CSVDataSet("data/types.csv");
This would bring in the data from a .csv file called "types.csv".
The question is though how would I access certain columns in this types.csv file so that I can filter them into the second dataset which would be called dsHospitals. I started off with the following line:
var dsHospitals = new Spry.Data.CSVDataSet(" ");
...but then since it's not xml is there are way to target these columns as it's done in the xml version. Or are there limitations with what I can do with a .csv file compared to xml files?
Would really appreciate any advice.Thanks for the reply,
I've actually ended up using an xml file instead of a .csv due to the limitations.
I'm pulling in some xml files dynamically into a table and have based the code on the information at the following url:
http://labs.adobe.com/technologies/spry/samples/data_region/SpryPagedViewSample.html
My application is identical to the one in the above url except that instead of bringing in state and cities, I'm bringing in categories instead of the states and hospital names and addresses instead of the cities.
The example in the url uses an unordered list to display the names of the cities as in the following code:
<div spry:region="pvFacilities dsFacilities">
<ul spry:repeatchildren="pvFacilities" spry:choose="choose">
<li spry:when="{pvFacilities::ds_RowID} == {pvFacilities::ds_CurrentRowID}" spry:select="select" spry:selectgroup="page" spry:selected="selected" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::name}</li>
<li spry:default="default" spry:select="select" spry:selectgroup="page" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::name}</li>
</ul>
</div>
I needed to revise this since I'm not only displaying one item, ie. the city name as in the example, but instead I'll be displaying the full hospital details which would require that the information is inserted into a table. So I had to adapt the above code to work with a table and I came up with the following:
<div id="privRegion" spry:region="pvFacilities dsFacilities">
<table id="private" cellspacing="0" summary="A list of private hospitals">
<caption>Private Hospitals </caption>
<thead>
<tr>
<th id="name" scope="col"><a href="#">Name</a>
</td>
<th id="address" scope="col">Address</td>
<th id="suburb" scope="col"><a href="#">Suburb</a>
</td>
<th scope="col">State
</td>
<th scope="col">Postcode</td>
<th scope="col">Phone</td>
<th scope="col">Fax</td>
</tr>
</thead>
<tbody>
<tr spry:repeatchildren="pvFacilities" spry:choose="choose">
<td spry:when="{pvFacilities::ds_RowID} == {pvFacilities::ds_CurrentRowID}" spry:select="select" spry:selectgroup="page" spry:selected="selected" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::Name}</td>
<td spry:default="default" spry:select="select" spry:selectgroup="page" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::Address}</td>
<td spry:default="default" spry:select="select" spry:selectgroup="page" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::Suburb}</td>
<td spry:default="default" spry:select="select" spry:selectgroup="page" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::State}</td>
<td spry:default="default" spry:select="select" spry:selectgroup="page" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::Postcode}</td>
<td spry:default="default" spry:select="select" spry:selectgroup="page" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::Phone}</td>
<td spry:default="default" spry:select="select" spry:selectgroup="page" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::Fax}</td>
</tr>
</tbody>
</table>
</div>
When I test though, it's only bringing in the first row and even then, it's only bringing in the hospital name and then 19 of the phone numbers from other hospitals! Not exactly what I was aiming for?
Are you able to take a look at the following url to see where I may have gone wrong?
http://files.officelinkonline.com.au/spry_test/
Really appreciate any help/advice. -
Simple Transformation to deserialize an XML file into ABAP data structures?
I'm attempting to write my first simple transformation to deserialize
an XML file into ABAP data structures and I have a few questions.
My simple transformation contains code like the following
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates"
xmlns:pp="http://www.sap.com/abapxml/types/defined" >
<tt:type name="REPORT" line-type="?">
<tt:node name="COMPANY_ID" type="C" length="10" />
<tt:node name="JOB_ID" type="C" length="20" />
<tt:node name="TYPE_CSV" type="C" length="1" />
<tt:node name="TYPE_XLS" type="C" length="1" />
<tt:node name="TYPE_PDF" type="C" length="1" />
<tt:node name="IS_NEW" type="C" length="1" />
</tt:type>
<tt:root name="ROOT2" type="pp:REPORT" />
<QueryResponse>
<tt:loop ref="ROOT2" name="line">
<QueryResponseRow>
<CompanyID>
<tt:value ref="$line.COMPANY_ID" />
</CompanyID>
<JobID>
<tt:value ref="$line.JOB_ID" />
</JobID>
<ExportTypes>
<tt:loop>
<ExportType>
I don't know what to do here (see item 3, below)
</ExportType>
</tt:loop>
</ExportTypes>
<IsNew>
<tt:value ref="$line.IS_NEW"
map="val(' ') = xml('false'), val('X') = xml('true')" />
</IsNew>
</QueryResponseRow>
</tt:loop>
</QueryResponse>
</tt:loop>
1. In a DTD, an element can be designated as occurring zero or one
time, zero or more times, or one or more times. How do I write the
simple transformation to accommodate these possibilities?
2. In trying to accommodate the "zero or more times" case, I am trying
to use the <tt:loop> instruction. It occurs several layers deep in the
XML hierarchy, but at the top level of the ABAP table. The internal
table has a structure defined in the ABAP program, not in the data
dictionary. In the simple transformation, I used <tt:type> and
<tt:node> to define the structure of the internal table and then
tried to use <tt:loop ref="ROOT2" name="line"> around the subtree that
can occur zero or more times. But every variation I try seems to get
different errors. Can anyone supply a working example of this?
3. Among the fields in the internal table, I've defined three
one-character fields named TYPE_CSV, TYPE_XLS, and TYPE_PDF. In the
XML file, I expect zero to three elements of the form
<ExportType exporttype='csv' />
<ExportType exporttype='xls' />
<ExportType exporttype='pdf' />
I want to set field TYPE_CSV = 'X' if I find an ExportType element
with its exporttype attribute set to 'csv'. I want to set field
TYPE_XLS = 'X' if I find an ExportType element with its exporttype
attribute set to 'xls'. I want to set field TYPE_PDF = 'X' if I find
an ExportType element with its exporttype attribute set to 'pdf'. How
can I do that?
4. For an element that has a value like
<ErrorCode>123</ErrorCode>
in the simple transformation, the sequence
<ErrorCode> <tt:value ref="ROOT1.CODE" /> </ErrorCode>
seems to work just fine.
I have other situations where the XML reads
<IsNew value='true' />
I wanted to write
<IsNew>
<tt:value ref="$line.IS_NEW"
map="val(' ') = xml('false'), val('X') = xml('true')" />
</IsNew>
but I'm afraid that the <tt:value> fails to deal with the fact that in
the XML file the value is being passed as the value of an attribute
(named "value"), rather than the value of the element itself. How do
you handle this?Try this code below:
data l_xml_table2 type table of xml_line with header line.
W_filename - This is a Path.
if w_filename(02) = '
open dataset w_filename for output in binary mode.
if sy-subrc = 0.
l_xml_table2[] = l_xml_table[].
loop at l_xml_table2.
transfer l_xml_table2 to w_filename.
endloop.
endif.
close dataset w_filename.
else.
call method cl_gui_frontend_services=>gui_download
exporting
bin_filesize = l_xml_size
filename = w_filename
filetype = 'BIN'
changing
data_tab = l_xml_table
exceptions
others = 24.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif. -
Can we do a Secure FTP for an XML file from ABAP when firewall is enabled?
Hi all,
I have a requirement to send an XML file to an External FTP Server which is out of our corporate network and our firewall is enabled.
I have to send an XML file with Purchase Order details. I completed that with the help of this blog https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2657. [original link is broken] [original link is broken] [original link is broken]
Now I need to FTP the XML file that is generated. How should I be doing this? Can some of help me with this?
I need to do a Secure FTP to the external non SAP server which is out of our corporate network and our firewall is enabled. Can some one tell me if SFTP is possible in ABAP.
This is not a web service. I am working on dropping an XML file in an external FTP serveru2026 I have searched the forums but still in a confusion if weather Secure FTP is possible in ABAP or not when our company firewall is enabledu2026
If some one encountered this situation earlier please help,,,..any help will be highly appreciated.
Regards,
Jessica SamThanks a lot for your valuable suggestions Richu2026
I agree with you Rich that web services would be a better option. But I need to send this file to an external third party and they dont have web services.
They are telling us that either we can send them an XML file or a CSV file in the format that they want. We decided to go with XML file format.
I am done with formatting the Purchase Order details in the format that they want. Now the challenge is that I need to send this FTP file to them and it should be a Secure FTP when our fire wall is enabled,
When you say
1) Run an ABAP program to generate the XML file and put it on the local PC
2) Log into the FTP site via some FTP client, could simply be windows as well.
3) Manually cut/paste the file from the PC to the FTP site.
For Step 1 running ABAP Program can I schedule a batch job?
For Step 2 and Step 3 can I automate it in any other way..if not in ABAP?
Can I advice my company to follow any alternate method in which they can automate this step 2 and step 3u2026if not in ABAP can it be possible in any other way as the third party does not have web services I now have no other alternative.
Please Helpu2026
Regards,
Jessica Sam -
Unable to recreate replica as I cannot delete the xml files for the old VM on Hyper-v Cluster
My setup
There are 2 sites each running a Hyper-v 2012-R2 cluster comprising of 5 nodes each.
All the machines are in a HA state and stored on the shared clustered resource.
Initially we had replication working and it was replicating all the servers from Site A to Site B
There were some replication issues which needed me to stop the replication and redo it again, in doing so I firstly removed replication on Fail-over cluster manager on Site A and did the same on Site B.
On one of the servers I had to remove the VM, although the VM config and Disks still remain on the Site B Cluster.
I was trying to recreate the replica but it always fails with the following error :
Hyper-v failed to enable replication for virtual machine xxxxxxxx operation aborted (0x80004004).....
I followed an article to stop the Hyper-V Virtual Machine Management Service and try delete the file,
When i tried to stop the service it would restart automatically and I was unable to delete the file. I put the service in disabled which kept it stopped however I was still unable to delete the files. I also tried to get File assassin which can help delete
and clear locked files but it too was unable to delete it while the service was running or stopped as well as its additional mode whereby it will delete it on next reboot.
The Article Https://social.technet.microsoft.com/Forums/windowsserver/en-US/4c4f2535-81ee-4a21-a920-b5632de2be37/hyperv-old-vm-folders-cannot-be-deleted?forum=winserverhyperv
makes mention of stopping another service Hyper-V
Image Management Service but I am unable to find it on 2012-R2 server.
I have also tried to put the additional nodes in a paused drained roles state leaving only one node as the active one but it still will not let me delete the VM config
files, without removing those files I cannot re-initiate the Replication.
Any assistance would be greatly appreciated.Can you storage migrate any other vms or resources off of the CSV that contains the XML file in question? If so you may be able to then take that CSV offline, remove it from available storage, re-add as available storage, and add to CSV Volumes. Maybe
that will clear your lock. -
How to load XML File to BW Delta Queue via Webpage
Hello altogether,
I am trying to load an CSV file via Webpage (the Webpage have to change the csv file in a xml/soap file) into BW Delta Queue.
Steps that I have made:
- Create an InfoSource
- Create an BW Data Source with Soap Connection
- Create an initial Delta without Data Transfer
- Create a Web Service with TC - SE37 - Utilities -> More Utilities -> Create Web Service
If I test the Web Service with TC - Soamanager (BW 7.0), the data entered here, are transferred to the BW Delta Queue.
If I test the function module ( TC - SE37), the data also transferred to the Delta Queue.
Now I think, that I have an error in the html file or the html file is not conform to the wsdl document?? Or should I have to create a virtual interface, but I don't find a possibility to creat it...???
Can you please help me????
The coding of the WSDL Document and the Website is attached (I can also send you the coding and error message via mail, if you want). Sorry I don't know how to display here the coding. I try it with symbol "click to display the text code", but afterwards I get an error message from the website... So let me please know your mail address and I send it via mail....
I hope, that somebody can help me!!!!!
Edited by: Alina99 on Sep 8, 2009 11:44 AM
Error Message from BW:
...sap-env:envelope..... soap-env:body><soap-env:fault><faultcode>soap-env:Client</faultcode></faultstring xml:lang="eng">Virtual Interface Method>_-BI0_-QI6AZ_XML_APPL2_RFC::urn:sap-com:document:sap:soap:functions:mc-style<not supported</faultstring>.......
Edited by: Alina99 on Sep 8, 2009 11:56 AMHello,
I have done all the necessary config in BW. However, as I mentioned earlier, we are still not up with XI so I am trying to load XML to BW delta queue. The question still remains, how do I make make the XML file (on my desktop say) point to the BW so the InfoPackage picks up and places in the delta queue? Even if I had XI, there has to be a way whereby BW looks for the XML file. That is what I want to know and stuck at.
Any detailed step by step help will be appreciated as always.
Cheers -
How do I use an XML file to stream information to a Webapp?
I am trying to use XML generated by an event calander application to set it up with an image slider on the sites webpage. I need it to read in event info and use a picture so that the slider can show "Upcomming Events". It would have a picture, date and link to buying tickets from the ticketmaster page. I am pretty new to web apps and not sure how to set one up to utilize an XML data stream.
Hi,
You can't use XML to stream data into webapps, but if you convert the xml to a csv file for example, you could use the import function.
Kind Regards,
Alex -
Error while downloading the xml file
i am having a internal table which contains data in xml format but i am unable to download the data into local system by using 'GUI_DOWNLOAD' fn. module
its error its showing is as :
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
A name contained an invalid character. Error processing resource 'file:///D:/XX.XML'. Line 4, Position 4
MOD/><RPTSX/><MANDT/><SYPSY/><SYSID/><SAPRL/></T682><T682><KVEWE>A</KV...hello Durairaj,
i am fwd the code go thru it and check why the xml file is not downloading,
and after downloading the file i want that file to be in displayed in .pdf.
REPORT ZCCSV_TO_XML.
DATA : BEGIN OF TABLE OCCURS 0,
TABNAME(15) TYPE C,
END OF TABLE.
DATA : BEGIN OF HEADER_NAMTAB OCCURS 0,
NAMTAB TYPE STRING,
END OF HEADER_NAMTAB.
DATA : BEGIN OF CONVERT_ITAB_TO_XML OCCURS 0,
FIELDNAME(255) TYPE C,
END OF CONVERT_ITAB_TO_XML .
DATA : BEGIN OF CONVERT_XML_TO_ITAB OCCURS 0,
FIELDNAME(255) TYPE C,
END OF CONVERT_XML_TO_ITAB.
DATA DREF TYPE REF TO DATA.
DATA TNAME LIKE DD02L-TABNAME.
DATA BEGIN OF ZDFIES OCCURS 0.
INCLUDE STRUCTURE DFIES.
DATA END OF ZDFIES.
DATA: xml_out TYPE string .
DATA: xml_TO_ITAB TYPE string .
data : wa_indx type indx.
DATA : DETAIL(30).
DATA : DATA1 TYPE STRING.
DATA : COMMA . "VALUE ','.
DATA : DBTAB1(15) TYPE C.
FIELD-SYMBOLS: <ITAB> TYPE ANY TABLE,
<WA> TYPE ANY,
<WA1> TYPE ANY .
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME,
SKIP 1.
PARAMETERS : SPOOL RADIOBUTTON GROUP rad1 DEFAULT 'X',
CSV RADIOBUTTON GROUP rad1 ,
XMLTOPDF RADIOBUTTON GROUP rad1.
SELECTION-SCREEN : SKIP 1,
END OF BLOCK b1.
TABLE-TABNAME = 'T681'.
APPEND TABLE.
TABLE-TABNAME = 'T682'.
APPEND TABLE.
IF SPOOL = 'X'.
PERFORM SPOOL.
ELSEIF CSV = 'X'.
PERFORM CSV.
ELSEIF XMLTOPDF = 'X'.
PERFORM XMLTOPDF.
ENDIF.
*& Form CSV
form CSV .
LOOP AT TABLE.
dbtab1 = TABLE-TABNAME.
TNAME = dbtab1.
PERFORM GETFIELDS.
LOOP AT HEADER_NAMTAB.
WRITE: HEADER_NAMTAB-NAMTAB, COMMA.
ENDLOOP.
PERFORM GET_DETAIL_LIST.
ENDLOOP.
endform. " CSV
form XMLTOPDF .
LOOP AT TABLE.
PERFORM GET_DETAIL_LIST.
ENDLOOP.
endform. " XMLTOPDF
GETTING THE HEADER OF THE TABLE *
FORM GETFIELDS.
REFRESH HEADER_NAMTAB.
CALL FUNCTION 'GET_FIELDTAB'
EXPORTING
LANGU = SY-LANGU
ONLY = SPACE
TABNAME = TNAME
WITHTEXT = 'X'
TABLES
FIELDTAB = ZDFIES
EXCEPTIONS
INTERNAL_ERROR = 01
NO_TEXTS_FOUND = 02
TABLE_HAS_NO_FIELDS = 03
TABLE_NOT_ACTIV = 04.
CASE SY-SUBRC.
WHEN 0.
LOOP AT ZDFIES.
HEADER_NAMTAB-NAMTAB = ZDFIES-SCRTEXT_M.
APPEND HEADER_NAMTAB.
ENDLOOP.
WHEN OTHERS.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-SUBRC.
ENDCASE.
ENDFORM. " GETFIELEDS
*& Form GET_DETAIL_LIST
form GET_DETAIL_LIST .
CREATE DATA DREF TYPE STANDARD TABLE OF (TABLE)
WITH NON-UNIQUE DEFAULT KEY.
ASSIGN DREF->* TO <ITAB> .
SELECT * FROM (TABLE) INTO TABLE <ITAB>.
CALL TRANSFORMATION ('ID')
SOURCE tab = <ITAB>[]
RESULT XML xml_out.
Convert to TABLE
CALL FUNCTION 'HR_EFI_CONVERT_STRING_TO_TABLE'
EXPORTING
i_string = xml_out
i_tabline_length = 100
TABLES
et_table = CONVERT_ITAB_TO_XML.
Download
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filetype = 'ASC'
filename = 'D:\XX.XML'
TABLES
data_tab = CONVERT_ITAB_TO_XML
endform. -
XML file from PL/SQL Executable Program
Hi all,
I have to solve this issue. I registered a concurrent program based on a PL/SQL Stored Procedure which extracts data in CSV format. The output is ok and ready to be imported in an excel worksheet and this is ok.
But, I wanted to create also an rtf template to associate to this concurrent, so the output is in more readable PDF format with table and clear formatting.
The problem is the publisher doesn't recognize the CSV datas and doesn't create the pdf. Is there any PL/SQL command to translate CSV to XML output? Thanks, MicheleMichele, I have a suggestion for you. It's not the exact solution you're looking for, but it may work for you.
I use Oracle Reports to create both XML data and CSV data. The output is a single formula field within the lowest level group that displays all of the data, delimited field by field. I define two concurrent programs based on this executable -- one with output format XML and one with output format Text. That way I can associate templates with the first program, and can use the second program to produce my CSV file which is ready for import to Excel.
You can either convert your PL/SQL stored procedure to Oracle Reports, or use a temporary table to store the data that the procedure is displaying, then call the procedure in an Oracle Reports trigger and select the data in the Data Model.
HTH.
Carrie Hollack -
Download created XML File in batch mode // Parse XML file into single lines
Hello!
I upload a CSV file and based on that CSV file I create an XML "object". First I uploaded and downloaded it via gui frontendclass, but as it has to be run in a batch in the night I need to upload and download the data via OPEN DATASET.
The import and transformation of the CSV file works fine, also the transfer into an itab with the same structure as a CSV line is ok. I also create the XML file, which could be downloaded easily with gui-download but it is not permittet.
Import of data: I scan the folder and get the filenames into a itab, I loop over that itab and read the single files like this:
OPEN DATASET ls_convert_batch FOR INPUT IN TEXT MODE ENCODING DEFAULT.
CLEAR tab.
IF sy-subrc = 0.
DO.
READ DATASET ls_convert_batch INTO line.
IF sy-subrc <> 0.
EXIT.
ELSE.
CLEAR tmptab.
SPLIT line AT ';' INTO tmptab-product
tmptab-contract
tmptab-extagent.
APPEND tmptab TO tab.
ENDIF.
ENDDO.
ENDIF.
The XML file has a strucutre like
<file>
- <file formant_no="1.1" format_date="02.10.2003">
<status>V</status>
<number>001001025</numbner>
<name>Schmeisser,Christof</name>
- <details>
- <detail>
<contract>00000003494</contract>
<name>Schmeisser, Christof</name>
<invoice_no>000000003840</invoice_no>
<due_date>20100601</due_date>
<amount>140,00</amount>
</detail>
- <detail>
<contract>00000003495</contract>
<name>Schmeisser, Christof</name>
<invoice_no>000000003841</invoice_no>
<due_date>20100601</due_date>
<amount>130,00</amount>
</detail>
- </details>
<elements>2</elements>
<amount_overall>270</amount_overall>
</file>
At the moment I download it like this:
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = l_xml_size
filename = filename
filetype = 'BIN'
* CONFIRM_OVERWRITE = '0'
CHANGING
data_tab = l_xml_table
EXCEPTIONS
OTHERS = 24.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSEIF sy-subrc = 0.
lv_create_counter = lv_create_counter + 1.
ENDIF.
But I need to download it via OPEN TRANSFER CLOSE Dataset as it has to run in batch mode.
Anyone has an idea? I am really desperate here. One idea would be to parse the single lines into a string and then create the XML file line by line as text and save it with ending XML, should work. But I don't know how!
Thank you very much in advance,
kind regards from Tallinn, Estonia,
Christof!
Edited by: Christof Schmeisser on Nov 25, 2010 7:51 PM
I edited the heading, would be too general and missleading!Tipos Pools
TYPE-POOLS: ixml.
CLASS cl_ixml DEFINITION LOAD.
TYPES: BEGIN OF xml_node_type,
node TYPE char50,
vlnode TYPE string,
END OF xml_node_type,
BEGIN OF xml_line_type,
data(256) TYPE x,
END OF xml_line_type.
Tabelas Internas
DATA: ti_xml_node TYPE TABLE OF xml_node_type.
Variáveis TYPE REF
*Type REF para utilizar no XML
DATA: ixml_type TYPE REF TO if_ixml,
streamfactory_type TYPE REF TO if_ixml_stream_factory,
ostream_type TYPE REF TO if_ixml_ostream,
istream_type TYPE REF TO if_ixml_istream,
parser_type TYPE REF TO if_ixml_parser,
renderer_type TYPE REF TO if_ixml_renderer,
document_type TYPE REF TO if_ixml_document,
encoding_type TYPE REF TO if_ixml_encoding,
node_type TYPE REF TO if_ixml_node,
element_dtrans_type TYPE REF TO if_ixml_element,
element_xml_in_type TYPE REF TO if_ixml_element,
element_roteiros_type TYPE REF TO if_ixml_element,
element_roteiro_type TYPE REF TO if_ixml_element,
element_vias_type TYPE REF TO if_ixml_element,
element_via_type TYPE REF TO if_ixml_element,
element_dummy_type TYPE REF TO if_ixml_element,
gw_xml_node TYPE TABLE OF xml_node_type,
gw_xml_node_ret TYPE TABLE OF xml_node_type,
gw_xml_node_err TYPE TABLE OF xml_node_type,
gw_xml_node_xml TYPE TABLE OF xml_node_type,
gw_xml_table TYPE TABLE OF xml_line_type,
gw_xml_table2 TYPE TABLE OF xml_line_type,
gs_xml_node TYPE xml_node_type, "WA para leitura do xml
gs_xml_node_ret TYPE xml_node_type, "WA para leitura do xml retorno
gs_xml_node_err TYPE xml_node_type, "WA para leitura do xml erro
gs_xml_node_xml TYPE xml_node_type, "WA para leitura do xml info sucesso
gs_xml_table2 TYPE xml_line_type. "WA para importar xml
Variáveis do Programa
DATA: l_value TYPE string,
l_rc TYPE i,
l_xml_size TYPE i,
cod_cartaorepom TYPE char20 VALUE '123456789',
v_caminho_exp TYPE string VALUE 'C:TEMP',
v_salvaarquivo TYPE string,
v_nomearquivo TYPE string,
w_nodetext TYPE string,
v_roteiros TYPE string,
v_roteiro TYPE string,
v_roteiro_codigo TYPE string,
v_percurso_codigo TYPE string,
v_percurso_descricao TYPE string,
v_cidade_origem TYPE string,
v_estado_origem TYPE string,
v_cidade_destino TYPE string,
v_estado_destino TYPE string,
v_transporte_tipo TYPE string,
v_cartao_taxa TYPE string,
v_cobra_taxa TYPE string.
Constants
CONSTANTS: cc_39 TYPE string VALUE '39', " Numero 39.
cc_dt_trans TYPE string VALUE 'data_transfer'," document_type(name)
cc_metodo_cod TYPE string VALUE 'metodo_codigo'," document_type(name)
cc_xml_in TYPE string VALUE 'xml_in'," document_type(name)
cc_ct_tx_ativ TYPE string VALUE 'cartao_taxa_ativacao'," document_type(name)
cc_cartao TYPE string VALUE 'cartao', " Parâmetro Perform.
cc_xml TYPE string VALUE '.XML'," extenção
cc_bin TYPE char10 VALUE 'BIN'." filetype
START-OF-SELECTION.
PERFORM yf_inicia_criacao_xml USING cc_39.
element_roteiro_type = document_type->create_simple_element(
name = cc_ct_tx_ativ
parent = element_xml_in_type ).
PERFORM yf_dummy_roteiro USING cod_cartaorepom cc_cartao.
PERFORM yf_finaliza_xml.
PERFORM yf_exporta_xml USING v_caminho_exp.
PERFORM yf_convert_xml_to_itab TABLES gw_xml_node_ret
USING v_salvaarquivo.
END-OF-SELECTION.
*& Form yf_inicia_criacao_xml
text
-->VALUE(P_0783) text
FORM yf_inicia_criacao_xml USING value(p_0783).
DATA: s_encoding_type TYPE string VALUE 'ISO-8859-1'.
Cria o ixml factory
ixml_type = cl_ixml=>create( ).
*Cria o objeto com modelo
document_type = ixml_type->create_document( ).
*Cria o cabeçalho encoding="iso-8859-1"
encoding_type = ixml_type->create_encoding( byte_order = 0
character_set = s_encoding_type ).
*Cria o root "DATA_TRANSFER"
element_dtrans_type = document_type->create_simple_element(
name = cc_dt_trans
parent = document_type ).
*Cria o node "METODO_CODIGO" e preenche com um valor passado no L_VALUE
l_value = p_0783.
CONDENSE l_value.
element_dummy_type = document_type->create_simple_element(
name = cc_metodo_cod
value = l_value
parent = element_dtrans_type ).
*Cria o node "XML_IN"
element_xml_in_type = document_type->create_simple_element(
name = cc_xml_in
parent = element_dtrans_type ).
ENDFORM. " yf_inicia_criacao_xml
*& Form yf_dummy_roteiro
text
-->VALUE(P_0996) text
-->VALUE(P_0997) text
FORM yf_dummy_roteiro USING value(p_0996)
value(p_0997).
l_value = p_0996.
CONDENSE l_value.
element_dummy_type = document_type->create_simple_element(
name = p_0997
value = l_value
parent = element_roteiro_type ).
ENDFORM. " yf_dummy_roteiro
*& Form yf_finaliza_xml
text
FORM yf_finaliza_xml.
*Cria o stream factory
streamfactory_type = ixml_type->create_stream_factory( ).
*Conecta a internal table de XML com o stream factory
ostream_type = streamfactory_type->create_ostream_itable( table = gw_xml_table ).
CALL METHOD ostream_type->set_encoding
EXPORTING
encoding = encoding_type.
*Rendering the document
renderer_type = ixml_type->create_renderer( ostream = ostream_type
document = document_type ).
l_rc = renderer_type->render( ).
*Salva o documento XML
l_xml_size = ostream_type->get_num_written_raw( ).
ENDFORM. " yf_finaliza_xml
*& Form yf_exporta_xml
text
-->VALUE(P_0783) text
FORM yf_exporta_xml USING value(p_0783).
CONCATENATE cod_cartaorepom
sy-datum
sy-uzeit
cc_xml
INTO v_nomearquivo.
CONCATENATE p_0783
v_nomearquivo
INTO v_salvaarquivo.
TRANSLATE v_nomearquivo TO UPPER CASE.
*Exporta o XML
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = l_xml_size
filename = v_salvaarquivo
filetype = cc_bin
CHANGING
data_tab = gw_xml_table
EXCEPTIONS
OTHERS = 24.
IF sy-subrc = 0.
PERFORM yf_sapgui_progress_indicator USING cc_msg_xml_ok.
ELSE.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " yf_exporta_xml
*& Form yf_convert_xml_to_itab
text
-->P_GW_XML_NODE_RET text
-->P_FILENAME text
FORM yf_convert_xml_to_itab TABLES p_gw_xml_node_ret LIKE gw_xml_node
USING p_filename.
DATA l_count.
ixml_type = cl_ixml=>create( ).
Now Create Stream Factory
streamfactory_type = ixml_type->create_stream_factory( ).
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = p_filename
filetype = cc_bin
IMPORTING
filelength = l_xml_size
CHANGING
data_tab = gw_xml_table2
EXCEPTIONS
OTHERS = 19.
IF sy-subrc = 0.
istream_type = streamfactory_type->create_istream_itable( table = gw_xml_table2
size = l_xml_size ).
document_type = ixml_type->create_document( ).
parser_type = ixml_type->create_parser( stream_factory = streamfactory_type
istream = istream_type
document = document_type ).
IF parser_type->parse( ) NE 0.
IF parser_type->num_errors( ) NE 0.
l_count = parser_type->num_errors( ).
ENDIF.
ENDIF.
CALL METHOD istream_type->close( ).
CLEAR istream_type.
node_type = document_type.
PERFORM yf_get_data USING node_type.
p_gw_xml_node_ret[] = gw_xml_node[].
CLEAR gw_xml_node[].
ENDIF.
ENDFORM. " yf_convert_xml_to_itab
*& Form yf_get_data
text
-->VALUE(X_NODE) text
FORM yf_get_data USING value(x_node) TYPE REF TO if_ixml_node.
DATA: indent TYPE i.
DATA: ptext TYPE REF TO if_ixml_text.
DATA: string TYPE string.
DATA: temp_string(100).
CASE x_node->get_type( ).
WHEN if_ixml_node=>co_node_element.
string = x_node->get_name( ).
w_nodetext = string.
CLEAR string.
string = x_node->get_value( ).
IF NOT w_nodetext IS INITIAL OR
NOT string IS INITIAL.
gs_xml_node-node = w_nodetext.
gs_xml_node-vlnode = string.
IF NOT gs_xml_node-vlnode IS INITIAL.
APPEND gs_xml_node TO gw_xml_node.
CLEAR gs_xml_node.
ENDIF.
ENDIF.
ENDCASE.
Get the next child
x_node = x_node->get_first_child( ).
Recurse
WHILE NOT x_node IS INITIAL.
PERFORM yf_get_data USING x_node.
x_node = x_node->get_next( ).
ENDWHILE.
ENDFORM. "yf_get_data
Maybe you are looking for
-
User exit ZXPADU02 - evaluating SY-UCOMM
Hello everyone, I am trying to display an error message whenever someone tries to create a new work schedule rule (P0007-SCHKZ) in infotype 7. However, the error message should just come up when the user is trying to save his data. I am using user ex
-
I cannot open my mobile because i forgot my mobile password
I need to know how i open my mobile.I change the password but i forgot after 30 minutes i cant open my mobile.Thank you!
-
Header text manipulation (VA22)
Hi, Is there any way we can manipulate header texts in sales documents in runtime, i.e can I fill the header texts through userexits while users use va21 or va22 ? Complete scenario: We have not configured text determination because the there are no
-
Advantage of using RAW devices for storing database
Hi, Marry Christmas to all. Oracle 10g version 10.2.0.1.0 (rac) OS : HP-UX 11i I am new to this enviornment. We are using raw devices for storig the database. Please tell what are the advantages for using raw devices for storing the database? Thanks.
-
Mac Mini ethernet read / write speeds different
Hello. I have a 2.3 GHz Intel Core i5 Mac Mini running OS X Version 10.8.4. I recently bought a Synology ds212j NAS, and started to transfer some files across my home LAN. Everything was running fine until I noticed that the transfer had started to g