JDBC XML structure
Hi,
I am new to XI. When I am using JDBC adpter as receiver we are using XML structue. In that we can maintain the table name in <realDBtablename > or <tablename> tag. What is the difference between these two tags. Which one we use in which scenario.If table having any special characters which tag we have to use? Please give detail information....
thaks
Sridhar
HI,
From SAP Help.
<StatementName1>
<dbTableName action=UPDATE | UPDATE_INSERT>
<table>realDbTableName</table>
<access>
<col1>val1</col1>
<col2>val2new</col2>
</access>
<key1>
<col2>val2old</col2>
<col4>val4</col4>
</key1>
<key2>
<col2>val2old2</col2>
</key2>
</dbTableName>
</StatementName1>
If you use the optional <table> element, the value specified is used as a database table name. This enables you, for example, to define table names containing non-XML-compatible characters or characters that prevent them from being used in interface definitions in the Integration Builder. If specified, <table> must be the first element in the block within <dbTableName>.
Regards,
Sudheer
Similar Messages
-
Attribute "action" missing or wrong XML structure
Does anyone know what's the problem of below XML format ? I want to triggle a stored procedure in AS/400 from SAPXI after receiving records. But the message "No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)" is found
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_t1 xmlns:ns0="http://cxx.xxx.hk/zxxxpxx/jdbc">
<storedProcedurename>
<action>EXECUTE</action>
<table>LIBRARY.PROCNAME</table>
<TRNX_TYPE IsInput="true" TYPE="CHAR">content 1</TRNX_TYPE>
<TRNX_NO IsInput="true" TYPE="CHAR">content 2</TRNX_NO>
</storedProcedurename>
</ns0:MT_t1>Dear all,
Thanks for your help and now I can submit a stored procedure via SAP XI by using below XML format. I try to define two output parameters at the end of this XML. How to get the return value ? Should I define a response message type ? and what is the XML format ?
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_SYN_t1 xmlns:ns0="http://xxx.xxu.hk/zxxxpgs/jdbc">
<update>
<storedProcedurename action="EXECUTE">
<table>LIBRARY.PANSYTEST</table>
<TRNX_TYPE IsInput="TRUE" TYPE="CHAR">4</TRNX_TYPE>
<TRNX_NO IsInput="TRUE" TYPE="CHAR">2</TRNX_NO>
<ACTIN IsInput="TRUE" TYPE="CHAR">23</ACTIN>
<RCRT_DATM IsInput="TRUE" TYPE="CHAR">3</RCRT_DATM>
<RCRT_USER IsInput="TRUE" TYPE="CHAR">8</RCRT_USER>
<STUD_ID IsInput="TRUE" TYPE="CHAR">8</STUD_ID>
<AWD_SEQ IsInput="TRUE" TYPE="CHAR">6899</AWD_SEQ>
<AW_PSDATE IsInput="TRUE" TYPE="CHAR">89</AW_PSDATE>
<AW_PEDATE IsInput="TRUE" TYPE="CHAR">99</AW_PEDATE>
<OUT_TRNX_TYPE IsOutput="TRUE" TYPE="CHAR">4</OUT_TRNX_TYPE>
<OUT_TRNX_NO IsOutput="TRUE" TYPE="CHAR">2</OUT_TRNX_NO>
</storedProcedurename>
</update>
</ns0:MT_SYN_t1> -
How can I get the XML structure from a flat structure?
Hi all,
in my XI SP 12 I use a JMS adapter to read information using the WebSphereMQ transport protocol.
The structure that I receive have this format:
<Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value>
<NumberRecordType_B><NumberRecordType_c>
<Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
<Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
<Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
<Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
the problem is that in this structure each line is not separated by a carriage return or a comma, I have all the information in a single line:
<Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value><NumberRecordType_B><NumberRecordType_c><Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>...<Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value><Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>...<Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
and the customer don't want to insert a line separator.
Then, the question is:
How can I get the XML structure from this structure?
If possible, I don't want to develop new Module and add it in the JMS Module Sequence.
PS I have already read the article "How to Use the Content Conversion Module with the XI 3 J2EE JMS Adapter.pdf" and it doesn't seem to help me.
Best Regards,
PaoloTo get context parameters from your web.xml file you can simply get the ActionServlet object from an implementing action object class. In the perform (or execute) method make the following call.
ServletContext context = getServlet().getServletContext();
String tempContextVar =
context.getInitParameter("<your context param >"); -
One Communication Channel for two XML-Structure
Hi to all!
i'm Newbee in XI.
i register one Communication Channel to recieve two different XML-Structure and when i sent second structure there was a Mapping error, because XI waiting for first XML-Structure.
I'd like to ask if there are any additional condition that i must tune up to make it possible or just it's impossible?Hi,
Please refer below links
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/121b053d-0401-0010-539f-f9295efb7bad
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3a913f71-0601-0010-7a83-dfd3208a9a0b
how to find the URL of deployed Web services?
Creating .NET Web service
http://www.15seconds.com/issue/010430.htm
Also refer SOAP Framework to generate the common wsdl for both the messages with single SOAP CC
http://help.sap.com/saphelp_nw04s/helpdata/en/bb/ddb33d2ae46b3be10000000a114084/frameset.htm
Thanks
swarup -
Special characters in XML structure when prepared using String
Hi,
I am preparing an XML structure using 'String'. I print the prepared XML structure in the server log. Issue is that I am seeing extra characters([[ and ]]) that I am not printing.
Please let me know how to get rid of those.
Code Excerpt
String xmlHeader = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
String lsb_xmlcon = xmlHeader;
logger.info("ReqXMLString Process 1 --->" + lsb_xmlcon);
lsb_xmlcon = lsb_xmlcon +("\n");
logger.info("ReqXMLString Process 1.1 --->" + lsb_xmlcon);
lsb_xmlcon = lsb_xmlcon +("<REQUEST>");
lsb_xmlcon = lsb_xmlcon +("\n");
logger.info("ReqXMLString Process 1.2 --->" + lsb_xmlcon);
Log
ReqXMLString Process 1 ---><?xml version="1.0" encoding="utf-8" ?>
ReqXMLString Process 1.1 ---><?xml version="1.0" encoding="utf-8" ?>[[
ReqXMLString Process 1.2 ---><?xml version="1.0" encoding="utf-8" ?>[[
<REQUEST>
Thanks,
Message was edited by: 996913
This issue is observed only while running the code in server, not from Jdev.
When we append the additional tags without new line character, "\n", there are no extra characters being added. Also, in other case also. where we used "Marshaller" to prepare the XML, we have seen this issue.
After we set the below property to false, we got rid of the extra characters.
jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, false);
Apparently the insertion of new line when the code runs on server(Weblogic 10.3.6.0) is creating the issue.
Please let me know if anyone has come across a similar scenario.
Thanks,I am building this XML in a servlet so ,right, DOM does process XML (even though a valid HTML file can be loaded into a DOM object) but if you build XML using DOM then write the XML out using PrintWriter and Transformer objects this will cause the XML to print out in your browser. If you view source on this XML you will see that the DOM object has translated all special characters to there &xxxx; equivalent. For a example: when the string (I know "cool" java) gets loaded into a attribute using the DOM object then wrote back out it looks like (I know &xxx;cool&xxx; java) if you view the source in your browser. This is what it should do, but the DOM object is not change the � to the "&xxxxx;". This servlet is acting as a gateway between a Java API and a windows asp. The asp will call the servlet expecting to get XML back and load it directly into a DOM object. When the windows DOM object gets the xml that I am returning in this servlet is throws a exception "invalid character" because the � was not translated to &xxxx; like the other characters were. According to the book HTML 4 in 24 hours (and other references) the eacute; or #233; are how you say "�" in HTML or XML. How do you say it?
-
How to use For-Each Structure with Multiple node XML structure
Hi,
How to use for-each (BPEL 2.0) construct for Multinode XML structure.
Here is the easy case: I have list of suppliers specified by supplier
<supplierList>
<supplier>1</supplier>
<supplier>2</supplier>
<supplier>3</supplier>
</supplierList>
Now there is a web service http://hostname/getsupplierdetails/wsdl which accepts one supplier at a time.
like
<supplier>1</supplier>
reponse object is
<message> notfound/found </message>
But how can I use for each of XML node to call this service and collect the result like
<supplierList1>
<Suppinfo>
<supplier>1</supplier>
<message> not found</message>
</suppinfo>
<suppinfo>
<supplier>1</supplier>
<message> not found</message>
</suppinfo>
</supplierlist1>
ThanksFor looping you use foreach loop and , loop for the number of occurences and when constructing response, adding a new element you have to use bpelx:append. Good sample at Enterprise Integration: Oracle SOA Suite 11g: Populating a list or an array in BPEL without using XSLT.
-
What's the format of the datasource tag in jbosscmp-jdbc.xml
Hi,
I made a CMP when I use Lomboz to generate the classes, and xml files, but I still don't know how to relate my CMP to datasource.
I thought may be I should configure the jbosscmp-jdbc.xml, because when I look in this file and found:
<defaults>
<datasource>PLEASE_MODIFY_THIS</datasource>
<datasource-mapping>PLEASE_MODIFY_THIS</datasource-mapping>
<preferred-relation-mapping>PLEASE_MODIFY_THIS</preferred-relation-mapping>
</defaults>
But I don't know how to "modify this", What do those tags mean? what are those for? and what are the Formats?
My database -- mySQL
datasouce xml file -- test-ds.xml:
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/test</jndi-name>
<connection-url>jdbc:mysql://devsz-ma3.cn1.belton.com.hk:3306/test?useUnicode=true&characterEncoding=UTF-8</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>touchpanel</user-name>
<password>touchpanel</password>
</local-tx-datasource>
</datasources>
I need help, can you tell me some about that, thanks
next is my CMP entity bean:
package ejb.product;
import java.rmi.RemoteException;
import javax.ejb.EJBException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.RemoveException;
* @ejb.bean name="Product"
* jndi-name="ProductBean"
* type="CMP"
* primkey-field="productId"
* schema="Product"
* cmp-version="2.x"
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.bean ejb-name="Product"
* jndi-name="ProductBean"
* @jonas.jdbc-mapping jndi-name="jdbc/test" jdbc-table-name="FL_PRODUCT"
* @ejb.persistence
* table-name="FL_PRODUCT"
* @ejb.finder
* query="SELECT OBJECT(a) FROM Product as a"
* signature="java.util.Collection findAll()"
* @ejb.finder
* query="SELECT OBJECT(a) FROM Product a where a.NAME = ?1"
* signature="java.util.Collection findByName(java.lang.String name)"
* @ejb.finder
* query="SELECT OBJECT(a) FROM Product a where a.DESCRIPTION = ?1"
* signature="java.util.Collection findByDescription(java.lang.String desc)"
* @ejb.finder
* query="SELECT OBJECT(a) FROM Product a where a.BASE_PRICE = ?1"
* signature="java.util.Collection findByBasePrice(double basePrice)"
* @ejb.finder
* query="SELECT OBJECT(a) FROM Product "
* signature="java.util.Collection findAllProducts()"
* @ejb.finder
* query="SELECT OBJECT(a) FROM Product a where a.BASE_PRICE > ?1"
* signature="java.util.Collection findExpensiveProduct(double maxPrice)"
* * @ejb.finder
* query="SELECT OBJECT(a) FROM Product a where a.BASE_PRICE < ?1"
* signature="java.util.Collection findCheapProduct(double minPrice)"
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.finder-method-jdbc-mapping method-name="findAll"
* jdbc-where-clause=""
* @jonas.jdbc-mapping jndi-name="jdbc/test"
* jdbc-table-name="FL_PRODUCT"
public abstract class ProductBean implements EntityBean {
protected EntityContext ectx;
* The ejbCreate method.
* @ejb.create-method
public java.lang.String ejbCreate(String productId, String name, String desc,double basePrice) throws javax.ejb.CreateException {
// EJB 2.0 spec says return null for CMP ejbCreate methods.
// TODO: YOU MUST INITIALIZE THE FIELDS FOR THE BEAN HERE.
// setMyField("Something");
System.out.println("Entering ProductBean.ejbCreate()");
setProductId(productId);
setName(name);
setDescription( desc);
setBasePrice(basePrice);
System.out.println("Leaving ProductBean.ejbCreate()");
return productId;
* The container invokes this method immediately after it calls ejbCreate.
public void ejbPostCreate(String productId, String name, String desc,double basePrice) throws javax.ejb.CreateException {
* Returns the productId
* @return the productId
* @ejb.persistent-field
* @ejb.persistence
* column-name="PRODUCT_ID"
* sql-type="varchar"
* @ejb.pk-field
* @ejb.interface-method
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.cmp-field-jdbc-mapping field-name="productId"
* jdbc-field-name="PRODUCT_ID"
public abstract java.lang.String getProductId();
* Sets the productId
* @param java.lang.String the new productId value
* @ejb.interface-method
public abstract void setProductId(java.lang.String productId);
* Returns the name
* @return the name
* @ejb.persistent-field
* @ejb.persistence
* column-name="NAME"
* sql-type="varchar"
* @ejb.interface-method
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.cmp-field-jdbc-mapping field-name="name"
* jdbc-field-name="NAME"
public abstract java.lang.String getName();
* Sets the name
* @param java.lang.String the new name value
* @ejb.interface-method
public abstract void setName(java.lang.String name);
* Returns the description
* @return the description
* @ejb.persistent-field
* @ejb.persistence
* column-name="DESCRIPTION"
* sql-type="varchar"
* @ejb.interface-method
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.cmp-field-jdbc-mapping field-name="description"
* jdbc-field-name="DESCRIPTION"
public abstract java.lang.String getDescription();
* Sets the description
* @param java.lang.String the new description value
* @ejb.interface-method
public abstract void setDescription(java.lang.String description);
* Returns the basePrice
* @return the basePrice
* @ejb.persistent-field
* @ejb.persistence
* column-name="BASE_PRICE"
* sql-type="double"
* @ejb.interface-method
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.cmp-field-jdbc-mapping field-name="basePrice"
* jdbc-field-name="BASE_PRICE"
public abstract double getBasePrice();
* Sets the basePrice
* @param double the new basePrice value
* @ejb.interface-method
public abstract void setBasePrice(double basePrice);
/* (non-Javadoc)
* @see javax.ejb.EntityBean#ejbActivate()
public void ejbActivate() throws EJBException, RemoteException {
System.out.println("ejbActivate() called.");
/* (non-Javadoc)
* @see javax.ejb.EntityBean#ejbLoad()
public void ejbLoad() throws EJBException, RemoteException {
System.out.println("ejbLoad() called.");
/* (non-Javadoc)
* @see javax.ejb.EntityBean#ejbPassivate()
public void ejbPassivate() throws EJBException, RemoteException {
System.out.println("ejbPassivate() called.");
/* (non-Javadoc)
* @see javax.ejb.EntityBean#ejbRemove()
public void ejbRemove() throws RemoveException, EJBException, RemoteException {
System.out.println("ejbRemove() called.");
/* (non-Javadoc)
* @see javax.ejb.EntityBean#ejbStore()
public void ejbStore() throws EJBException, RemoteException {
System.out.println("ejbStore() called.");
/* (non-Javadoc)
* @see javax.ejb.EntityBean#setEntityContext(javax.ejb.EntityContext)
public void setEntityContext(EntityContext arg0) throws EJBException, RemoteException {
this.ectx = arg0;
/* (non-Javadoc)
* @see javax.ejb.EntityBean#unsetEntityContext()
public void unsetEntityContext() throws EJBException, RemoteException {
this.ectx = null;
}you can try this
<defaults>
<datasource>java:/jdbc/test</datasource>
<datasource-mapping>MySQL</datasource-mapping>
<create-table>false</create-table>
<remove-table>false</remove-table>
</defaults>
JaimeS -
Mapping an XML structure into one field
Make use of XSLT mapping (available on SDN...just search with CDATA...i think there is a new feature in PI7.1 (Copy XMl to subtree....something like that).
Regards,
Abhishek.Hi,
Chk this:
/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
Re: Conversion of source XML structure to single string using PI 7.1
Thanks
Amit -
XSLT Mapping to convert u201C.CSVu201D file into XML Structure.
Hi All,
I wanted to know can we use XSLT Mapping to convert u201C.CSVu201D file into XML Structure.
I am communicating between two XI Systems. First XI system is going to give u201C.CSVu201D file as main document. I need to post IDOC Corresponding to this. So what I want to do is read this u201C.CSVu201D file (Main document in payload) and first convet it into XML and then use second mapping which will convert XML to IDOC.
I know this is possible with JAVA Mapping but just wanted to confirm can we do this with XSLT mapping as well?
Regards,
GouriHi Amit,
I know this way it shd work as i am able see other XSLT files. But this particular file is not visible.
I am copying following code only in sample.xslt file.
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn="fn"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="2.0" exclude-result-prefixes="xs fn">
<xsl:output indent="yes" encoding="US-ASCII" />
<xsl:param name="pathToCSV" select="'file:///c:/csv.csv'" />
<xsl:function name="fn:getTokens" as="xs:string+">
<xsl:param name="str" as="xs:string" />
<xsl:analyze-string select="concat($str, ',')" regex='(("["]*")+|[,]*),'>
<xsl:matching-substring>
<xsl:sequence select='replace(regex-group(1), "^""|""$|("")""", "$1")' />
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:function>
<xsl:template match="/" name="main">
<xsl:choose>
<xsl:when test="unparsed-text-available($pathToCSV)">
<xsl:variable name="csv" select="unparsed-text($pathToCSV)" />
<xsl:variable name="lines" select="tokenize($csv, ' ')" as="xs:string+" />
<xsl:variable name="elemNames" select="fn:getTokens($lines[1])" as="xs:string+" />
<root>
<xsl:for-each select="$lines[position() > 1]">
<row>
<xsl:variable name="lineItems" select="fn:getTokens(.)" as="xs:string+" />
<xsl:for-each select="$elemNames">
<xsl:variable name="pos" select="position()" />
<elem name="{.}">
<xsl:value-of select="$lineItems[$pos]" />
</elem>
</xsl:for-each>
</row>
</xsl:for-each>
</root>
</xsl:when>
<xsl:otherwise>
<xsl:text>Cannot locate : </xsl:text><xsl:value-of select="$pathToCSV" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Is this correct?
-Gouri -
Download XML structure to Application server
Hi all.
I am generating an XML structure based on some data that I select from HR e-Recruiting, and I need to save the generated XML file on the application server, not the presentation server (local computer). Most of the code I have found on SDN (contributed by Robert Eijpe) and I must admit that I do not understand everything the code does.
I have attached the source code and the resulting XML structure:
REPORT zhr_test2_tk.
TYPE-POOLS: ixml.
TYPES: BEGIN OF xml_line,
data(256) TYPE x,
END OF xml_line.
DATA: l_ixml TYPE REF TO if_ixml,
l_streamfactory TYPE REF TO if_ixml_stream_factory,
l_ostream TYPE REF TO if_ixml_ostream,
l_renderer TYPE REF TO if_ixml_renderer,
l_document TYPE REF TO if_ixml_document.
DATA: l_element_position TYPE REF TO if_ixml_element,
l_element_title TYPE REF TO if_ixml_element,
* l_element_flight TYPE REF TO if_ixml_element,
* l_element_from TYPE REF TO if_ixml_element,
* l_element_to TYPE REF TO if_ixml_element,
l_element_dummy TYPE REF TO if_ixml_element,
l_value TYPE string.
DATA: l_xml_table TYPE TABLE OF xml_line,
l_xml_size TYPE i,
l_rc TYPE i.
DATA: lt_erec TYPE TABLE OF hrp5126,
l_erec TYPE hrp5126.
DATA: date(10),
time(4),
filepath TYPE string.
CONSTANTS: filedir TYPE string VALUE 'C:tmp',
filename TYPE string VALUE 'ZHR_test'.
START-OF-SELECTION.
* fill internal table
SELECT * FROM hrp5126 INTO TABLE lt_erec.
* Start filling xml DOM object from internal table lt_erec.
LOOP AT lt_erec INTO l_erec.
*Create the root node 'position'
IF sy-tabix EQ 1.
* create an ixml factory
l_ixml = cl_ixml=>create( ).
* create Document Object Model
l_document = l_ixml->create_document( ).
* Fill root node with value 'position'
l_element_position = l_document->create_simple_element(
name = 'position'
parent = l_document ).
ENDIF.
IF sy-tabix GT 1.
* create element jobtitle as child of position
l_value = l_erec-jobtitle.
l_element_title = l_document->create_simple_element(
name = 'job_title'
parent = l_element_position
value = l_value ).
l_value = l_erec-empl_start_date.
l_element_dummy = l_document->create_simple_element(
name = 'StartDate'
parent = l_element_title
value = l_value ).
l_value = l_erec-empl_end_date.
l_element_dummy = l_document->create_simple_element(
name = 'EndDate'
parent = l_element_title
value = l_value ).
ENDIF.
ENDLOOP.
IF sy-subrc NE 0.
WRITE: 'No data in table hrp5125'.
ENDIF.
* create a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
* connect internal XML table to streamfactory
l_ostream = l_streamfactory->create_ostream_itable(
table = l_xml_table ).
* render the document
l_renderer = l_ixml->create_renderer( ostream = l_ostream
document = l_document ).
l_rc = l_renderer->render( ).
* Get time and date
WRITE sy-uzeit+2(2) TO time+2(2).
WRITE sy-uzeit+0(2) TO time+0(2).
WRITE sy-datum+4(2) TO date+0(2).
WRITE sy-datum+6(2) TO date+2(2).
WRITE sy-datum+0(4) TO date+4(4).
*Build filename with date and time reference
CONCATENATE filedir filename date time '.xml' INTO filepath.
<i>* This is the code I hope to modify in order to save the xml structure on the application server, with a specified filepath.</i>
<b> OPEN DATASET filepath FOR OUTPUT IN BINARY MODE.
LOOP AT lt_erec into l_erec.
TRANSFER l_erec TO filepath.
ENDLOOP.
CLOSE DATASET filepath.</b>
* save XML document
l_xml_size = l_ostream->get_num_written_raw( ).
*This is the code for download to local computer
* CALL METHOD cl_gui_frontend_services=>gui_download
* EXPORTING
* bin_filesize = l_xml_size
* filename = filepath
* filetype = 'BIN'
* CHANGING
* data_tab = l_xml_table
* EXCEPTIONS
* file_write_error = 1
* no_batch = 2
* gui_refuse_filetransfer = 3
* invalid_type = 4
* no_authority = 5
* unknown_error = 6
* header_not_allowed = 7
* separator_not_allowed = 8
* filesize_not_allowed = 9
* header_too_long = 10
* dp_error_create = 11
* dp_error_send = 12
* dp_error_write = 13
* unknown_dp_error = 14
* access_denied = 15
* dp_out_of_memory = 16
* disk_full = 17
* dp_timeout = 18
* file_not_found = 19
* dataprovider_exception = 20
* control_flush_error = 21
* OTHERS = 22.
* IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
<b>XML result:</b>
<?xml version="1.0" ?>
<position>
<job_title>Test Process Template</job_title>
<job_title>jjjj</job_title>
<job_title>Test Job Req. 20092005</job_title>
<job_title>Created 22.09</job_title>
<job_title>title 07.12</job_title>
<job_title>Test fra portal</job_title>
<job_title>Test med 100328</job_title>
<job_title>Test restricted recruiter</job_title>
<job_title>Test restricted recruiter</job_title>
<job_title>Workshop requisition job title</job_title>
</position>
Any help is greatly appreciated.
Best Regards,
Thomas KjelsrudHi Guillaume,
The thing is that the code I presented to you is incorrect. I am asking the question of how to download / save an XML (not an internal table) to the application server. Using the gui_download will not satisfy me need, as it only downloads to the presentation server (local machine that I run my SAP session on), when I need it to download to the application server. The Open Dataset and Transfer statements are (as far as I know) only used for downloading internal tables to the application server.
So I guess my question should be like this instead:
"How can I save the XML structure that is created in the above program to the file system in the application server?"
It is a bit hard to explain this, so please ask me more questions if required.
Thank you for helping.
Best regards,
Thomas -
How create an xml structure in a pdf form
Hi genius guys,
some one can help me to create a correct xml structure (root, subroot1, subroot2, etc etc) in a pdf form and not only the single tag?
Example: I give a pdf with form to be filled and after I extract xml data. Now I have this:
<?xml version="1.0" encoding="UTF-8"?>
<fields xmlns:xfdf="http://ns.adobe.com/xfdf-transition/"
><A1classe
>1995</A1classe
><A1cognome
>Fanna</A1cognome
><A1nome
>Tonino</A1nome
><Annodifondazione xfdf:original="Anno di fondazione"
>1965</Annodifondazione
><C1classe
>1976</C1classe
><C1cognome
>Di Gennaro</C1cognome
><C1nome
>Antonio</C1nome
><Campionato
>ECCELLENZA</Campionato
><Campodigioco
>Comunale di Villabartolomea</Campodigioco
><Colorisociali
>Giallo Rosso</Colorisociali
><D1classe
>1984</D1classe
><D1cognome
>Fontolan</D1cognome
><D1nome
>Beppe</D1nome
><Girone
>A</Girone
><P1classe
>1980</P1classe
><P1cognome
>Zoff</P1cognome
><P1nome
>Dino</P1nome
><P2classe
>1974</P2classe
><P2cognome
>Garella</P2cognome
><P2nome
>Claudio</P2nome
><S1cognome
>Baudo</S1cognome
><S1mansione
>Presidente</S1mansione
><S1nome
>Pippo</S1nome
><S2cognome
>Togni</S2cognome
><S2mansione
>Vice Presidente</S2mansione
><S2nome
>Darix</S2nome
><Sede
>Via Pisacane,8 - Villabartolomea</Sede
><Squadra
>VILLABARTOLOMEA</Squadra
><T1cognome
>Dallara</T1cognome
><T1mansione
>Allenatore</T1mansione
><T1nome
>Toni</T1nome
><T2cognome
>Silvan</T2cognome
><T2mansione
>Magazziniere</T2mansione
><T2nome
>Mago</T2nome
></fields
>
and I need this:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xfdf="http://ns.adobe.com/xfdf-transition/"
><attaccanti>
<A1classe
>1995</A1classe
><A1cognome
>Fanna</A1cognome
><A1nome
>Tonino</A1nome
>
</attaccanti>
<Annodifondazione xfdf:original="Anno di fondazione"
>1965</Annodifondazione
>
<centrocampisti>
<C1classe
>1976</C1classe
><C1cognome
>Di Gennaro</C1cognome
><C1nome
>Antonio</C1nome>
</centrocampisti>
<Campionato
>ECCELLENZA</Campionato
><Campodigioco
>Comunale di Villabartolomea</Campodigioco
><Colorisociali
>Giallo Rosso</Colorisociali
>
<difensori>
<D1classe
>1984</D1classe
><D1cognome
>Fontolan</D1cognome
><D1nome
>Beppe</D1nome
></difensori>
<Girone
>A</Girone
><portieri>
<P1classe
>1980</P1classe
><P1cognome
>Zoff</P1cognome
><P1nome
>Dino</P1nome
><P2classe
>1974</P2classe
><P2cognome
>Garella</P2cognome
><P2nome
>Claudio</P2nome
></portieri>
<societa>
<S1cognome
>Baudo</S1cognome
><S1mansione
>Presidente</S1mansione
><S1nome
>Pippo</S1nome
><S2cognome
>Togni</S2cognome
><S2mansione
>Vice Presidente</S2mansione
><S2nome
>Darix</S2nome
></societa>
<Sede
>Via Pisacane,8 - Villabartolomea</Sede
><Squadra
>VILLABARTOLOMEA</Squadra
><tecnici>
<T1cognome
>Dallara</T1cognome
><T1mansione
>Allenatore</T1mansione
><T1nome
>Toni</T1nome
><T2cognome
>Silvan</T2cognome
><T2mansione
>Magazziniere</T2mansione
><T2nome
>Mago</T2nome
>
</tecnici></root
>
Thanx, PaoloI solve the trouble using "." to separate the tagname and create the correct structure for xml.
example:
team.player.1name
team.player.1surname
team.player.1rol
team.player.2name
team.player.2surname
team.player.2role
this give me:
<team>
<player>
<1name>XXXX</1name>
<1surname>YYY</1surname>
<1role>forward</1role>
</player>
<player>
<2name>XXXX</2name>
<2surname>YYY</2surname>
<2role>forward</2role>
</player>
</team> -
Consistency error:more fields found in XML structure than specified in conv
Hi,
I am doing a File 0 RFC- File in PI 7.1 and facing the following error:
2009-12-07 09:45:05 Error MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Consistency error: more fields found in XML structure than specified in conversion parameters! (Value '20000000|3022|800.99|10.11.2009|Testing 22222|')', probably configuration error in file adapter (XML parser error)'
2009-12-07 09:45:05 Error File processing failed with com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Consistency error: more fields found in XML structure than specified in conversion parameters! (Value '20000000|3022|800.99|10.11.2009|Testing 22222|')', probably configuration error in file adapter (XML parser error)'
my output file record structure :
DT_out
itab_out 0.........1
item 0...... unbounded
STR 0........1
So i have given in the receiver FCC parameters as:
Record structure : item
Content conversion parameters:
item.fieldFixedLengths 255
item.endSeparator 'nl'
could anyone pls help me in solving this error at the earliest.
thanksmy problem has been solved by giving the FCC parameters as shown below:
my output file record structure :
DT_out
itab_out 0.........1
item 0...... unbounded
STR 0........1
So i have given in the receiver FCC parameters as:
Record structure : item,ITAB_OUT
Content conversion parameters:
item.fieldFixedLengths 255
item.endSeparator 'nl'
ITAB_OUT.fieldFixedLengths 255
ITAB_OUT.endSeparator 'nl' -
More fields in XML structure error in Adapter Monitor
Hi all
I am getting the following error in the adapter monitor
Error: Message processing failed: Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Consistency error: more fields found in XML structure than specified in conversion parameters! (Value ' ')', probably configuration error in file adapter (XML parser error)'
I am using FCC in the rx adapter. I have also checked the fields for any extra fields but there isnt any.
kindly suggest what could be throwing the error
regards
krishnaHi raj
here are the CC parameters.
BEGIN.addHeaderLine 0
BEGIN.fieldFixedLengths 2,1,3,2,4,1,8,12,8,2,307,12,8,12,18
BEGIN.fixedLengthTooShortHandling Ignore
BEGIN.endSeparator '0x0D''0x0A'
CLIENT_RECORD.addHeaderLine 0
CLIENT_RECORD.fieldFixedLengths 2,12,9,4,15,15,4,20,12,9,8,1,1,25,10,1,25,10,1,6,1,1,1,1,1,10,8,1,25,2,1,1,1,106,12,38
CLIENT_RECORD.fixedLengthTooShortHandling Ignore
CLIENT_RECORD.endSeparator '0x0D''0x0A'
RELATION_RECORD.addHeaderLine 0
RELATION_RECORD.fieldFixedLengths 2,12,9,4,20,20,2,2,9,8,1,25,10,1,25,10,1,6,1,1,181,12,38
RELATION_RECORD.fixedLengthTooShortHandling Ignore
RELATION_RECORD.endSeparator '0x0D''0x0A'
ADDRESS_RECORD.addHeaderLine 0
ADDRESS_RECORD.fieldFixedLengths 2,12,9,4,20,20,2,2,5,6,8,24,24,2,35,15,4,15,4,70,8,8,1,50,12,38
ADDRESS_RECORD.fixedLengthTooShortHandling Ignore
ADDRESS_RECORD.endSeparator '0x0D''0x0A'
GIVING_REC.addHeaderLine 0
GIVING_REC.fieldFixedLengths 2,12,9,4,20,9,1,1,1,1,1,1,1,1,1,1,1,1,1,281,12,38
GIVING_REC.fixedLengthTooShortHandling Ignore
GIVING_REC.endSeparator '0x0D''0x0A'
ZIKT_REC.addHeaderLine 0
ZIKT_REC.fieldFixedLengths 2,12,9,4,20,9,2,3,2,8,1,1,277,12,38
ZIKT_REC.fixedLengthTooShortHandling Ignore
ZIKT_REC.endSeparator '0x0D''0x0A'
BEPER_REC.addHeaderLine 0
BEPER_REC.fieldFixedLengths 2,12,9,4,20,9,1,1,1,291,12,38
BEPER_REC.fixedLengthTooShortHandling Cut
BEPER_REC.endSeparator '0x0D''0x0A'
SCORE_BEPER_REC.addHeaderLine 0
SCORE_BEPER_REC.fieldFixedLengths 2,12,9,4,20,9,1,3,4,1,1,284,12,38
SCORE_BEPER_REC.fixedLengthTooShortHandling Ignore
SCORE_BEPER_REC.endSeparator '0x0D''0x0A'
INDBES_REC.addHeaderLine 0
INDBES_REC.fieldFixedLengths 2,12,9,4,20,9,9,2,2,8,8,8,1,256,12,38
INDBES_REC.fixedLengthTooShortHandling Ignore
INDBES_REC.endSeparator '0x0D''0x0A'
FUNCTIONAL_REC.addHeaderLine 0
FUNCTIONAL_REC.fieldFixedLengths 2,12,9,4,20,9,9,3,2,8,8,8,1,4,2,2,1,1,1,1,8,1,1,233,12,38
FUNCTIONAL_REC.fixedLengthTooShortHandling Ignore
FUNCTIONAL_REC.endSeparator '0x0D''0x0A'
ACT_REC.addHeaderLine 0
ACT_REC.fieldFixedLengths 2,12,9,4,20,9,9,3,2,8,3,5,1,263,12,38
ACT_REC.fixedLengthTooShortHandling Ignore
ACT_REC.endSeparator '0x0D''0x0A'
SCORE_REC.addHeaderLine 0
SCORE_REC.fieldFixedLengths 2,12,9,4,20,9,3,4,1,1,285,12,38
SCORE_REC.fixedLengthTooShortHandling Ignore
SCORE_REC.endSeparator '0x0D''0x0A'
ZFUNCTIONAL_REC.addHeaderLine 0
ZFUNCTIONAL_REC.fieldFixedLengths 2,12,9,4,20,9,9,12,3,2,8,8,5,1,8,8,8,4,2,2,1,1,1,1,210,12,38
ZFUNCTIONAL_REC.fixedLengthTooShortHandling Ignore
ZFUNCTIONAL_REC.endSeparator '0x0D''0x0A'
ZACT_REC.addHeaderLine 0
ZACT_REC.fieldFixedLengths 2,12,9,4,20,9,9,3,2,3,5,8,8,5,8,1,242,12,38
ZACT_REC.fixedLengthTooShortHandling Ignore
ZACT_REC.endSeparator '0x0D''0x0A'
COMMENT.addHeaderLine 0
COMMENT.fieldFixedLengths 2,12,4,140,1,191,12,38
COMMENT.fixedLengthTooShortHandling Ignore
COMMENT.endSeparator '0x0D''0x0A'
END_REC.addHeaderLine 0
END_REC.fieldFixedLengths 2,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1,257,50
END_REC.fixedLengthTooShortHandling Ignore
END_REC.endSeparator '0x0D''0x0A'
REgards
krishna -
[CS3 JS] Is it possible to export just the XML structure?
Hello,
I am using scripts to find various objects in an InDesign document and tagging them.
I will then want to export the XML structure but not any of the content. I'm just learning XML and do not see a way to do this.
Thanks,
TomShare/export using QuickTime to an audio only codec such as MP3.
-
Converting XML structure to SQL string
Hi,
how can I convert an existing XML structure into a SQL string? It's important to do this manually, because there are additional data necessary to complete the recordset.
The XML structure is:
<File>
<Recordset>
<Column>Data</Column>
</Recordset>
</File>
The additional data are 4 columns for each recordset to implement into the SQL string.
The SQL string should be something like
"INSERT INTO table (Add_Column, Column, Column, Column) VALUES (Add_Data, Data, Data, Data)"
If anyone has source code performing operations like that I'd be grateful 'cause I'm quite new to Java and have not the experience in such transform ops.Which package includes xml sax?You can download it from,
http://java.sun.com/xml/download.html.
I can send you some sample pgms too, if you want.If you would, I'd be grateful.
Marko
Maybe you are looking for
-
MS Exchange 2013 certificate error.
we just setup Exchange 2013 but I cant configure outlook . it brings two error messages. 1. There is a problem with a proxy server's security certificate. the name on the certificate is invalid or does not match the name of the target site. 2. The co
-
What's the point in Game Center leaderboards if any one can submit a hacked score?
Just the question above, I really thought that a serious company as apple would have taken care of this issue...
-
Frequent "Error. Unkown File." on save
I teach high school video production. We're lucky enough to have three mostly-working Final Cut Express/Final Cut Pro stations. (we have both packages) On all of them, we often get an error while trying to save that there is an "Unkown File." I check
-
Laptop will not charge even when plugged in, stuck at 95%
I have a brand new HP dv6t-7000 which just came in today and after a few hours of use it already has a problem with the battery. The battery refuses to charge even when the AC adapter is plugged into the PC. The tray icon states that the computer is
-
Hello! Stupid-*** problem this one. For some reason, when I click terminal icon it takes about 10 seconds for the Cursor to respond. The window pops up straight away, but the prompt doesn't appear for a while. Very odd. It's been instant up until a f