Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Using Web service with complex data types

Former Member
0 Likes
1,322

Hi All,

I have to access a SAP web service consuming a complex data type. Iu2019m using VBA in MS-Office.

Calling a web service with a simple type like String or long is not a problem. But I have to send a NodeList (MSXML2.IXMLDOMNodeList) to the service.

Here are the relevant parts out of the wsdl file:

<xsd:element name="SEARCH"><xsd:complexType><xsd:sequence>
<xsd:element name="CT_EQART_RANGE" type="tns:ZS_EQART_RANGE" minOccurs="0"></xsd:element>
</xsd:sequence>
...
<xsd:complexType name="ZS_EQART_RANGE">
	<xsd:sequence>
	  <xsd:element name="item" type="tns:ZS_EQART_RANGE_LINE" minOccurs="0" maxOccurs="unbounded"></xsd:element>
</xsd:sequence>
...
<xsd:complexType name="ZS_EQART_RANGE_LINE">
	<xsd:sequence>
		<xsd:element name="SIGN" type="tns:char1"></xsd:element>
		<xsd:element name="OPTION" type="tns:char2"></xsd:element>
</xsd:sequence>

Therefore I build a nodelist with one node containing following:

<CT_EQART_RANGE><item><SIGN>F</SIGN><OPTION>TT</OPTION></item></CT_EQART_RANGE>

When I call the service with this parameter I receive following error:

Client:Fehler bei der Typumwandlung für Element "CT_EQART_RANGE"

Translation: Type conversion error for element "CT_EQART_RANGE"

Please Help

Ron

1 ACCEPTED SOLUTION
Read only

mvoros
Active Contributor
0 Likes
1,052

Hi,

it looks like type for SAP range but the fields LOW and HIGH are missing. For ranges you can have only I or E for sign and operators like EQ or BT for option. Have you tried with these values?

Cheers

8 REPLIES 8
Read only

mvoros
Active Contributor
0 Likes
1,053

Hi,

it looks like type for SAP range but the fields LOW and HIGH are missing. For ranges you can have only I or E for sign and operators like EQ or BT for option. Have you tried with these values?

Cheers

Read only

Former Member
0 Likes
1,052

Yes, you right.

I removed this fields out of my question, because I didn't know that this is a SAP standard range.

But when this is a standard, do you have any code example on your side, to send such SAP range to a web service?

Thanks

Ron

Read only

Former Member
0 Likes
1,052

Please help me.

Can any body tell me how to send a SAP range to SAP using Web-Services?

Thanks

Ron

Read only

0 Likes
1,052

Hi,

you can find how ranges work in ABAP [here|http://help.sap.com/saphelp_470/helpdata/en/9f/dba71f35c111d1829f0000e829fbfe/content.htm]. That tells you allowed values in each field. What's complete definition for type ZS_EQART_RANGE_LINE? You did not paste full definition.

Cheers

Read only

Former Member
0 Likes
1,052

Sorry,

I didn't know that this was necessary to find a solution.

Here are the definition out of the WSDL File:

<xsd:complexType name="ZS_EQART_RANGE_LINE">
	<xsd:sequence>
		<xsd:element name="SIGN" type="tns:char1"/>
		<xsd:element name="OPTION" type="tns:char2"/>
		<xsd:element name="LOW" type="tns:char10"/>
		<xsd:element name="HIGH" type="tns:char10"/>
	</xsd:sequence>
</xsd:complexType>

Thanks for Help

Ron

Read only

0 Likes
1,052

Hi,

so I was right. It's a range. I already gave you a link which describes how ranges work in ABAP. What values do you want to pass to your web service?

Cheers

Read only

Former Member
0 Likes
1,052

I will send following values:

Sign="I"

Option="EQ"

Low="We100"

High=""

I'm still receiving the error message: Client:Fehler bei der Typumwandlung für Element "CT_EQART_RANGE"

Ron

Read only

0 Likes
1,052

Hi,

it looks OK. Only one comment. The type EQART does not allow to have lower case characters. Have you tried with WE100?

Cheers