cancel
Showing results for 
Search instead for 
Did you mean: 

attribute "action" missing or wrong XML structure

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

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>

Former Member
0 Kudos

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>

baskar_gopalakrishnan2
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Bhaskar,

My param tag elements are LIFNR , NAME1 , ind_situa_regis and dat_situa_regis

The stored procedure is created by database admin and when executed it will insert these fields in the sql table.

Thanks,

Teresa

baskar_gopalakrishnan2
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Hi Baskar,

I have followed the following structure below as shown in the blog below.

/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi

Thanks,

Teresa

baskar_gopalakrishnan2
Active Contributor
0 Kudos

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...

Former Member
0 Kudos

Hi Baskar,

I am not creating xsd. I just downloaded to post in the forum so you can see the structure. I will try your example.

Thanks,

Teresa

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Looks like what you did and my example are pretty much same. I want you to update or activate all mapping objects and retest the scenario.

Former Member
0 Kudos

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>

Former Member
0 Kudos

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>

naveen_chichili
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

naveen_chichili
Active Contributor
0 Kudos

Yes teresa..

Could you check the communication channel payload by clicking the message id ....and check the payload in the content tab in the popup wondow....

and let me know the result

Regards,

Naveen

Former Member
0 Kudos

CROSS CHECK UR STRUCTURE....

<DT_SP>

<StatementName>

<storedProcedureName action=u201DEXECUTEu201D>

<table>sp_LFA1</table>

<LIFNR type=xsd:string> </LIFNR>

<NAME type=xsd:string> </NAME>

</storedProcedureName >

</StatementName>

</DT_SP>

Edited by: AmitSri on Jul 20, 2011 8:45 PM

Former Member
0 Kudos

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>

Former Member
0 Kudos

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>

Former Member
0 Kudos

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>

baskar_gopalakrishnan2
Active Contributor
0 Kudos

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>

Former Member
0 Kudos

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

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>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>

Former Member
0 Kudos

action is defined as an attribute under StatementName..and table is defined as an element...

Former Member
0 Kudos

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

Former Member
0 Kudos

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>

Former Member
0 Kudos

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

Answers (0)