on 07-19-2011 7:59 PM
I am getting error message when using the following xml structure below for message type that action is missing or wrong xml structure.
Below action is mapped to constant EXECUTE and table is mapped to constant which has the stored procedure name.
The fields LIFNR , NAME1 and STRAS that the stored procedure will update in the SQL table.
Please advice.
Thanks,
Teresa
<MT_SP_LFA>
<Statement Name>
action
table
LIFNR
type
NAME1
type
STRAS
type
Your structure should be something like this. I dont see action as attribute in your structure. Please see below...
<StatementName>
<storedProcedureName action =u201DEXECUTEu201D>
<table>realStoredProcedureeName</table>
<param1 [isInput=u201Dtrueu201D] [isOutput=true] type=SQLDatatype>val1</param1>
</storedProcedureName >
</StatementName>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhaskar,
I am still getting the error message below is the xsd of my data type. Please advice. Thanks a lot.
I have defined action as an attribute under storedProcedureName element.
Teresa
<?xml version="1.0" encoding="UTF-8"?><xsd:schema targetNamespace="http://test.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://test.com"><xsd:complexType name="DT_SP_test_LFA1"><xsd:annotation><xsd:documentation xml:lang="EN">Test Data type for Stored Procedure LFA1</xsd:documentation></xsd:annotation><xsd:sequence><xsd:element name="storedProcedureName" minOccurs="0"><xsd:complexType><xsd:sequence><xsd:element name="table" type="xsd:string"/><xsd:element name="LIFNR" minOccurs="0"><xsd:complexType><xsd:simpleContent><xsd:extension base="xsd:string"><xsd:attribute name="type" type="xsd:string" use="required"/></xsd:extension></xsd:simpleContent></xsd:complexType></xsd:element><xsd:element name="NAME1" minOccurs="0"><xsd:complexType><xsd:simpleContent><xsd:extension base="xsd:string"><xsd:attribute name="type" type="xsd:string" use="required"/></xsd:extension></xsd:simpleContent></xsd:complexType></xsd:element><xsd:element name="ind_situa_regis" minOccurs="0"><xsd:complexType><xsd:simpleContent><xsd:extension base="xsd:string"><xsd:attribute name="type" type="xsd:string" use="required"/></xsd:extension></xsd:simpleContent></xsd:complexType></xsd:element><xsd:element name="dat_situa_regis" minOccurs="0"><xsd:complexType><xsd:simpleContent><xsd:extension base="xsd:date"><xsd:attribute name="type" type="xsd:date" use="required"/></xsd:extension></xsd:simpleContent></xsd:complexType></xsd:element></xsd:sequence><xsd:attribute name="action" type="xsd:string" use="required"/></xsd:complexType></xsd:element></xsd:sequence></xsd:complexType></xsd:schema>
I believe you do stored procedure functionality. You need to construct data structure as I mentioned before. Where is param tag element?
you can specify input and output param only here..
Refer this link
http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7b72b2fde93673e10000000a114a6b/frameset.htm
Provide your xml structure. Are you closing tags for all the elements? ALso provide the error details?
Also add parameter logSQLStatement value is true in the advance tab of the comm channel Jdbc. This will provide more detail informaion.
Your param elements must match names as that of procedure.
The problem is action attribute is not under StoredProcedureName element. so you have issue.
Example: Something like below...
<xsd:element name="storedProcedureName" minOccurs="0">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="action" type="xsd:string" use="required"/>
</xsd:extension>
</xsd:simpleContent>
Why do you create XSD? Why not create attribute directly in data type.. that is no brainer...
Hi Baskar,
I got the same error. Is this structure below correct? spr_LFA1 is the stored Procedure name.
Thanks,
Teresa
<xsd:complexType name="DT_SP">
<xsd:sequence>
<xsd:element name="Statement" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="spr_LFA1" minOccurs="0">
<xsd:complexType>
<xsd:attribute name="action" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="LIFNR" minOccurs="0">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="type" type="xsd:string" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
Hi Baskar,
I got the same error. No action attribute found or xml structure is wrong. Is there anything wrong in the below Data type?
Thanks,
Teresa
<xsd:complexType name="DT_SP">
<xsd:sequence>
<xsd:element name="Statement" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="spr_LFA1" minOccurs="0">
<xsd:complexType>
<xsd:attribute name="action" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="LIFNR" minOccurs="0">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="type" type="xsd:string" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
Hi Teresa,
As per my understanding you are getting the error in Receiver communication channel correct me if i am wrong....
If this is the case you need to check the Payload which you are receiving to the channel is correct if not then check if you have maintained correct structure......
Regards,
Naveen
Hi Naveen,
Yes this error is in the receiver Comm channel. My inbound payload is an IDOC and all fields are mapped to the target fields.
The actual error message in the CC reads as below.
Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)
Thanks,
Teresa
Hi Naveen,
Here is the result below in the message id payload.
Thanks,
Teresa
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_SP_LFA1 xmlns:ns0="http://test.com/Ecc62MSsql">
- <Statement>
<LIFNR>1000020187</LIFNR>
<NAME1>IRS</NAME1>
<SORTL>IRS</SORTL>
<STRAS>.</STRAS>
<PSTLZ>63197</PSTLZ>
<ORT01>ST LOUIS</ORT01>
<LAND1>US</LAND1>
<REGIO>MO</REGIO>
<SMTP>SMTP</SMTP>
<STENR>1</STENR>
</Statement>
</ns0:MT_SP_LFA1>
Hi Amit,
Is action defined as an Element or Attribute under StatementName. Please see the structure below and advice.
Thanks,
Teresa
<xsd:complexType name="DT_SP1">
<xsd:sequence>
<xsd:element name="StatementName" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="action" />
<xsd:element name="table" />
<xsd:element name="LIFNR" minOccurs="0">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="type" type="xsd:string" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
Does the below structure look good? I got this from my payload.
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_BKPFBSEG_Response xmlns:ns0="http://test.com/sql">
- <Statement_Name action="execute">
<table>spr_LFA1</table>
<BUKRS>5110</BUKRS>
<GJAHR>2011</GJAHR>
<BLART>B5</BLART>
<BLDAT>20110718</BLDAT>
<BUDAT>20110718</BUDAT>
<MONAT>07</MONAT>
<XBLNR>123456789</XBLNR>
<XBLNR_ALT>123456789</XBLNR_ALT>
<DES_PROCE>No account is specified in item &</DES_PROCE>
</Statement_Name>
</ns0:MT_BKPFBSEG_Response>
You need inside schema tag the below tags....
<xsd:complexType name="DT_SP">
<xsd:sequence>
<xsd:element name="Statement" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="spr_LFA1" minOccurs="0">
<xsd:complexType>
<xsd:attribute name="action" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="LIFNR" minOccurs="0">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="type" type="xsd:string" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
Thanks Baskar. Let me try this and i will get back to you . Below is my final xml structure according to your example.
What is a inside schema tag ?
<xsd:complexType name="DT_SP">
<xsd:sequence>
<xsd:element name="Statement" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="spr_LFA1" minOccurs="0">
<xsd:complexType>
<xsd:attribute name="action" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="LIFNR" minOccurs="0">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="type" type="xsd:string" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="NAME1" minOccurs="0">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="type" type="xsd:string" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
Edited by: Teresa lytle on Jul 20, 2011 9:58 PM
>What is a inside schema tag ?
Something similar as below ... Example ...
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://gov.dhs.cbp.gov.bems/TRI_DatabaseLookup" targetNamespace="http://gov.dhs.cbp.gov.bems/TRI_DatabaseLookup">
<xsd:complexType name="DT_SP">
</xsd:schema>
Thanks Baskar . I am going to test the new xml strucutre this morning by sending some IDOCS from SAP to PI . I will let you know the results.
Only one thing I needed to let you know is that the stored Procedure spr_LFA1 in the xml structure is not mapped to any source.
I think that should be ok. The action is mapped to a constant "EXECUTE".
Will let you all know today.
Teresa
Hi Baskar,
I still get the same error message action attribute missing or XML structure wrong. Below is the paylload.
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_SP_LFA1 xmlns:ns0="http://test.com//Ecc62MSsql">
- <Statement>
<LIFNR>D100096170</LIFNR>
<NAME1>BBC DODGE, INC (57475)(BVF)</NAME1>
<SORTL>BBC DODGE</SORTL>
<STRAS>14650 1ST AVENUE SOUTH</STRAS>
<PSTLZ>98168</PSTLZ>
<ORT01>SEATTLE</ORT01>
<LAND1>US</LAND1>
<REGIO>WA</REGIO>
<SMTP>SMTP</SMTP>
<STENR>1</STENR>
</Statement>
</ns0:MT_SP_LFA1>
Below is my Data type that I have used.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://test.com/DF/Ecc62MSsql" targetNamespace="http://test.com/DF/Ecc62MSsql">
<xsd:element name="MT_SP_LFA1" type="DT_SP" />
<xsd:complexType name="DT_SP">
<xsd:sequence>
<xsd:element name="Statement" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="spr_LFA1" minOccurs="0">
<xsd:complexType>
<xsd:attribute name="action" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="LIFNR" minOccurs="0">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="type" type="xsd:string" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
Hi, Teresa.
You have to include action attribute and table node inside Statement node. Your structure should look like this:
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_SP_LFA1 xmlns:ns0="http://test.com//Ecc62MSsql">
- <Statement action="EXECUTE">
<table>realStoredProcedureName</table>
<LIFNR>D100096170</LIFNR>
<NAME1>BBC DODGE, INC (57475)(BVF)</NAME1>
<SORTL>BBC DODGE</SORTL>
<STRAS>14650 1ST AVENUE SOUTH</STRAS>
<PSTLZ>98168</PSTLZ>
<ORT01>SEATTLE</ORT01>
<LAND1>US</LAND1>
<REGIO>WA</REGIO>
<SMTP>SMTP</SMTP>
<STENR>1</STENR>
</Statement>
</ns0:MT_SP_LFA1>
Check this for your reference: [JDBC receiver structure|http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7b72b2fde93673e10000000a114a6b/frameset.htm]
Regards,
Federico
Edited by: fede groso on Jul 22, 2011 7:54 PM
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.