How to fetch data into xml file trom sql table.
Hi,
We r now working in oracle 9iAS portal.
We have installed xdk along with 9iAS.
I would like to know how to and where to run an xsql file,preferably with an example to fetch data from a database table to a xml file.
Please download the latest version of XDK for Java at:
http://otn.oracle.com/tech/xml/xdk_java
In the downloaded package, there are demos for XSQL Servlet. The demo "emp" and "empdept" are good start.
Similar Messages
-
Reading Data From XML File to SQL Tables.
I Have XML of this type
<empdept>
<employees_marks>
<emp_id>1</emp_id>
<DIVISION_ID>BUS</DIVISION_ID>
<JOB_ID>PRE</JOB_ID>
<FIRST_NAME>SMITH</FIRST_NAME>
<LAST_NAME>JAMES</LAST_NAME>
<salary>10000</salary>
</employees_marks>
<dept>
<dept_details>
<deptid>10</deptid>
<deptname>Mechanical</deptname>
</dept_details>
<dept_details>
<deptid>20</deptid>
<deptname>Civil</deptname>
</dept_details>
<dept_details>
<deptid>30</deptid>
<deptname>ICE</deptname>
</dept_details>
</dept>
</empdept>'));
With the above format am able to retrieve data successfully into relational tables,
<employees_marks emp_id=1 DIVISION_ID=BUS JOB_ID=PRE salary=10000 />
<dept_details deptid=10 deptname='Mechanical'/>
<dept_details deptid=20 deptname='ECE'/>
<dept_details deptid=30 deptname='EEE'/>
i.e., I have data as attributes rather than elements, so can I know the way how I can acheive the requirement,
How to retrieve data when it is present as attributes rather than elements.
Thanks,
Sunil. NSunil N wrote:
I Have XML of this type
<dept_details deptid=10 deptname='Mechanical'/>
<dept_details deptid=20 deptname='ECE'/>
<dept_details deptid=30 deptname='EEE'/>
i.e., I have data as attributes rather than elements, so can I know the way how I can acheive the requirement,
How to retrieve data when it is present as attributes rather than elements.I just posted an example of how to deal with tags instead of elements in XML in {message:id=3935746} yesterday.
The short of it is that you need to use the "+@"+ character as the attribute name - and that tells the XML parser that the attribute is a tag in an element and not an element itself. E.g.
extract( xmlData, '/dept_details/@deptid' ) as DEPT_ID
extract( xmlData, '/dept_details/@deptname' ) as DEPT_NAME -
Why we need to conver Context Node data into XML file----Export to Excel
Hi All,
Let me clarify my dought........today i have gone through the concept of "Exporting Context Data Using the Webdynpro Binary cache" in SAP Online Help.
From the SAP Online Help pdf document, i have found that, the context node data has been converted first in to XML file,after that file had been stored in the web dynpor binary cache...bla....bla.........
Here my qtn is why they had converted context node data into XML file. With out doing that can not we export context node data to excel file..?
Regards
Seshu
Edited by: Sesshanna D on Dec 19, 2007 7:25 AMHi Sesshanna,
it is not neccessary to do that but xml has the advantage, that it can be easily transformed into every output format that might occur in later project stages.
If it's simply about blowing out some Excel, I suggest using an OSS library such as jexcelAPI or Jakarta POI and building the Excel how you need it.
regards,
Christian -
How to extract data from XML file with JavaScript
HI All
I am new to this group.
Can anybody help me regarding XML.
I want to know How to extract data from XML file with JavaScript.
And also how to use API for XML
regards
NagarajuThis is a Java forum.
JavaScript is something entirely different than Java, even though the names are similar.
Try another website with forums about JavaScript.
For example here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3 -
Outbound oracle data into xml file
Hi Odie,
Your previous inputs for xml inbound was working fine, in the similar way now I need outbound the oracle apps data into .xml file format. For that I've written one sample script like this. I thought of making use of the utl_file option in Oracle apps.
declare
l_log_handle UTL_FILE.FILE_TYPE;
l_log_name varchar2(50);
l_path_2 varchar2(40);
l_global_file varchar2(50);
l_time number:=1;
cursor cur1 is
select xmltype(cursor(select * from fnd_menus where rownum <101)) a from dual;
--select menu_id from fnd_menus where rownum<100;
begin
BEGIN
SELECT DECODE (INSTR (VALUE, ','),
0, VALUE,
SUBSTR (VALUE, 1, (INSTR (VALUE, ',', 1)) - 1)
INTO l_path_2
FROM v$parameter
WHERE NAME = 'utl_file_dir';
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error while getting Unix Path ' || SQLERRM);
END;
l_log_name := 'XGBIZ_'||TO_CHAR (SYSDATE, 'YYMMDD')||l_time;
l_log_name := CONCAT(l_log_name,'.xml');
l_global_file := l_log_name;
l_log_handle := UTL_FILE.FOPEN(l_path_2,l_log_name,'W');
for cur2 in cur1 loop
UTL_FILE.PUT_LINE(l_log_handle, cur2);
end loop;
utl_file.fclose_all;
EXCEPTION
WHEN UTL_FILE.INVALID_OPERATION THEN
dbms_output.put_line('Invalid Operation For '|| l_global_file);
UTL_FILE.FCLOSE_ALL;
WHEN UTL_FILE.INVALID_PATH THEN
dbms_output.put_line('Invalid Path For '|| l_global_file);
UTL_FILE.FCLOSE_ALL;
WHEN UTL_FILE.INVALID_MODE THEN
dbms_output.put_line('Invalid Mode For '|| l_global_file);
UTL_FILE.FCLOSE_ALL;
WHEN UTL_FILE.INVALID_FILEHANDLE THEN
dbms_output.put_line('Invalid File Handle '|| l_global_file);
UTL_FILE.FCLOSE_ALL;
WHEN UTL_FILE.WRITE_ERROR THEN
dbms_output.put_line('Invalid Write Error '|| l_global_file);
UTL_FILE.FCLOSE_ALL;
WHEN UTL_FILE.READ_ERROR THEN
dbms_output.put_line('Invalid Read Error '|| l_global_file);
UTL_FILE.FCLOSE_ALL;
WHEN UTL_FILE.INTERNAL_ERROR THEN
dbms_output.put_line('Internal Error');
UTL_FILE.FCLOSE_ALL;
WHEN OTHERS THEN
dbms_output.put_line('Other Error '||'SQL CODE: '||SQLCODE||' Messg: '||SQLERRM);
UTL_FILE.FCLOSE_ALL;
end;
when running this script I am getting error
ERROR at line 30:
ORA-06550: line 30, column 2:
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
ORA-06550: line 30, column 2:
PL/SQL: Statement ignored
if in the cursor declaration happen to use 'select menu_id from fnd_menus ' a plain record then it is successfully creating.
If tried again revert to actual select statement ' select xmltype(cursor(select * from fnd_menus where rownum <101)) a from dual'
then its erring out as above said.
Please give me your valuable inputs in this regard.
Thanks & Regards
NagendraHi,
There are multiple ways to generate XML documents from relational data.
Here are some :
-- SQL/XML functions : XMLElement, XMLAgg, XMLAttributes etc.
-- DBMS_XMLGEN package
select dbms_xmlgen.getXML('SELECT * FROM scott.emp')
from dual;-- XMLType constructor over a REF CURSOR (the one you chose)
select xmlserialize(document
xmltype(
cursor(
select *
from scott.emp
as clob
from dual;-- From a DBUriType
select xmlserialize(document
dburitype('/SCOTT/EMP').getXML()
as clob
from dual;-- From XQuery using ora:view function
select xmlserialize(document
xmlquery('<ROWSET>{ora:view("SCOTT","EMP")}</ROWSET>' returning content)
as clob indent size = 1
from dual;If a column is NULL in the result set, those methods (except XMLElement) won't create the corresponding element.
There's an option available for the XQuery method, but only in version 11.2.
So if you want to output empty elements, you'll have to use DBMS_XMLGEN with setNullHandling method :
DECLARE
ctx DBMS_XMLGEN.ctxHandle;
v_out CLOB;
rc SYS_REFCURSOR;
BEGIN
OPEN rc FOR
SELECT *
FROM scott.emp
ctx := DBMS_XMLGEN.newContext(rc);
DBMS_XMLGEN.setNullHandling(ctx, DBMS_XMLGEN.EMPTY_TAG);
v_out := DBMS_XMLGEN.getXML(ctx);
DBMS_XMLGEN.closeContext(ctx);
CLOSE rc;
DBMS_XSLPROCESSOR.clob2file(v_out, 'TEST_DIR', 'test_out.xml');
END;
I thought of making use of the utl_file option in Oracle apps.You could, but you might find DBMS_XSLPROCESSOR.clob2file procedure more convenient for that (see above).
All you have to do is serializing the XML in a CLOB variable, and call the procedure.
WHERE NAME = 'utl_file_dir';The "utl_file_dir" init. parameter is deprecated since 10g, use directory objects instead. -
Problem converting data in XML file to internal table data
Hi all,
I have a requirement. I need to convert an XML file to internal table data and based on that data do Goods Receipt in SAP.
With the help of this blog /people/r.eijpe/blog/2005/11/10/xml-dom-processing-in-abap-part-i--convert-an-abap-table-into-xml-file-using-sap-dom-approach
I am able to convert the XML file to data in SAP. But this blog will display the output on screen as ELELEMNT = nodename VALUE= value of that node.
But I donu2019t want in that way, I want to store all the data in XML file in an internal table so that I can make use of those values and do Goods Recipt in SAP.
Can some one suggest how should I read the data in an internal table.
Here is my code..what changes should I make?
*& Report z_xit_xml_check
REPORT z_xit_xml_check.
TYPE-POOLS: ixml.
TYPES: BEGIN OF t_xml_line,
data(256) TYPE x,
END OF t_xml_line.
DATA: l_ixml TYPE REF TO if_ixml,
l_streamfactory TYPE REF TO if_ixml_stream_factory,
l_parser TYPE REF TO if_ixml_parser,
l_istream TYPE REF TO if_ixml_istream,
l_document TYPE REF TO if_ixml_document,
l_node TYPE REF TO if_ixml_node,
l_xmldata TYPE string.
DATA: l_elem TYPE REF TO if_ixml_element,
l_root_node TYPE REF TO if_ixml_node,
l_next_node TYPE REF TO if_ixml_node,
l_name TYPE string,
l_iterator TYPE REF TO if_ixml_node_iterator.
DATA: l_xml_table TYPE TABLE OF t_xml_line,
l_xml_line TYPE t_xml_line,
l_xml_table_size TYPE i.
DATA: l_filename TYPE string.
PARAMETERS: pa_file TYPE char1024 DEFAULT 'c:\temp\orders_dtd.xml'.
Validation of XML file: Only DTD included in xml document is supported
PARAMETERS: pa_val TYPE char1 AS CHECKBOX.
START-OF-SELECTION.
Creating the main iXML factory
l_ixml = cl_ixml=>create( ).
Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
PERFORM get_xml_table CHANGING l_xml_table_size l_xml_table.
wrap the table containing the file into a stream
l_istream = l_streamfactory->create_istream_itable( table = l_xml_table
size = l_xml_table_size ).
Creating a document
l_document = l_ixml->create_document( ).
Create a Parser
l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
istream = l_istream
document = l_document ).
Validate a document
IF pa_val EQ 'X'.
l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
ENDIF.
Parse the stream
IF l_parser->parse( ) NE 0.
IF l_parser->num_errors( ) NE 0.
DATA: parseerror TYPE REF TO if_ixml_parse_error,
str TYPE string,
i TYPE i,
count TYPE i,
index TYPE i.
count = l_parser->num_errors( ).
WRITE: count, ' parse errors have occured:'.
index = 0.
WHILE index < count.
parseerror = l_parser->get_error( index = index ).
i = parseerror->get_line( ).
WRITE: 'line: ', i.
i = parseerror->get_column( ).
WRITE: 'column: ', i.
str = parseerror->get_reason( ).
WRITE: str.
index = index + 1.
ENDWHILE.
ENDIF.
ENDIF.
Process the document
IF l_parser->is_dom_generating( ) EQ 'X'.
PERFORM process_dom USING l_document.
ENDIF.
*& Form get_xml_table
FORM get_xml_table CHANGING l_xml_table_size TYPE i
l_xml_table TYPE STANDARD TABLE.
Local variable declaration
DATA: l_len TYPE i,
l_len2 TYPE i,
l_tab TYPE tsfixml,
l_content TYPE string,
l_str1 TYPE string,
c_conv TYPE REF TO cl_abap_conv_in_ce,
l_itab TYPE TABLE OF string.
l_filename = pa_file.
upload a file from the client's workstation
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = l_filename
filetype = 'BIN'
IMPORTING
filelength = l_xml_table_size
CHANGING
data_tab = l_xml_table
EXCEPTIONS
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Writing the XML document to the screen
CLEAR l_str1.
LOOP AT l_xml_table INTO l_xml_line.
c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data replacement = space ).
c_conv->read( IMPORTING data = l_content len = l_len ).
CONCATENATE l_str1 l_content INTO l_str1.
ENDLOOP.
l_str1 = l_str1+0(l_xml_table_size).
SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
WRITE: /.
WRITE: /' XML File'.
WRITE: /.
LOOP AT l_itab INTO l_str1.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN
l_str1 WITH space.
WRITE: / l_str1.
ENDLOOP.
WRITE: /.
ENDFORM. "get_xml_table
*& Form process_dom
FORM process_dom USING document TYPE REF TO if_ixml_document.
DATA: node TYPE REF TO if_ixml_node,
iterator TYPE REF TO if_ixml_node_iterator,
nodemap TYPE REF TO if_ixml_named_node_map,
attr TYPE REF TO if_ixml_node,
name TYPE string,
prefix TYPE string,
value TYPE string,
indent TYPE i,
count TYPE i,
index TYPE i.
node ?= document.
CHECK NOT node IS INITIAL.
ULINE.
WRITE: /.
WRITE: /' DOM-TREE'.
WRITE: /.
IF node IS INITIAL. EXIT. ENDIF.
create a node iterator
iterator = node->create_iterator( ).
get current node
node = iterator->get_next( ).
loop over all nodes
WHILE NOT node IS INITIAL.
indent = node->get_height( ) * 2.
indent = indent + 20.
CASE node->get_type( ).
WHEN if_ixml_node=>co_node_element.
element node
name = node->get_name( ).
nodemap = node->get_attributes( ).
WRITE: / 'ELEMENT :'.
WRITE: AT indent name COLOR COL_POSITIVE INVERSE.
IF NOT nodemap IS INITIAL.
attributes
count = nodemap->get_length( ).
DO count TIMES.
index = sy-index - 1.
attr = nodemap->get_item( index ).
name = attr->get_name( ).
prefix = attr->get_namespace_prefix( ).
value = attr->get_value( ).
WRITE: / 'ATTRIBUTE:'.
WRITE: AT indent name COLOR COL_HEADING INVERSE, '=',
value COLOR COL_TOTAL INVERSE.
ENDDO.
ENDIF.
WHEN if_ixml_node=>co_node_text OR
if_ixml_node=>co_node_cdata_section.
text node
value = node->get_value( ).
WRITE: / 'VALUE :'.
WRITE: AT indent value COLOR COL_GROUP INVERSE.
ENDCASE.
advance to next node
node = iterator->get_next( ).
ENDWHILE.
ENDFORM. "process_dom
Any help would be highly apperciated.
regards,
Jessica SamPavel Vera,
With your example i tries doing the following .....
I tried to convert the data of XML file to internal table data. I am collecting the data in internal table to do goos recipt with that data.
Please find my XML file, ABAP pgm and XSLT pgm . I donu2019t know what I am missing I am not getting any output. I donu2019t know what is wrong please help me with this
Below is my XML file, My code and XSLT Program. In the below XML file I need to collect Vendor Number, Order Number, and Date tags which occur only once for one XML file.
I also need to collect the following tags from <Shipmentdetail>
<Shipmentdetail> has following child nodes and I need to collect them
TrackingNumber
Freight
Weight
ShipmentDate
ShipmentMethod
Need to collect to collect the following tags from <ProductInformation>
<ProductInformation> has following child nodes and I need to collect them
LineNumber
SKUNumber
OrderedQuantity
ShippedQuantity
UOM
The <Shipmentdetail> and <ProductInformation> are child nodes of <OrderShipment>
The <Shipmentdetail> occurs only ones but the <ProductInformation> can occur once or many times and will be dynamic and differs depening on the input file.
My XML file is as follows
<?xml version="1.0" encoding="iso-8859-1" ?>
- <ShipmentHeader>
<AccountID />
- <OrderShipment>
<VendorNumber>1000</VendorNumber>
<OrderNumber>P00009238</OrderNumber>
<OrderType>Stock</OrderType>
<Company />
<Division />
<Department />
<Date>20061120</Date>
<CartonCount>2</CartonCount>
<ShipAllProducts>No</ShipAllProducts>
- <ShipmentDetail>
<TrackingNumber>1ZR3W891PG47477811</TrackingNumber>
<Freight>000000010000</Freight>
<ShipmentDate>20061120</ShipmentDate>
<ShipmentMethod>UPS1PS</ShipmentMethod>
</ShipmentDetail>
- <ProductInformation>
<LineNumber>000000001</LineNumber>
<SKUNumber>110FR</SKUNumber>
<AdvSKUNumber>003 4518</AdvSKUNumber>
<SKUID />
<OrderedQuantity>00000001000000</OrderedQuantity>
<ShippedQuantity>00000001000000</ShippedQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</ProductInformation>
- <ProductInformation>
<LineNumber>000000002</LineNumber>
<SKUNumber>938EN</SKUNumber>
<AdvSKUNumber>001 7294</AdvSKUNumber>
<SKUID />
<OrderedQuantity>00000000450000</OrderedQuantity>
<ShippedQuantity>00000000450000</ShippedQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</ProductInformation>
- <CaseInformation>
<LineNumber>000000001</LineNumber>
<SKUNumber>110FR</SKUNumber>
<AdvSKUNumber>003 4518</AdvSKUNumber>
<SKUID />
<SSCCNumber>00000001668000002487</SSCCNumber>
<CaseQuantity>00000001000000</CaseQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</CaseInformation>
<CaseInformation>
<LineNumber>000000001</LineNumber>
<SKUNumber>110FR</SKUNumber>
<AdvSKUNumber>003 4518</AdvSKUNumber>
<SKUID />
<SSCCNumber>00000001668000002487</SSCCNumber>
<CaseQuantity>00000001000000</CaseQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</CaseInformation>
- </OrderShipment>
</ShipmentHeader>
My Program
TYPE-POOLS abap.
CONSTANTS gs_file TYPE string VALUE 'C:\temp\test.xml'.
* This is the structure for the data from the XML file
TYPES: BEGIN OF ts_shipment,
VendorNumber(10) TYPE n,
OrderNumber(20) TYPE n,
OrderType(8) TYPE c,
Date(8) TYPE c,
END OF ts_shipment.
TYPES: BEGIN OF ts_shipmentdetail,
TrackingNumber(30) TYPE n,
Freight(12) TYPE n,
Weight(14) TYPE n,
ShipmentDate(8) TYPE c,
ShipmentMethod(8) TYPE c,
END OF ts_shipmentdetail.
TYPES: BEGIN OF ts_productinformation,
LineNumber(9) TYPE n,
SKUNumber(20) TYPE c,
OrderedQuantity(14) TYPE n,
ShippedQuantity(14) TYPE n,
UOM(4) TYPE c,
END OF ts_productinformation.
* Table for the XML content
DATA: gt_itab TYPE STANDARD TABLE OF char2048.
* Table and work ares for the data from the XML file
DATA: gt_shipment TYPE STANDARD TABLE OF ts_shipment,
gs_shipment TYPE ts_shipment.
DATA: gt_shipmentdetail TYPE STANDARD TABLE OF ts_shipmentdetail,
gs_shipmentdetail TYPE ts_shipmentdetail.
DATA: gt_productinformation TYPE STANDARD TABLE OF ts_productinformation,
gs_productinformation TYPE ts_productinformation.
* Result table that contains references
* of the internal tables to be filled
DATA: gt_result_xml TYPE abap_trans_resbind_tab,
gs_result_xml TYPE abap_trans_resbind.
* For error handling
DATA: gs_rif_ex TYPE REF TO cx_root,
gs_var_text TYPE string.
* Get the XML file from your client
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = gs_file
CHANGING
data_tab = gt_itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "ISHIPMENT".
GET REFERENCE OF gt_shipment INTO gs_result_xml-value.
gs_result_xml-name = 'ISHIPMENT'.
APPEND gs_result_xml TO gt_result_xml.
* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "ISHIPDET".
GET REFERENCE OF gt_shipmentdetail INTO gs_result_xml-value.
gs_result_xml-name = 'ISHIPDET'.
APPEND gs_result_xml TO gt_result_xml.
* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "IPRODDET".
GET REFERENCE OF gt_productinformation INTO gs_result_xml-value.
gs_result_xml-name = 'IPRODDET'.
APPEND gs_result_xml TO gt_result_xml.
* Perform the XSLT stylesheet
TRY.
CALL TRANSFORMATION z_xml_to_abap3
SOURCE XML gt_itab
RESULT (gt_result_xml).
CATCH cx_root INTO gs_rif_ex.
gs_var_text = gs_rif_ex->get_text( ).
MESSAGE gs_var_text TYPE 'E'.
ENDTRY.
* Writing the data from file for gt_shipment
*Collecting the Shipping Data from the XML file to internal table gt_shipment
*and writing the data to the screen
LOOP AT gt_shipment INTO gs_shipment.
WRITE: / 'VendorNumber:', gs_shipment-VendorNumber.
WRITE: / 'OrderNumber :', gs_shipment-OrderNumber.
WRITE: / 'OrderType :', gs_shipment-OrderType.
WRITE: / 'Date :', gs_shipment-Date.
WRITE : /.
ENDLOOP. "gt_shipment.
LOOP AT gt_shipmentdetail INTO gs_shipmentdetail.
WRITE: / 'TrackingNumber:', gs_shipmentdetail-TrackingNumber.
WRITE: / 'Freight :', gs_shipmentdetail-Freight.
WRITE: / 'Weight :', gs_shipmentdetail-Weight.
WRITE: / 'ShipmentDate :', gs_shipmentdetail-ShipmentDate.
* WRITE: / 'ShipmentMethod :' gs_shipmentdetail-ShipmentMethod
WRITE : /.
ENDLOOP. "gt_shipmentdetail.
LOOP AT gt_productinformation INTO gs_productinformation.
WRITE: / 'LineNumber:', gs_productinformation-LineNumber.
WRITE: / 'SKUNumber :', gs_productinformation-SKUNumber.
WRITE: / 'OrderedQuantity :', gs_productinformation-OrderedQuantity.
WRITE: / 'ShippedQuantity :', gs_productinformation-ShippedQuantity.
WRITE: / 'UOM :', gs_productinformation-UOM.
WRITE : /.
ENDLOOP. "gt_productinformation.
XSLT Program
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ISHIPMENT>
<xsl:apply-templates select="//OrderShipment"/>
</ISHIPMENT>
</asx:values>
</asx:abap>
</xsl:template>
<xsl:template match="OrderShipment">
<item>
<VENDORNUMBER>
<xsl:value-of select="VendorNumber"/>
</VENDORNUMBER>
<ORDERNUMBER>
<xsl:value-of select="OrderNumber"/>
</ORDERNUMBER>
<ORDERTYPE>
<xsl:value-of select="OrderType"/>
</ORDERTYPE>
<DATE>
<xsl:value-of select="Date"/>
</DATE>
</item>
</xsl:template>
<xsl:template match="/">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ISHIPDET>
<xsl:apply-templates select="//OrderShipment/ShipmentDetail"/>
</ISHIPDET>
</asx:values>
</asx:abap>
</xsl:template>
<xsl:template match="ShipmentDetail">
<item>
<TRACKINGNUMBER>
<xsl:value-of select="TrackingNumber"/>
</TRACKINGNUMBER>
<FREIGHT>
<xsl:value-of select="Freight"/>
</FREIGHT>
<SHIPMENTDATE>
<xsl:value-of select="ShipmentDate"/>
</SHIPMENTDATE>
<SHIPMENTMETHOD>
<xsl:value-of select="ShipmentMethod"/>
</SHIPMENTMETHOD>
</item>
</xsl:template>
</xsl:transform> .
Any help is highly appreciated. If anyone encountered this situation before please let me know where i am going wrong in my XSLT transformation.
Any Help will be highly apppreciated. Thanks in advance
Regards,
Jessica Sam -
How to write data to text file using external tables
can anybody tell how to write data to text file using external tables concept?
Hi,
Using external table u can load the data in your local table in database,
then using your local db table and UTL_FILE pacakge u can wrrite data to text file
external table
~~~~~~~~~~~
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7002.htm#i2153251
UTL_FILE
~~~~~~~~~
http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#sthref14093
Message was edited by:
Nicloei W
Message was edited by:
Nicloei W -
Hi all,
I have the following xml file (books1.xml):
<bookstore>
<book>
<BookID>1</BookID>
<title>Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book>
<BookID>2<BookID>
<title>Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book>
<BookID>3<BookID>
<title>XQuery Kick Start</title>
<author>James McGovern</author>
<year>2003</year>
<price>49.99</price>
</book>
<book>
<BookID>4<BookID>
<title>Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
In my Microsoft SQL Server 2012 Management Studio, I executed the following SQL Query code:
--XQuery w3schools example using books1.xml in C:\Temp folder
---SQL Query W3books Title
---9 March 2015
USE XML_XQUERY
GO
CREATE TABLE W3Books(
BookID INt Primary Key,
Title VARCHAR(30));
INSERT INTO W3Books (BookID, Title)
SELECT x.book.query('BookID'), value('.', 'INT'),
x.book.query('title'), value('.', 'VARCHAR(30)')
FROM (
SELECT CAST(x AS XML)
FROM OPENROWSET(
BULK 'C:\Temp\books1.xml',
SINGLE_BLOB) AS T(x)
) AS T(x)
CROSS APPLY x.nodes('W3Books/book') AS x(book);
SELECT BookID, Title
FROM W3Books;
I got the following error messages:
Msg 195, Level 15, State 10, Line 7
'value' is not a recognized built-in function name.
Msg 156, Level 15, State 1, Line 16
Incorrect syntax near the keyword 'AS'.
I don't know why I got the error of 'value' is not a recognized built-in function name. Please kindly help and tell me what is wrong in my code and how to correct the error.
Thanks, Scott Chang
P. S.
(1) I mimicked the xml file and SQL Qeury code of Import XML File to SQL Table in
http://pratchev.blogspot.com/2008/11/import-xml-file-to-sql-table.html. The xml file and the code of this sample worked in my SSMS 2012 program.
(2) I am learning the "CAST" and "CROSS APPLY" in the Create Instances of XML Data of Microsoft MSDN - it is very abstract to me.Hi Stan210, Thanks for your nice response.
I corrected my xml file as you pointed out.
I made some changes in some code statements of my SQLQueryW3BookTitle.sql as you instructed:
--XQuery w3schools example using books1.xml in C:\Temp folder
---SQL Query W3books Title
---10 March 2015
USE XML_XQUERY
GO
CREATE TABLE W3Books(
BookID INt Primary Key,
Title VARCHAR(30));
INSERT INTO W3Books (BookID, Title)
SELECT x.book.value('/BookID[1]', 'INT'),
x.book.value('/title[1]', 'VARCHAR(30)')
FROM (
SELECT CAST(x AS XML)
FROM OPENROWSET(
BULK 'C:\Temp\books1.xml',SINGLE_BLOB) AS T(x)
) AS T(x)
CROSS APPLY x.nodes('bookstore/book') AS x(book);
SELECT BookID, Title
FROM W3Books;
I executed my revised sql and I got the following Message and Results:
Msg 515, Level 16, State 2, Line 6
Cannot insert the value NULL into column 'BookID', table 'XML_XQUERY.dbo.W3Books'; column does not allow nulls. INSERT fails.
The statement has been terminated.
(0 row(s) affected)
Results:
BookID Title
I don't know why I just got the names of columns in Results and the "Cannot insert the value NULL into column 'BookID', table 'XML_XQUERY.dbo.W3Books'; column does not allow nulls, insert fails." in Messages. Please kindly help, advise me
how to correct the errors and respond again.
Many Thanks again,
Scott Chang -
How to download internal table data into xml file?
Hi,
Experts,
I have downloaded internal table data into XLS format using GUI_DOWNLOAD Function module, But i didn't Know how to download internal table data into XML format please post some ideas/inputs on this issue.
Thank you,
Shabeer ahmed.check this
data : gd_repid type sy-repid.
GD_REPID = SY-REPID.
DATA : L_DOM TYPE REF TO IF_IXML_ELEMENT,
M_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
G_IXML TYPE REF TO IF_IXML,
W_STRING TYPE XSTRING,
W_SIZE TYPE I,
W_RESULT TYPE I,
W_LINE TYPE STRING,
IT_XML TYPE DCXMLLINES,
S_XML LIKE LINE OF IT_XML,
W_RC LIKE SY-SUBRC.
DATA: XML TYPE DCXMLLINES.
DATA: RC TYPE SY-SUBRC,
BEGIN OF XML_TAB OCCURS 0,
D LIKE LINE OF XML,
END OF XML_TAB.
data : l_element type ref to if_ixml_element,
xml_ns_prefix_sf type string,
xml_ns_uri_sf type string.
CLASS CL_IXML DEFINITION LOAD.
G_IXML = CL_IXML=>CREATE( ).
CHECK NOT G_IXML IS INITIAL.
M_DOCUMENT = G_IXML->CREATE_DOCUMENT( ).
CHECK NOT M_DOCUMENT IS INITIAL.
CALL FUNCTION 'SDIXML_DATA_TO_DOM'
EXPORTING
NAME = 'REPAIRDATA'
DATAOBJECT = IT_FINAL_LAST1[]
IMPORTING
DATA_AS_DOM = L_DOM
CHANGING
DOCUMENT = M_DOCUMENT
EXCEPTIONS
ILLEGAL_NAME = 1
OTHERS = 2.
CHECK NOT L_DOM IS INITIAL.
W_RC = M_DOCUMENT->APPEND_CHILD( NEW_CHILD = L_DOM ).
*Start of code for Header
* namespace
t_mnr = sy-datum+4(2).
CALL FUNCTION 'IDWT_READ_MONTH_TEXT'
EXPORTING
LANGU = 'E'
MONTH = t_mnr
IMPORTING
T247 = wa_t247
concatenate sy-datum+6(2)
wa_t247-ktx
sy-datum(4) into t_var1.
concatenate sy-uzeit(2)
sy-uzeit+2(2)
sy-uzeit+4(2) into t_var2.
clear : xml_ns_prefix_sf,
xml_ns_uri_sf.
l_element = m_document->get_root_element( ).
xml_ns_prefix_sf = 'TIMESTAMP'.
concatenate t_var1 t_var2 into xml_ns_uri_sf separated by space.
clear : t_var1,
t_var2,
t_mnr,
wa_t247.
l_element->set_attribute( name = xml_ns_prefix_sf
namespace = ' '
value = xml_ns_uri_sf ).
clear : xml_ns_prefix_sf,
xml_ns_uri_sf.
xml_ns_prefix_sf = 'FILECREATOR'.
xml_ns_uri_sf = 'SAP'.
l_element->set_attribute( name = xml_ns_prefix_sf
namespace = ' '
value = xml_ns_uri_sf ).
clear : xml_ns_prefix_sf,
xml_ns_uri_sf.
xml_ns_prefix_sf = 'CLAIMGROUP'.
xml_ns_uri_sf = '1'.
l_element->set_attribute( name = xml_ns_prefix_sf
namespace = ' '
value = xml_ns_uri_sf ).
clear : xml_ns_prefix_sf,
xml_ns_uri_sf.
xml_ns_prefix_sf = 'CLAIMTYPES'.
xml_ns_uri_sf = 'W'.
l_element->set_attribute( name = xml_ns_prefix_sf
namespace = ' '
value = xml_ns_uri_sf ).
*End of Code for Header
CALL FUNCTION 'SDIXML_DOM_TO_XML'
EXPORTING
DOCUMENT = M_DOCUMENT
IMPORTING
XML_AS_STRING = W_STRING
SIZE = W_SIZE
TABLES
XML_AS_TABLE = IT_XML
EXCEPTIONS
NO_DOCUMENT = 1
OTHERS = 2.
LOOP AT IT_XML INTO XML_TAB-D.
APPEND XML_TAB.
ENDLOOP.
*Start of Code for File name
concatenate p_file
'\R'
'000_119481'
sy-datum+6(2) sy-datum+4(2) sy-datum+2(2)
sy-uzeit(2) sy-uzeit+2(2) sy-uzeit(2) '.xml' into p_file.
*End of Code for File name
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = W_SIZE
FILENAME = p_file
FILETYPE = 'BIN'
TABLES
DATA_TAB = XML_TAB
EXCEPTIONS
OTHERS = 10.
IF SY-SUBRC = 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
Using Query to fetch data from xml file
Hi guys ,
Just want to know , how to fetch data from an XML file in adobe flex? i have a database generated xml file.you can use httpService.
-
How to store data into database by reading sql statements from text file
how to write java program for storing data into database by reading sql statements from text file
Step 1: Create a property file to add various queries.
Step 2: Read the properties file using ResourceBundle
Step 3: Use the jdbc to execute the query read from the property file.
So in future if you need to change query no need do any modifications in java program. But depends on how you use the property file. -
Hi ABAP Exterts,
Any one help on this , there is a requirement to download the data into XLSX file only.
I am able to to download the data into XLS file using the FM: GUI_DOWNLOAD in SAP ECC 6.0and also opening the file . But when i download the data into XLSX file . I am able to download the data into GUI_DOWNLOAD. But while opening the file i am getting the below mentioned error.
'Excel cannot open the file 'filename.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file'
Ok buttom is coming not able to open the file.
When i use the FM: SAP_CONVERT_TO_XLS_FORMAT to download the XLS it self it is going abap DUMP that file type error.
Any one help any Function Module or how to download data through abap programing into XLSX file.
Thanks.
Murali.
Message was edited by: Matthew Billingham - adjusted wording...If you want to download your ALV to an .XLXS format file, with all the formatting intact, please try the following code. I have tried to create a custom Function module Z_EXCEL_DOWNLOAD_TEST wherein I pass all the callback variables, the final ALV internal table and all the ALV details like field catalog, sort, layout, event list and so on, along with the concatenated file path and file name in I_FILE. I have used a custom class ZCL_SALVEXPORT_XML which is a copy of the standard class CL_SALV_EXPORT_XML_DIALOG, with few modifications in Method: EXECUTE and Method: DOWNLOAD. The methods where I have modified the code are also shown at the end.
****************Global declarations***********************
TYPE-POOLS: slis,
kkblo.
TYPES: t_fccls(1) TYPE c OCCURS 0.
TYPES: BEGIN OF ty_nosum,
fieldname TYPE kkblo_fieldname, "Field name
tabname TYPE kkblo_tabname, "Table name
fieldname_dep TYPE kkblo_fieldname, "Field name
tabname_dep TYPE kkblo_tabname, "Table name
index TYPE sy-index, "Index
END OF ty_nosum.
TYPES: t_nosum TYPE TABLE OF ty_nosum INITIAL SIZE 0 WITH NON-UNIQUE DEFAULT KEY.
TYPES: BEGIN OF ty_dep_field,
s_dep_fieldcat TYPE kkblo_fieldcat, "Field cat
t_ref_fieldcat TYPE kkblo_t_fieldcat, "Field cat
END OF ty_dep_field.
TYPES: BEGIN OF ty_ref_field,
s_ref_fieldcat TYPE kkblo_fieldcat, "Field cat
s_dep_fieldcat TYPE kkblo_fieldcat, "Field cat
END OF ty_ref_field.
TYPES: t_dep_field TYPE ty_dep_field OCCURS 0. "
TYPES: t_ref_field TYPE ty_ref_field OCCURS 0.
TYPES: BEGIN OF ty_memory,
object(20) TYPE c, "Object
memcount(4) TYPE c, "count
END OF ty_memory.
*ALV Customer Wrapper
TYPES: BEGIN OF ty_type_header_info,
tabname TYPE kkblo_tabname, "Table name
fieldname TYPE kkblo_fieldname, "Field name
sequence TYPE i, "Sequence
field TYPE char80, "Field
pagno TYPE sypagno, "Page num
linno TYPE sy-linno, "Current Line in List
colno TYPE sy-colno, "Current List Column
END OF ty_type_header_info,
t_type_header_info TYPE SORTED TABLE OF ty_type_header_info
WITH UNIQUE KEY tabname fieldname.
TYPES: BEGIN OF ty_type_row_info,
tabname TYPE kkblo_tabname, "Table name
tabindex TYPE syindex, "Index
field TYPE char80, "Field name
pagno TYPE sypagno, "Page num
linno TYPE sy-linno, "Current Line in List
colno TYPE sy-colno, "Current List Column
END OF ty_type_row_info,
t_type_row_info TYPE SORTED TABLE OF ty_type_row_info
WITH UNIQUE KEY tabname tabindex.
TYPES: BEGIN OF ty_type_sel_header,
tabname TYPE kkblo_tabname, "table name
fieldname TYPE kkblo_fieldname, "field name
END OF ty_type_sel_header,
t_type_sel_header TYPE SORTED TABLE OF ty_type_sel_header
WITH UNIQUE KEY tabname fieldname.
TYPES: BEGIN OF ty_type_sel_row,
tabname TYPE kkblo_tabname,
tabindex TYPE syindex,
END OF ty_type_sel_row,
t_type_sel_row TYPE SORTED TABLE OF ty_type_sel_row
WITH UNIQUE KEY tabname tabindex.
TYPES: BEGIN OF ty_type_sel_cell,
tabname TYPE kkblo_tabname,
tabindex TYPE syindex,
fieldname TYPE kkblo_fieldname,
END OF ty_type_sel_cell.
TYPES: BEGIN OF ty_type_selections,
t_row_info TYPE t_type_row_info,
t_header_info TYPE t_type_header_info,
t_selected_headers TYPE t_type_sel_header,
t_selected_rows TYPE t_type_sel_row,
s_current_cell TYPE ty_type_sel_cell,
set_headers TYPE sap_bool,
set_rows TYPE sap_bool,
set_current_cell TYPE sap_bool,
END OF ty_type_selections.
TYPES: BEGIN OF ty_stack3,
r_grid TYPE REF TO cl_gui_alv_grid, "Y6DK050176
r_salv_adapter TYPE REF TO if_salv_adapter,
s_selections TYPE ty_type_selections,
r_print_state TYPE REF TO if_alv_print_parameter_proxy, "Y6DK075821
suppress_empty_data TYPE abap_bool,
END OF ty_stack3.
TYPES: t_stack3 TYPE ty_stack3 OCCURS 0.
TYPES: BEGIN OF ty_stack,
i_callback_program TYPE sy-repid,
i_callback_user_command TYPE kkblo_formname,
i_callback_top_of_page TYPE kkblo_formname,
i_callback_top_of_list TYPE kkblo_formname,
i_callback_end_of_page TYPE kkblo_formname,
i_callback_end_of_list TYPE kkblo_formname,
i_callback_pf_status_set TYPE kkblo_formname,
i_callback_fieldcat_save TYPE kkblo_formname,
i_callback_layout_save TYPE kkblo_formname,
i_tabname TYPE kkblo_tabname,
i_tabname_slave TYPE kkblo_tabname,
is_keyinfo TYPE kkblo_keyinfo,
is_layout TYPE kkblo_layout,
it_fieldcat TYPE kkblo_t_fieldcat,
i_fctype(1) TYPE c,
it_excluding TYPE kkblo_t_extab,
it_special_groups TYPE kkblo_t_sp_group,
it_sort TYPE kkblo_t_sortinfo,
it_except_qinfo TYPE kkblo_t_qinfo,
is_sel_hide TYPE kkblo_sel_hide,
t_columns TYPE kkblo_t_columns,
t_filter TYPE kkblo_t_filter,
s_lprint TYPE kkblo_lprint,
print_line_break TYPE char1,
t_isetab TYPE kkblo_seldis,
t_fccls TYPE t_fccls,
t_sfinfo TYPE kkblo_t_sfinfo,
t_ref_field TYPE t_ref_field,
t_dep_field TYPE t_dep_field,
flg_default_status(1) TYPE c,
flg_selections TYPE char1,
flg_allow_no_selection TYPE char1,
flg_input TYPE char1,
flg_called TYPE char1,
flg_popup TYPE char1,
flg_endlist TYPE char1,
listtype TYPE char1,
actcols TYPE i,
is_list TYPE char1,
END OF ty_stack.
TYPES: t_stack TYPE ty_stack OCCURS 0.
TYPES: BEGIN OF ty_stack2,
button_col1(20) TYPE c,
button_col2(20) TYPE c,
button_col3(20) TYPE c,
button_col4(20) TYPE c,
button_col5(20) TYPE c,
s_header TYPE kkblo_header,
t_sfinfo_slave TYPE kkblo_t_sfinfo,
t_suminfo TYPE kkblo_t_sfinfo,
t_sfsave TYPE kkblo_t_sfinfo,
t_nosum TYPE t_nosum,
window_title TYPE rsmpe-tittext, " Item_selection
flg_scroll_to_line(1) TYPE c, " Item_selection
flg_top_of_page(1) TYPE c,
flg_subtot(1) TYPE c,
flg_output_in_progress(1) TYPE c,
flg_grouplevels(1) TYPE c,
flg_groupedit(1) TYPE c,
flg_calculate_totals(1) TYPE c,
sumlevel TYPE sy-tabix,
memory_stack1 TYPE ty_memory,
memory_stack2 TYPE ty_memory,
memory_outtab TYPE ty_memory,
t_colmark TYPE kkblo_t_colmark,
t_rowmark TYPE kkblo_t_rowmark,
it_event_exit TYPE kkblo_t_event_exit,
t_groups TYPE kkblo_t_grouplevels,
t_filter_groups TYPE kkblo_t_grouplevels,
s_subtot_options TYPE kkblo_subtot_options,
flg_append_mode(1) TYPE c,
is_reprep_id TYPE kkblo_reprep_id,
i_callback_before_line_output TYPE kkblo_formname,
i_callback_after_line_output TYPE kkblo_formname,
i_callback_foreign_top_of_page TYPE kkblo_formname,
i_callback_foreign_end_of_page TYPE kkblo_formname,
i_callback_list_modify TYPE kkblo_formname,
i_callback_top_of_coverpage TYPE kkblo_formname,
i_callback_end_of_coverpage TYPE kkblo_formname,
i_callback_grouplevel_change TYPE kkblo_formname,
i_callback_item_data_expand TYPE kkblo_formname,
i_callback_header_transport TYPE kkblo_formname,
i_callback_reprep_sel_modify TYPE kkblo_formname,
i_callback_subtotal_text TYPE kkblo_formname,
END OF ty_stack2.
TYPES: t_stack2 TYPE TABLE OF ty_stack2 INITIAL SIZE 0.
** *--- iTables
DATA: it_stack TYPE t_stack WITH HEADER LINE.
DATA: it_stack2 TYPE t_stack2 WITH HEADER LINE.
***ALV Customer Wrapper
DATA: it_stack3 TYPE t_stack3 WITH HEADER LINE.
CONSTANTS: BEGIN OF c_con_listtype,
simple(1) TYPE c VALUE 'S',
hier_sequ(1) TYPE c VALUE 'H',
matrix(1) TYPE c VALUE 'M',
END OF c_con_listtype.
DATA: gv_callback_program1 TYPE sy-repid,
gv_callback_user_command1 TYPE kkblo_formname,
gv_callback_top_of_page1 TYPE kkblo_formname,
gv_callback_top_of_list1 TYPE kkblo_formname,
gv_callback_end_of_page1 TYPE kkblo_formname,
gv_callback_end_of_list1 TYPE kkblo_formname,
gv_callback_pf_status_set1 TYPE kkblo_formname,
gv_callback_layout_save1 TYPE kkblo_formname,
gv_callback_fieldcat_save1 TYPE kkblo_formname,
gv_callback_grouplevel_change1 TYPE kkblo_formname,
gv_callback_before_line_otput1 TYPE kkblo_formname,
gv_callback_after_line_otput1 TYPE kkblo_formname,
gv_callback_foreign_top_of_pg1 TYPE kkblo_formname,
gv_callback_foreign_end_of_pg1 TYPE kkblo_formname,
gv_callback_list_modify1 TYPE kkblo_formname,
gv_callback_top_of_coverpge1 TYPE kkblo_formname,
gv_callback_end_of_coverpge1 TYPE kkblo_formname,
gv_callback_item_data_expand1 TYPE kkblo_formname,
gv_callback_header_transport1 TYPE kkblo_formname,
gv_callback_reprep_sel_modify1 TYPE kkblo_formname,
gv_callback_subtotal_text1 TYPE kkblo_formname,
gv_layout1 TYPE kkblo_layout,
gv_fieldcat1 TYPE kkblo_t_fieldcat,
gv_fctype1 TYPE c,
gv_event_exit1 TYPE kkblo_t_event_exit,
gv_excluding1 TYPE kkblo_t_extab,
gv_special_groups1 TYPE kkblo_t_sp_group,
gv_sort1 TYPE kkblo_t_sortinfo,
gv_filter1 TYPE kkblo_t_filter,
gv_except_qinfo1 TYPE slis_t_qinfo_alv,
gv_sel_hide1 TYPE slis_sel_hide_alv,
gv_reprep_id1 TYPE slis_reprep_id,
gv_screen_start_column1 TYPE i,
gv_salv_adapter1 TYPE REF TO if_salv_adapter,
gv_suppress_empty_data1 TYPE sap_bool.
FUNCTION z_excel_download_test.
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(I_BYPASSING_BUFFER) TYPE CHAR01 OPTIONAL
*" REFERENCE(I_BUFFER_ACTIVE) OPTIONAL
*" REFERENCE(I_CALLBACK_PROGRAM) TYPE SY-REPID OPTIONAL
*" REFERENCE(I_CALLBACK_USER_COMMAND) OPTIONAL
*" REFERENCE(I_CALLBACK_TOP_OF_PAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_TOP_OF_LIST) OPTIONAL
*" REFERENCE(I_CALLBACK_END_OF_PAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_END_OF_LIST) OPTIONAL
*" REFERENCE(I_CALLBACK_PF_STATUS_SET) OPTIONAL
*" REFERENCE(I_CALLBACK_LAYOUT_SAVE) OPTIONAL
*" REFERENCE(I_CALLBACK_FIELDCAT_SAVE) OPTIONAL
*" REFERENCE(I_CALLBACK_GROUPLEVEL_CHANGE) OPTIONAL
*" REFERENCE(I_CALLBACK_BEFORE_LINE_OUTPUT) OPTIONAL
*" REFERENCE(I_CALLBACK_AFTER_LINE_OUTPUT) OPTIONAL
*" REFERENCE(I_CALLBACK_FOREIGN_TOP_OF_PAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_FOREIGN_END_OF_PAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_LIST_MODIFY) OPTIONAL
*" REFERENCE(I_CALLBACK_TOP_OF_COVERPAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_ITEM_DATA_EXPAND) OPTIONAL
*" REFERENCE(I_CALLBACK_END_OF_COVERPAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_HEADER_TRANSPORT) OPTIONAL
*" REFERENCE(I_CALLBACK_REPREP_SEL_MODIFY) OPTIONAL
*" REFERENCE(I_CALLBACK_SUBTOTAL_TEXT) OPTIONAL
*" REFERENCE(I_TABNAME) TYPE SLIS_TABNAME OPTIONAL
*" REFERENCE(I_FCTYPE) DEFAULT 'R'
*" REFERENCE(IT_EXCEPT_QINFO) TYPE SLIS_T_QINFO_ALV OPTIONAL
*" REFERENCE(IS_SEL_HIDE) TYPE SLIS_SEL_HIDE_ALV OPTIONAL
*" REFERENCE(IS_REPREP_ID) TYPE SLIS_REPREP_ID OPTIONAL
*" REFERENCE(I_SCREEN_START_COLUMN) DEFAULT 0
*" REFERENCE(I_OO_ALV) OPTIONAL
*" REFERENCE(IR_SALV_ADAPTER) TYPE REF TO IF_SALV_ADAPTER OPTIONAL
*" REFERENCE(I_SUPPRESS_EMPTY_DATA) TYPE SAP_BOOL DEFAULT
*" ABAP_FALSE
*" REFERENCE(I_FILE) TYPE STRING OPTIONAL
*" REFERENCE(IT_FIELDCAT) TYPE SLIS_T_FIELDCAT_ALV OPTIONAL
*" REFERENCE(IS_LAYOUT) TYPE SLIS_LAYOUT_ALV OPTIONAL
*" REFERENCE(IT_SORT) TYPE SLIS_T_SORTINFO_ALV OPTIONAL
*" REFERENCE(IT_FILTER) TYPE SLIS_T_FILTER_ALV OPTIONAL
*" REFERENCE(IT_EXCLUDING) TYPE SLIS_T_EXTAB OPTIONAL
*" REFERENCE(IT_SPECIAL_GROUPS) TYPE SLIS_T_SP_GROUP_ALV OPTIONAL
*" REFERENCE(IS_KEYINFO) TYPE SLIS_KEYINFO_ALV OPTIONAL
*" REFERENCE(IT_EVENT_EXIT) TYPE SLIS_T_EVENT_EXIT OPTIONAL
*" REFERENCE(IS_LIST_SCROLL) TYPE SLIS_LIST_SCROLL OPTIONAL
*" REFERENCE(IS_PRINT) TYPE SLIS_PRINT_ALV OPTIONAL
*" REFERENCE(IS_LINEINFO) TYPE SLIS_LINEINFO OPTIONAL
*" REFERENCE(I_REPID) TYPE SYREPID OPTIONAL
*" TABLES
*" T_OUTTAB TYPE STANDARD TABLE OPTIONAL
*********** Local data declarations******************
DATA: gv_list TYPE char1.
DATA: gv_fcat_complete TYPE sap_bool.
DATA: gv_buffer_active TYPE char01,
wa_variant TYPE disvariant.
DATA: gv_controller TYPE REF TO cl_salv_export_c8r.
DATA: gv_xml TYPE xstring.
DATA: gv_s_xml_choice TYPE if_salv_bs_xml=>s_type_xml_choice.
DATA: gv_t_xml_choice TYPE if_salv_bs_xml=>t_type_xml_choice.
DATA: gv_param_lvc TYPE if_salv_export=>s_type_param_lvc.
DATA: gv_data TYPE REF TO data.
DATA: gv_result_data TYPE REF TO cl_salv_ex_result_data_table.
DATA: gv_flavour TYPE string.
DATA: gv_version TYPE string.
DATA: -
Hi ALL
I want to add new fields on seeded EBS page to store their values in hr_api_transaction table whoch contain information of other fields on that page which are seeded
but that table has one column which stores xml file and that xml file has all information about that page's fields
how can I store my custom fields values in that xml file ?Hi,
As Andy said, add data to an xml file is overwriting, if you mean append data to xml file, please look this article:
http://codesamplez.com/programming/linq-to-xml-tutorial, Since this issue is more related to ASP.net, you could also ask this issue in asp.net forum:
http://forums.asp.net/
Best Regards,
Jambor
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How to fetch data from XML and store it in internal table
Hi All,
Can anyone help me out, in fetching data from xml and store it in an internal table. Is there any standard function module is there?
Regards,
Karthickto do this you can either develop a XSLT program and use it with CALL TRNSFORMATION key word to tranform the XML into itab .
(search the ABAP General forum, i have posted few samples)
or simply use the following FM which converts your XML into a itab of name value pair (name would holw the element name and value would hold the value of the element) which you can then loop and read it to your itb.
data: xmldata type xstring .
data: result_xml type standard table of smum_xmltb .
data: return type standard table of bapiret2 .
CALL FUNCTION 'SMUM_XML_PARSE'
EXPORTING
xml_input = xmldata
TABLES
xml_table = result_xml
return = return .
Regards
Raja -
How to write data to xml file?
Hi,
I have done a project which read data from a web then write in log file.
Now i want to write data in xml file.
how to write?
i read some java and xml tutorial, quite quite difficult.
Who can give a simple example with some comments?
If you also give some tips on learning java web services, i will be very appreciated.
Thanks
Yang BinChoose Xerces2.4 to serialize the DOM object is an option.
javac XercesTest.java -classpath xmlParserAPIs.jar;xercesImpl.jar;.
java -classpath xmlParserAPIs.jar;xercesImpl.jar;. XercesTest test.xml
below is the source file: XercesTest.java
//JAXP
import javax.xml.parsers.*;
import org.w3c.dom.*;
//APACHE SERIALIZE FUNCTION
import org.apache.xml.serialize.*;
class XercesTest
public static void main(String[] args) throws Exception
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse( new File( args[0] ) );
File f = new File( "copy_of_"+ args[0] );
OutputFormat format = new OutputFormat("xml","UTF-8",true ) ;
FileOutputStream fout = new FileOutputStream( f );
XMLSerializer ser = new XMLSerializer(fout, format );
ser.serialize( doc );
hope it's helpful
land
Maybe you are looking for
-
How do you download Kindle book to iPhone 5s?
I have many Kindle books I've purchased from Amazon; they are accessible to me on-line and I can download them at will to my Kindle. But how can I download them to my Iphone 5s?
-
I just tried to install both PS CS and AI CS from my install disks that I haven't touched in years and both disks' installation apps failed to respond. I ran disk utility and got the same message: unused node is not erased (node 1). Repair disk. W
-
On Win VISTA start-up "1304: iTunesHelper.exe - Unable To Locate Component"
I am receiving this error notice whenever logging into windows. Says "This application has failed to start because ASL.dll was not found. Re-installing the application may fix the problem." My children use itunes, so I'm unfamiliar with it and its co
-
Firefox upgraded automatically; in doing so, it stated that Constant Guard Security Suite, which is provided by Comcast, my internet service, is not compatible, and had to be disabled. Please explain why; is Firefox providing anti-virus when I surf t
-
very often I need to search a single track in an album and then I start my browsing just from that point, using yhe arrow keys. i.e. I did like this: select the search filed, type the keywords, select the track, empty the search field, press twice th