September 19, 2007

Calling an SAP Function Module from Java

To call an SAP function module from a Java application, you first need SAP JCo (Java Connector); you can download it from SAP’s site, though you need an account to do so. To actually open the connection, use the tip code shown here. Class jcoClass = Class.forName(“com.sap.mw.jco.JCO”, true, this.getClass().getClassLoader());Client client

Insert an XML Schema into an XQuery Query

Use the following code to insert an XML Schema into an XQuery query. The following code assumes that the XML Schema is: file:///C://Data_Local//xml//docs//AirWings_xslt_xmlschema.xsd and the XML file is: file:///C://Data_Local//xml//docs//AirWings_xpath_xslt.xml Import the schema default element namespace “” at: file:///C://Data_Local//xml//docs//AirWings_xslt_xmlschema.xsd Here’s the code: declare variable $xml as schema-element(xml_root_element) := doc(file:///C://Data_Local//xml//docs//AirWings_xpath_xslt.xml)/*;for $a in

Show() vs. ShowDialog() in .NET

The form class’ ShowDialog method functions differently than its Show method. Here’s how: ShowDialog‘s returned value can be used to determine how the user closed the form (using the DialogResult property). ShowDialog does not call the Dispose method automatically on its close. However, Show, when modeless, does dispose upon close.