Previous     Contents     Index     DocHome     Next     
iPlanet Application Server Enterprise Connector for R/3 Developer's Guide



Chapter 3   Programming Examples


This chapter describes the procedure for acquiring UIF objects and executing function objects.

The iPlanet Application Server Enterprise Connector for SAP R/3 is used to execute SAP R/3 functions on a remote SAP R/3 server. The servlet uses the SAP R/3 connector to access the SAP R/3 server.

This chapter contains the following sections:



Data Objects

Data objects represent data in a hierarchal fashion; circular references are not allowed. iPlanet Application Server Enterprise Connector for SAP R/3 prevents a data object being used as an attribute of itself. Indirect circular references are not checked by iPlanet Application Server for SAP R/3.


Caution

No error message is generated if an indirect circular reference is defined. Unpredictable results occur if a circular reference is used at runtime.



The data objects contain actual data and metadata.

iPlanet Application Server Enterprise Connectors for SAP R/3 allows you to access data through the data object interface. The data object interface:

  • presents a unified representation of backend data types

  • represents complex data

  • supports most common primitive data types.

Data objects are built from primitive types. A primitive data object contains a primitive value; e.g., integer, string. Arrays and structures are complex data objects.

The types of data objects are


Primitive Objects

A primitive data-type object contains a single value of one of the following types

Figure 3-1    Primitive Object



integer, float, double

Integer, float, and double-data type objects hold a value whose type corresponds to the java-data type.

When a primitive data object is assigned to a list, array, or structure, the data object is unwrapped and its value is copied into the list, array or structure. The data object itself is not used. When a primitive value is obtained by using an untyped get-method, such as getField(), getElem(), getAttr(), or getCurrent(), the returned value is wrapped in a primitive data object. In this case, the value is copied, thus, modifying the returned primitive data object does not change the source object.


fixed-length string, variable-length string

Strings correspond to the java-string data type A fixed-length string has a maximum length, whereas a variable-length string has no restrictions on its length.


fixed-size byte array, variable-size byte array

A fixed-size byte array has a maximum size, whereas a variable-size byte array has no restriction on its size.

When a new value replaces an old value, the old value is released. Thus, when a new value is assigned to a variable-length string or a variable-size byte array, the old value is released. When a new value is assigned to a fixed-length string or a fixed-size byte array, the new value is copied over the old one. In the case of a fixed-length string, the copied string is truncated to fit if necessary. In the case of a fixed-size byte array, a shorted array is zero filled on the right and a longer array is truncated to fit.

The maximum length of a fixed-length string and the maximum size of a fixed-size byte array are set when the string's initial value is specified; i.e. four characters in the following example;

list.addElemGString("abcd")

If a five character value is used, the value is truncated to four characters by dropping the fifth character.


Structure Objects

Structure objects contain other data objects or primitive values as fields. Each object within the structure object is referred to by a string that represents the field name. Field names have a maximum length of 32 characters. A structure's fields are heterogeneous.

Figure 3-2    Structure Object



Array Objects

An array object contains data objects or primitive values as elements in the object. array objects inherit from list objects. The difference between an array object and a list object is that the array's elements must be homogeneous. Each element within the array object is referred to by an integer that specifies its position in the array object.

Figure 3-3    Array Object



Type Information Objects

Type information objects are structured objects that contain the type information of a data object; i.e. a type information object might define the fields in a structure and their corresponding data types. Instances of data objects can be created of type information objects. Each of these instances contain a reference to a type of information object. Numerous data types can share the same type information object.

Table 3-1 Type Information Objects

DataObjectInfo Type

Target Object

IBSPDataObjectPrimitiveInfo describes the type number, size of value (if type is string or binary), and the default value.  

IBSPDataObjectPrimitive  

IBSPDataObjectStructureInfo describes the type info of all fields of the target structure. The type info of each field is in turn described by a type info object.  

IBSPDataObjectStructure  

IBSPDataObjectListInfo describes the initial capacity and maximal element count of the target list.  

IBSPDataObjectList  

IBSPDataObjectArrayInfo describes the initial capacity, maximal element count and the type info of elements of the target array.  

IBSPDataObjectArray  


API Naming Conventions

Methods in the API conform to a naming convention that specifies

  • operation

  • target

  • type

In the following example of the form <operation><target><type>:

getElemString()

get is the operation, Elem is the target, and String is the type.


Operation

There are many types of operations but the two most commonly used are


Target

The targets are

  • None (primitive)

  • Attr (complex DataObject such as a list, array, or structure) that uses path to address attribute.

  • Elem (list/array) uses index to address element

  • Field (structure) that uses name to address field

  • Current (itr) addresses object iterator is currently on


Type

The types of operations are

  • Int

  • Float

  • Double

  • String

  • FString

  • Binary

  • VBinary

  • DataObject

  • None


Attributes and Paths

In the API, methods of the IBSPDataObject interface do not distinguish between an element in an array and a field in a structure. In this case the element or field is referred to as an attribute.

The path to an element is its element number, beginning from zero. The path to a field is its field name.You may combine element numbers and field names to create paths to attributes in complex data objects, such as a field of a structure that contains a list of elements. In this case, you specify the path as the individual attributes separated by periods (.); i.e. use "field1.[01]" to identify the first element of a list at field1 in the structure.


Changing Data Types

If an attribute's type is primitive, it can not change. For example, the following code causes an error because it tries to change the type of a primitive from an integer to a float: Code Example 3-1 Changing Data Types


list.addElemInt (100) ; // assume 100 is added to element 1

list.setElemFloat (1, 3.14) ; // fails because the type of element is int

You can change the data type of non-primitive, as in the following example:

list.addElemDataObject (aStruct) ; // add a structure is to element 1

list.setElemDataObject (1, array) ; // change to array succeeds




Working with Servlet Samples



To execute a SAP R/3 transaction from a servlet, your servlet must perform the following generalized actions:

  1. Acquire the UIF Runtime Object

  2. Create the Service Provider Object

  3. Create the Function Object

  4. Setting Up and Executing the Function Object

    The following examples show specifically how to carry out these actions.


Acquire the UIF Runtime Object

The runtime object is the entry point into UIF. It is both the object factory and the access point for creating other objects.

The following is an example of how to acquire a runtime object. Code Example 3-2 Acquiring the UIF Runtime Object

private IBSPRuntime getRuntime()

{

   com.kivasoft.IContext _ctx =

   ((com.netscape.server.servlet.platformhttp.PlatformServletContext)

      getServletContext()).getContext();

   IBSPRuntime ibspruntime = access_cBSPRuntime.getcBSPRuntime
         (_ctx, null, null);

   return ibspruntime;   

}



Create the Service Provider Object

The service provider is the logical representation of a connection to a backend system. Typically, the service provider is not bound to a physical connection until it is absolutely necessary. A service provider must be enabled before it can be used.


Detailed Description of Service Provider

A service-provider type represents a connection to a backend SAP R/3 system. It contains configuration information such as the kinds of data required to create a connection, e.g., host, port, user name, and password.

A service-provider type may also specify additional information required to manage a connection.

The following diagram shows the parts of a service provider type.

Figure 3-4    Service Provider Types


Table 3-2 Service Provider Type

Type

Definition

Client  

Name of Client  

Password  

Password  

Language  

Language, i.e Type EN if you want English.  

UserName  

User Name  

GatewayHost  

Gateway Host name  

GatewayService  

Gateway Service name  

HostName  

Host machine name of the target machine  

Destination  

Not for user use (must be null)  

GroupName  

Name of the specific group of application servers. For load-balancing only.  

MsgServer  

Host name of the message server. For load-balancing connection only.  

SystemName  

R/3 system name. For load-balancing connection only.  

SystemNo  

system number  

load_balancing  

Connect with: 1 - load, 0 connect without load  

maxTime  

Not used  

sapTrace  

Set SAP trace level, 1 - trace, 0 - without trace  

WebUserId  

Is mapped to UserName and Password.  

 

 

 

 

 

 

The following is an example of how to create a service provider object.

Code Example 3-3 Creating the Service Provider Object


private IBSPServiceProvider getServiceProvider(IBSPRuntime runtime)

{

   deb.println("Before createServiceProvider()");

   if (runtime != null)

      return runtime.createServiceProvider("SAP", "connection");

   else

      deb.println("runtime is null");

   return null;

}


Parameter

Definition

SAP

Data source name

connection

Service provider name


Create the Function Object

A function object is a group of related operations that share a common state. In iPlanet Application Server for SAP R/3, a function object needs to be set up and associated with a service provider before the function object can be executed.

The following diagram shows the function object type.

Figure 3-5    Function Object Type

The following is an example of how to create a function object. Code Example 3-4 Creating the Function Object

IBSPFunctionObject fn = null;

...
if(   runtime != null )

{

   deb.println("Before getServiceProvider()");

   sp = getServiceProvider(runtime);

   deb.println("After getServiceProvider()");

   if( sp != null )

   {

      deb.println("Before createFunctionObject()");

      fn = runtime.createFunctionObject("SAP", "BAPI_EMPLOYEE_GETLIST");

   }
}


Parameter

Definition

SAP

Data source name

BAPI_EMPLOYEE_GETLIST

SAP RFC function name


Note Commit and roll-back functions should be examined carefully when you change versions. Make sure to check SAP R/3 documentation concerning the Commit function. See SAP release notes number 0131838, dated Feb. 11, 2000, and 0192235 BAPIs .



"> Setting Up and Executing the Function Object


Note Commit and roll-back functions should be examined carefully when you change versions. Make sure to check SAP R/3 documentation concerning the Commit function. See SAP release notes number 0131838, dated Feb. 11, 2000, and 0192235 BAPIs .





  1. Specify and enable the service provider to use

  2. Prepare the function object, set up the propertySet, and set up the input parameters in the function object's data block.

  3. Execute the function object.

  4. Retrieve the output parameters from the function block.

  5. Disable the service provider.

The following is an example of how to set up and execute a data object. Code Example 3-5 Setting Up and Executing the Function Object

public void execute () throws Exception, BspException

{

      IBSPFunctionObject fn = null;

      IBSPDataObject data = null, prop = null;

IBSPServiceProvider sp=null;

   int hr = 1;

try

{

      IBSPRuntime runtime = getRuntime();

      if(   runtime != null )

      {

         sp = getServiceProvider(runtime);

         if( sp != null )

         {

            fn = runtime.createFunctionObject("SAP", "BAPI_EMPLOYEE_GETLIST");

            hr = sp.enable();

            if(hr!=0)

               return;

          if( fn != null )

            {

               hr = fn.useServiceProvider(sp);

               if(hr!=0)

                  return;

               hr = fn.prepare("Execute");

               if(hr!=0)

                  return;

               data = fn.getDataBlock();

               if( data != null )

                  setInputData(data);

               prop = fn.getProperties();

               if( prop != null )

                  setInputProperties(prop);

hr = fn.execute();

               if( hr == 0 )

               {

                  data = fn.getDataBlock();

                  if(data != null )

                     getOutputData(data);

                  prop = fn.getProperties();

                  if(prop != null)

                     getOutputProperties(prop);

               } // if(hr == 0)

               else

                   deb.println("Execute Failed");

            } // if(fn != null)

            else

               deb.println("Create function object Failed");

         } // if( sp != null )

         else

            deb.println("Create service provider Failed");

         hr = sp.disable();

      }

      else

         deb.println("Create runtime Failed");

}

catch(BspException BspError)

{

.

.

.




Samples




Activation

The SAP Samples consist of servlets which activate SAP R/3 programs that access SAP database.


Running the SAP Samples on NT

  1. Select Programs>iPlanet Application Server 6.0>iAS for SAP-R3 6.0 Worker

  1. Select Programs>iPlanet Application Server 6.0>iAS for SAP-R3 6.0 Sample Applications.

The SAP R/3 Samples is displayed with links.

  1. Click on the link "To Start The Get Customer Details Demo" to activate the sample.


Running the SAP Samples on Solaris

<ias directory>/ias/APPS/bin/startsapworker.sh start

Run this script before running the samples.


BAPI_CUSTOMER_GETDETAIL SAMPLE



Note Make sure you have started the sapworker by running the command:

startsapworker:sh start (on Solaris)

or

run the starsapworker.bat (on NT)




Activating the BAPI_CUSTOMER_GETDETAIL Sample

  1. Click on the sample link, the StartForm is displayed with the customer. The default customer number is 1000. You can use this or type in another valid customer number.

  2. The following form is displayed with the customer details.


Code Samples

The following are the code examples for the BAPI_CUSTOMER_GETDETAIL sample.

Code Example 3-6 startForm.jsp

<HTML>

<HEAD>

   <TITLE>BAPI_CUSTOMER_GETDETAIL Demo</TITLE>

</HEAD>

<BODY>

<center>

<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="600" >

   <tr>

   <td VALIGN=TOP WIDTH="420" >

   <form action="/NASApp/BAPI_CUSTOMER_GETDETAIL/main" method=get>

   <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=6 WIDTH="100%">

      <tr>

         <td BGCOLOR="#8979C8">

            <b><font face="sans-serif,arial,helvetica" color=white>

            BAPI_CUSTOMER_GETDETAIL Start Form</font></b>

         </td>

      </tr>

      <tr VALIGN=TOP>

         <td BGCOLOR="#666699">

         <p>

         <center>

         <TABLE BORDER=0 cellspacing=0 cellpadding=0>

            <tr>

               <td><font face="arial, helvetica, sans-serif" color=white size="-1">CUSTOMERNO:</font></td>

               <td><font face="arial, helvetica, sans-serif">

                   <input type="text" name="INPUT.CUSTOMERNO" size=20 maxsize=50 value="0000001000" ></font>

               </td>

            </tr>

            <tr>

               <td><font face="arial, helvetica, sans-serif" color=white size="-1">PI_DISTR_CHAN:</font></td>

               <td><font face="arial, helvetica, sans-serif">

                   <input type="text" name="INPUT.PI_DISTR_CHAN" size=20 maxsize=50></font>

               </td>

            </tr>

            <tr>

               <td><font face="arial, helvetica, sans-serif" color=white size="-1">PI_DIVISION:</font></td>

               <td><font face="arial, helvetica, sans-serif">

                   <input type="text" name="INPUT.PI_DIVISION" size=20 maxsize=50></font>

               </td>

            </tr>

            <tr>

               <td><font face="arial, helvetica, sans-serif" color=white size="-1">PI_SALESORG:</font></td>

               <td><font face="arial, helvetica, sans-serif">

                   <input type="text" name="INPUT.PI_SALESORG" size=20 maxsize=50></font>

               </td>

            </tr>

         </TABLE>

         </center>

         </td>

      </tr>

   </TABLE>

   <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" >

   <tr>

      <td BGCOLOR="#666699" >

         <TABLE>

            <tr>

               <td valign=top ><input type="submit" name="execute" value="EXECUTE">

               </td>

            </tr>

         </TABLE>

      </td>

   </tr>

</TABLE>

</form>

</td>

</tr>

</TABLE>

<!--#include file="Copyright.jsp" -->

</center>

</BODY>

</HTML>


Code Example 3-7 endForm.jsp



<%

String FORM_OF_AD1 = "";

Object obj1 = request.getAttribute("OUTPUT.PE_ADDRESS.FORM_OF_AD");
/** get the error message from the request attributes **/
if (obj1 != null) {
   FORM_OF_AD1= (String) obj1;
}

%>
<%

String FIRST_NAME2 = "";

Object obj2 = request.getAttribute("OUTPUT.PE_ADDRESS.FIRST_NAME");
/** get the error message from the request attributes **/
if (obj2 != null) {
   FIRST_NAME2= (String) obj2;
}

%>
<%

String NAME3 = "";

Object obj3 = request.getAttribute("OUTPUT.PE_ADDRESS.NAME");
/** get the error message from the request attributes **/
if (obj3 != null) {
   NAME3= (String) obj3;
}

%>
<%

String NAME_34 = "";

Object obj4 = request.getAttribute("OUTPUT.PE_ADDRESS.NAME_3");
/** get the error message from the request attributes **/
if (obj4 != null) {
   NAME_34= (String) obj4;
}

%>
<%

String NAME_45 = "";

Object obj5 = request.getAttribute("OUTPUT.PE_ADDRESS.NAME_4");
/** get the error message from the request attributes **/
if (obj5 != null) {
   NAME_45= (String) obj5;
}

%>
<%

String DATE_BIRTH6 = "";

Object obj6 = request.getAttribute("OUTPUT.PE_ADDRESS.DATE_BIRTH");
/** get the error message from the request attributes **/
if (obj6 != null) {
   DATE_BIRTH6= (String) obj6;
}

%>
<%

String STREET7 = "";

Object obj7 = request.getAttribute("OUTPUT.PE_ADDRESS.STREET");
/** get the error message from the request attributes **/
if (obj7 != null) {
   STREET7= (String) obj7;
}

%>
<%

String POSTL_CODE8 = "";

Object obj8 = request.getAttribute("OUTPUT.PE_ADDRESS.POSTL_CODE");
/** get the error message from the request attributes **/
if (obj8 != null) {
   POSTL_CODE8= (String) obj8;
}

%>
<%

String CITY9 = "";

Object obj9 = request.getAttribute("OUTPUT.PE_ADDRESS.CITY");
/** get the error message from the request attributes **/
if (obj9 != null) {
   CITY9= (String) obj9;
}

%>
<%

String REGION10 = "";

Object obj10 = request.getAttribute("OUTPUT.PE_ADDRESS.REGION");
/** get the error message from the request attributes **/
if (obj10 != null) {
   REGION10= (String) obj10;
}

%>
<%

String COUNTRY11 = "";

Object obj11 = request.getAttribute("OUTPUT.PE_ADDRESS.COUNTRY");
/** get the error message from the request attributes **/
if (obj11 != null) {
   COUNTRY11= (String) obj11;
}

%>
<%

String COUNTRNISO12 = "";

Object obj12 = request.getAttribute("OUTPUT.PE_ADDRESS.COUNTRNISO");
/** get the error message from the request attributes **/
if (obj12 != null) {
   COUNTRNISO12= (String) obj12;
}

%>
<%

String COUNTRAISO13 = "";

Object obj13 = request.getAttribute("OUTPUT.PE_ADDRESS.COUNTRAISO");
/** get the error message from the request attributes **/
if (obj13 != null) {
   COUNTRAISO13= (String) obj13;
}

%>
<%

String INTERNET14 = "";

Object obj14 = request.getAttribute("OUTPUT.PE_ADDRESS.INTERNET");
/** get the error message from the request attributes **/
if (obj14 != null) {
   INTERNET14= (String) obj14;
}

%>
<%

String FAX_NUMBER15 = "";

Object obj15 = request.getAttribute("OUTPUT.PE_ADDRESS.FAX_NUMBER");
/** get the error message from the request attributes **/
if (obj15 != null) {
   FAX_NUMBER15= (String) obj15;
}

%>
<%

String TELEPHONE16 = "";

Object obj16 = request.getAttribute("OUTPUT.PE_ADDRESS.TELEPHONE");
/** get the error message from the request attributes **/
if (obj16 != null) {
   TELEPHONE16= (String) obj16;
}

%>
<%

String TELEPHONE217 = "";

Object obj17 = request.getAttribute("OUTPUT.PE_ADDRESS.TELEPHONE2");
/** get the error message from the request attributes **/
if (obj17 != null) {
   TELEPHONE217= (String) obj17;
}

%>
<%

String LANGU18 = "";

Object obj18 = request.getAttribute("OUTPUT.PE_ADDRESS.LANGU");
/** get the error message from the request attributes **/
if (obj18 != null) {
   LANGU18= (String) obj18;
}

%>
<%

String LANGU_ISO19 = "";

Object obj19 = request.getAttribute("OUTPUT.PE_ADDRESS.LANGU_ISO");
/** get the error message from the request attributes **/
if (obj19 != null) {
   LANGU_ISO19= (String) obj19;
}

%>
<%

String CURRENCY20 = "";

Object obj20 = request.getAttribute("OUTPUT.PE_ADDRESS.CURRENCY");
/** get the error message from the request attributes **/
if (obj20 != null) {
   CURRENCY20= (String) obj20;
}

%>
<%

String CURRENCY_ISO21 = "";

Object obj21 = request.getAttribute("OUTPUT.PE_ADDRESS.CURRENCY_ISO");
/** get the error message from the request attributes **/
if (obj21 != null) {
   CURRENCY_ISO21= (String) obj21;
}

%>
<%

String TYPE22 = "";

Object obj22 = request.getAttribute("OUTPUT.RETURN.TYPE");
/** get the error message from the request attributes **/
if (obj22 != null) {
   TYPE22= (String) obj22;
}

%>
<%

String CODE23 = "";

Object obj23 = request.getAttribute("OUTPUT.RETURN.CODE");
/** get the error message from the request attributes **/
if (obj23 != null) {
   CODE23= (String) obj23;
}

%>
<%

String MESSAGE24 = "";

Object obj24 = request.getAttribute("OUTPUT.RETURN.MESSAGE");
/** get the error message from the request attributes **/
if (obj24 != null) {
   MESSAGE24= (String) obj24;
}

%>
<%

String LOG_NO25 = "";

Object obj25 = request.getAttribute("OUTPUT.RETURN.LOG_NO");
/** get the error message from the request attributes **/
if (obj25 != null) {
   LOG_NO25= (String) obj25;
}

%>
<%

String LOG_MSG_NO26 = "";

Object obj26 = request.getAttribute("OUTPUT.RETURN.LOG_MSG_NO");
/** get the error message from the request attributes **/
if (obj26 != null) {
   LOG_MSG_NO26= (String) obj26;
}

%>
<%

String MESSAGE_V127 = "";

Object obj27 = request.getAttribute("OUTPUT.RETURN.MESSAGE_V1");
/** get the error message from the request attributes **/
if (obj27 != null) {
   MESSAGE_V127= (String) obj27;
}

%>
<%

String MESSAGE_V228 = "";

Object obj28 = request.getAttribute("OUTPUT.RETURN.MESSAGE_V2");
/** get the error message from the request attributes **/
if (obj28 != null) {
   MESSAGE_V228= (String) obj28;
}

%>
<%

String MESSAGE_V329 = "";

Object obj29 = request.getAttribute("OUTPUT.RETURN.MESSAGE_V3");
/** get the error message from the request attributes **/
if (obj29 != null) {
   MESSAGE_V329= (String) obj29;
}

%>
<%

String MESSAGE_V430 = "";

Object obj30 = request.getAttribute("OUTPUT.RETURN.MESSAGE_V4");
/** get the error message from the request attributes **/
if (obj30 != null) {
   MESSAGE_V430= (String) obj30;
}

%>
<HTML>
<HEAD>
   <TITLE>BAPI_CUSTOMER_GETDETAIL Demo</TITLE>
</HEAD>
<BODY>
<center>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="600" >
   <tr>
   <td VALIGN=TOP WIDTH="420" >

   <form action="/NASApp/BAPI_CUSTOMER_GETDETAIL/main" method=get>
   <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=6 WIDTH="100%">
      <tr>
         <td BGCOLOR="#8979C8">
            <b><font face="sans-serif,arial,helvetica" color=white>
            BAPI_CUSTOMER_GETDETAIL End Form</font></b>
         </td>
      </tr>
      <tr VALIGN=TOP>
         <td BGCOLOR="#666699">
         <p>
         <center>
         <TABLE BORDER=0 cellspacing=0 cellpadding=0>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">FORM_OF_AD:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.FORM_OF_AD" value="<%=FORM_OF_AD1%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">FIRST_NAME:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.FIRST_NAME" value="<%=FIRST_NAME2%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">NAME:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.NAME" value="<%=NAME3%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">NAME_3:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.NAME_3" value="<%=NAME_34%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">NAME_4:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.NAME_4" value="<%=NAME_45%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">DATE_BIRTH:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.DATE_BIRTH" value="<%=DATE_BIRTH6%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">STREET:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.STREET" value="<%=STREET7%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">POSTL_CODE:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.POSTL_CODE" value="<%=POSTL_CODE8%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">CITY:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.CITY" value="<%=CITY9%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">REGION:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.REGION" value="<%=REGION10%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">COUNTRY:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.COUNTRY" value="<%=COUNTRY11%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">COUNTRNISO:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.COUNTRNISO" value="<%=COUNTRNISO12%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">COUNTRAISO:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.COUNTRAISO" value="<%=COUNTRAISO13%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">INTERNET:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.INTERNET" value="<%=INTERNET14%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">FAX_NUMBER:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.FAX_NUMBER" value="<%=FAX_NUMBER15%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">TELEPHONE:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.TELEPHONE" value="<%=TELEPHONE16%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">TELEPHONE2:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.TELEPHONE2" value="<%=TELEPHONE217%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">LANGU:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.LANGU" value="<%=LANGU18%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">LANGU_ISO:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.LANGU_ISO" value="<%=LANGU_ISO19%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">CURRENCY:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.CURRENCY" value="<%=CURRENCY20%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">CURRENCY_ISO:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.PE_ADDRESS.CURRENCY_ISO" value="<%=CURRENCY_ISO21%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">TYPE:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.RETURN.TYPE" value="<%=TYPE22%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">CODE:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.RETURN.CODE" value="<%=CODE23%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">MESSAGE:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.RETURN.MESSAGE" value="<%=MESSAGE24%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">LOG_NO:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.RETURN.LOG_NO" value="<%=LOG_NO25%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">LOG_MSG_NO:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.RETURN.LOG_MSG_NO" value="<%=LOG_MSG_NO26%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">MESSAGE_V1:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.RETURN.MESSAGE_V1" value="<%=MESSAGE_V127%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">MESSAGE_V2:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.RETURN.MESSAGE_V2" value="<%=MESSAGE_V228%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">MESSAGE_V3:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.RETURN.MESSAGE_V3" value="<%=MESSAGE_V329%>" size=20 maxsize=50></font>
               </td>
            </tr>
            <tr>
               <td><font face="arial, helvetica, sans-serif" color=white size="-1">MESSAGE_V4:</font></td>
               <td><font face="arial, helvetica, sans-serif">
                   <input type="text" name="OUTPUT.RETURN.MESSAGE_V4" value="<%=MESSAGE_V430%>" size=20 maxsize=50></font>
               </td>
            </tr>
         </TABLE>
         </center>
         </td>
      </tr>
</TABLE>
</form>
</td>
</tr>
</TABLE>
<!--#include file="Copyright.jsp" -->
</center>
</BODY>
</HTML>





Code Example 3-8 Execute.java

package BAPI_CUSTOMER_GETDETAIL;

import java.io.*;

import java.util.*;

import javax.naming.*;

import netscape.bsp.*;

import netscape.bsp.runtime.*;

import netscape.bsp.dataobject.*;

public class Execute

{

   private TestDebug deb = new TestDebug("Execute");

   public com.kivasoft.IContext _ctx=null;

   //SELECTED OPERATION

   public String DataSourceName="";

   public String FunctionName="";

   public String ServiceProviderName="";

   public String OperationName="";

   public String PropertiesPath="";

   //DATA

   public class cINPUT

   {

      public String CUSTOMERNO = null;

      public String PI_DISTR_CHAN = null;

      public String PI_DIVISION = null;

      public String PI_SALESORG = null;

   }

   public cINPUT INPUT=new cINPUT();

   public class cOUTPUT

   {

      public class cPE_ADDRESS

      {

         public String FORM_OF_AD = null;

         public String FIRST_NAME = null;

         public String NAME = null;

         public String NAME_3 = null;

         public String NAME_4 = null;

         public String DATE_BIRTH = null;

         public String STREET = null;

         public String POSTL_CODE = null;

         public String CITY = null;

         public String REGION = null;

         public String COUNTRY = null;

         public String COUNTRNISO = null;

         public String COUNTRAISO = null;

         public String INTERNET = null;

         public String FAX_NUMBER = null;

         public String TELEPHONE = null;

         public String TELEPHONE2 = null;

         public String LANGU = null;

         public String LANGU_ISO = null;

         public String CURRENCY = null;

         public String CURRENCY_ISO = null;

      }

      public cPE_ADDRESS PE_ADDRESS=new cPE_ADDRESS();

      public class cRETURN

      {

         public String TYPE = null;

         public String CODE = null;

         public String MESSAGE = null;

         public String LOG_NO = null;

         public String LOG_MSG_NO = null;

         public String MESSAGE_V1 = null;

         public String MESSAGE_V2 = null;

         public String MESSAGE_V3 = null;

         public String MESSAGE_V4 = null;

      }

      public cRETURN RETURN=new cRETURN();

   }

   public cOUTPUT OUTPUT=new cOUTPUT();

   public class cPropertySet

   {

      public class cSapProperties

      {

         public Integer AutoCommitProperty = null;

         public String RFCName = null;

      }

      public cSapProperties SapProperties=new cSapProperties();

   }

   public cPropertySet PropertySet=new cPropertySet();

   public Execute(String path) throws Exception,BspException

   {

      //read properties file

      PropertiesPath=path;

      FileInputStream propertiesFile=new FileInputStream(PropertiesPath+"//BAPI_CUSTOMER_GETDETAIL//Execute.properties" );

      Properties properties=new Properties();

      properties.load(propertiesFile);

      FunctionName= properties.getProperty("FunctionName");

      deb.println("FunctionName="+FunctionName);

      OperationName= properties.getProperty("OperationName");

      deb.println("OperationName="+OperationName);

      String LocalServiceProviderName= properties.getProperty("LocalServiceProviderName");

      deb.println("LocalServiceProviderName="+LocalServiceProviderName);

      FileInputStream sp_propertiesFile=new FileInputStream(PropertiesPath+"//"+LocalServiceProviderName+".properties");

      Properties sp_properties=new Properties();

      sp_properties.load(sp_propertiesFile);

      DataSourceName= sp_properties.getProperty("DataSourceName");

      deb.println("DataSourceName="+DataSourceName);

      ServiceProviderName= sp_properties.getProperty("ServiceProviderName");

      deb.println("ServiceProviderName="+ServiceProviderName);

   }

   private IBSPRuntime getRuntime() throws BspException

   {

      deb.println(" before access_cBSPRuntime.getcBSPRuntime ");

      IBSPRuntime ibspruntime = access_cBSPRuntime.getcBSPRuntime(_ctx, null, null);

      deb.println(" after access_cBSPRuntime.getcBSPRuntime ");

      return ibspruntime;

   }

   private IBSPServiceProvider getServiceProvider(IBSPRuntime runtime) throws BspException

   {

      deb.println("Before createServiceProvider()");

      if (runtime != null)

         return runtime.createServiceProvider(DataSourceName, ServiceProviderName);

      else

         deb.println("runtime is null");

      return null;

   }

   public void execute () throws Exception, BspException

   {

      IBSPFunctionObject fn = null;

      IBSPDataObject data = null, prop = null;

IBSPServiceProvider sp=null;

    int hr = 1;

try

{

      deb.println("Before sendRequest ");

      deb.println(" Before getRuntime()");

      IBSPRuntime runtime = getRuntime();

      deb.println("After getRuntime()");

      if(   runtime != null )

      {

         deb.println("Before getServiceProvider()");

         sp = getServiceProvider(runtime);

         deb.println("After getServiceProvider()");

         if( sp != null )

         {

            deb.println("Before createFunctionObject()");

            fn = runtime.createFunctionObject(DataSourceName, FunctionName);

            deb.println("After createFunctionObject()");

            hr = sp.enable();

            deb.println("After enable(), hr = "+hr);

            if(hr!=0)

               return;

            deb.println("After enable(), hr = "+hr);

            if( fn != null )

            {

               hr = fn.useServiceProvider(sp);

               deb.println("After useServiceProvider(), hr = "+hr);

               if(hr!=0)

                  return;

               hr = fn.prepare(OperationName);

               deb.println("After prepare(), hr = "+hr);

               if(hr!=0)

                  return;

               data = fn.getDataBlock();

               deb.println("After getDataBlock()");

               if( data != null )

                  setInputData(data);

               prop = fn.getProperties();

               deb.println("After getProperties()");

               if( prop != null )

                  setInputProperties(prop);

               deb.println("Before execute()");

               hr = fn.execute();

               deb.println("After execute(), hr = "+hr);

               if( hr == 0 )

               {

                  data = fn.getDataBlock();

                  deb.println("After getDataBlock()");

                  if(data != null )

                     getOutputData(data);

                  prop = fn.getProperties();

                  deb.println("After getProperties()");

                  if(prop != null)

                     getOutputProperties(prop);

               } // if(hr == 0)

               else

                   deb.println("Execute Failed");

            } // if(fn != null)

            else

               deb.println("Create function object Failed");

         } // if( sp != null )

         else

            deb.println("Create service provider Failed");

         hr = sp.disable();

         deb.println("After disable(), hr = "+hr);

      }

      else

         deb.println("Create runtime Failed");

      deb.println("after sendRequest ");

}

catch(BspException BspError)

{

if(sp!=null)

{

hr = sp.disable();

          deb.println("After disable(), hr = "+hr);

}

throw (BspError);

}

catch(Exception ex)

{

if(sp!=null)

{

hr = sp.disable();

          deb.println("After disable(), hr = "+hr);

}

throw (ex);

}

      return;

   }

   public void setInputData(IBSPDataObject data) throws BspException

   {

      if(INPUT.CUSTOMERNO != null)

         data.setAttrFString("INPUT.CUSTOMERNO",INPUT.CUSTOMERNO);

      if(INPUT.PI_DISTR_CHAN != null)

         data.setAttrFString("INPUT.PI_DISTR_CHAN",INPUT.PI_DISTR_CHAN);

      if(INPUT.PI_DIVISION != null)

         data.setAttrFString("INPUT.PI_DIVISION",INPUT.PI_DIVISION);

      if(INPUT.PI_SALESORG != null)

         data.setAttrFString("INPUT.PI_SALESORG",INPUT.PI_SALESORG);

   }

   public void getOutputData(IBSPDataObject data) throws BspException

   {

      OUTPUT.PE_ADDRESS.FORM_OF_AD = data.getAttrFString("OUTPUT.PE_ADDRESS.FORM_OF_AD");

      OUTPUT.PE_ADDRESS.FIRST_NAME = data.getAttrFString("OUTPUT.PE_ADDRESS.FIRST_NAME");

      OUTPUT.PE_ADDRESS.NAME = data.getAttrFString("OUTPUT.PE_ADDRESS.NAME");

      OUTPUT.PE_ADDRESS.NAME_3 = data.getAttrFString("OUTPUT.PE_ADDRESS.NAME_3");

      OUTPUT.PE_ADDRESS.NAME_4 = data.getAttrFString("OUTPUT.PE_ADDRESS.NAME_4");

      OUTPUT.PE_ADDRESS.DATE_BIRTH = data.getAttrFString("OUTPUT.PE_ADDRESS.DATE_BIRTH");

      OUTPUT.PE_ADDRESS.STREET = data.getAttrFString("OUTPUT.PE_ADDRESS.STREET");

      OUTPUT.PE_ADDRESS.POSTL_CODE = data.getAttrFString("OUTPUT.PE_ADDRESS.POSTL_CODE");

      OUTPUT.PE_ADDRESS.CITY = data.getAttrFString("OUTPUT.PE_ADDRESS.CITY");

      OUTPUT.PE_ADDRESS.REGION = data.getAttrFString("OUTPUT.PE_ADDRESS.REGION");

      OUTPUT.PE_ADDRESS.COUNTRY = data.getAttrFString("OUTPUT.PE_ADDRESS.COUNTRY");

      OUTPUT.PE_ADDRESS.COUNTRNISO = data.getAttrFString("OUTPUT.PE_ADDRESS.COUNTRNISO");

      OUTPUT.PE_ADDRESS.COUNTRAISO = data.getAttrFString("OUTPUT.PE_ADDRESS.COUNTRAISO");

      OUTPUT.PE_ADDRESS.INTERNET = data.getAttrFString("OUTPUT.PE_ADDRESS.INTERNET");

      OUTPUT.PE_ADDRESS.FAX_NUMBER = data.getAttrFString("OUTPUT.PE_ADDRESS.FAX_NUMBER");

      OUTPUT.PE_ADDRESS.TELEPHONE = data.getAttrFString("OUTPUT.PE_ADDRESS.TELEPHONE");

      OUTPUT.PE_ADDRESS.TELEPHONE2 = data.getAttrFString("OUTPUT.PE_ADDRESS.TELEPHONE2");

      OUTPUT.PE_ADDRESS.LANGU = data.getAttrFString("OUTPUT.PE_ADDRESS.LANGU");

      OUTPUT.PE_ADDRESS.LANGU_ISO = data.getAttrFString("OUTPUT.PE_ADDRESS.LANGU_ISO");

      OUTPUT.PE_ADDRESS.CURRENCY = data.getAttrFString("OUTPUT.PE_ADDRESS.CURRENCY");

      OUTPUT.PE_ADDRESS.CURRENCY_ISO = data.getAttrFString("OUTPUT.PE_ADDRESS.CURRENCY_ISO");

      OUTPUT.RETURN.TYPE = data.getAttrFString("OUTPUT.RETURN.TYPE");

      OUTPUT.RETURN.CODE = data.getAttrFString("OUTPUT.RETURN.CODE");

      OUTPUT.RETURN.MESSAGE = data.getAttrFString("OUTPUT.RETURN.MESSAGE");

      OUTPUT.RETURN.LOG_NO = data.getAttrFString("OUTPUT.RETURN.LOG_NO");

      OUTPUT.RETURN.LOG_MSG_NO = data.getAttrFString("OUTPUT.RETURN.LOG_MSG_NO");

      OUTPUT.RETURN.MESSAGE_V1 = data.getAttrFString("OUTPUT.RETURN.MESSAGE_V1");

      OUTPUT.RETURN.MESSAGE_V2 = data.getAttrFString("OUTPUT.RETURN.MESSAGE_V2");

      OUTPUT.RETURN.MESSAGE_V3 = data.getAttrFString("OUTPUT.RETURN.MESSAGE_V3");

      OUTPUT.RETURN.MESSAGE_V4 = data.getAttrFString("OUTPUT.RETURN.MESSAGE_V4");

   }

   public void setInputProperties(IBSPDataObject prop) throws BspException

   {

      if(PropertySet.SapProperties.AutoCommitProperty != null)

          prop.setAttrInt("SapProperties.AutoCommitProperty",PropertySet.SapProperties.A utoCommitProperty.intValue());

      if(PropertySet.SapProperties.RFCName != null)

          prop.setAttrFString("SapProperties.RFCName",PropertySet.SapProperties.RFCName) ;

   }

   public void getOutputProperties(IBSPDataObject prop) throws BspException

   {

      PropertySet.SapProperties.AutoCommitProperty = new Integer(prop.getAttrInt("SapProperties.AutoCommitProperty"));

      PropertySet.SapProperties.RFCName = prop.getAttrFString("SapProperties.RFCName");

   }

}


Code Example 3-9 Main.jave

package BAPI_CUSTOMER_GETDETAIL;

import java.util.*;

import javax.servlet.http.*;

import java.io.*;

import javax.servlet.*;

import javax.naming.*;

import netscape.bsp.*;

public class main extends HttpServlet

{

   private TestDebug deb = new TestDebug("BAPI_CUSTOMER_GETDETAIL");

   protected String getInputString(HttpServletRequest   request, String parameterName)

   {

      // This method is useful since getValString returns null on

      // some platforms and an empty string on other platforms for

      // missing input parameters.   It also removes any whitespace

      // characters that the user my have inadvertantly entered.

      String parameter = request.getParameter(parameterName);

      if (parameter != null)

      {

         parameter = parameter.trim();

      }

      else

         deb.println("parameter "+ parameterName+" is null");

      return parameter;

   }

   public void doGet (

    HttpServletRequest   request,

    HttpServletResponse   response ) throws ServletException, IOException

   {

    RequestDispatcher dispatcher;

      try{

       String value;

   

com.kivasoft.IContext _ctx=((com.netscape.server.servlet.platformhttp.PlatformServletContext)getServ letContext()).getContext();

String PropertiesPath=com.kivasoft.util.GX.GDSGetKeyValueString(com.kivasoft.util.GX. GDSRoot(_ctx),

null, "AppPath", null);

deb.println("PropertiesPath="+PropertiesPath);

       Execute obj_Execute=new Execute(PropertiesPath);

       deb.println("after create obj_Execute");

       obj_Execute.INPUT.CUSTOMERNO =getInputString(request,"INPUT.CUSTOMERNO");

       obj_Execute.INPUT.PI_DISTR_CHAN =getInputString(request,"INPUT.PI_DISTR_CHAN");

       obj_Execute.INPUT.PI_DIVISION =getInputString(request,"INPUT.PI_DIVISION");

       obj_Execute.INPUT.PI_SALESORG =getInputString(request,"INPUT.PI_SALESORG");

       deb.println("after set obj_Execute input");

       FileInputStream propertiesFile=new FileInputStream(PropertiesPath+"//BAPI_CUSTOMER_GETDETAIL//Execute_properties. properties");

       Properties properties=new Properties();

       properties.load(propertiesFile);

       value= properties.getProperty("PropertySet.SapProperties.AutoCommitProperty").trim();

       if(value!=null && value.length()>0)

       obj_Execute.PropertySet.SapProperties.AutoCommitProperty=new Integer(value);

       value= properties.getProperty("PropertySet.SapProperties.RFCName").trim();

       if(value!=null && value.length()>0)

       obj_Execute.PropertySet.SapProperties.RFCName=value;

       deb.println("after set obj_Execute properties");

       obj_Execute._ctx=_ctx;

       deb.println("Before sendRequest ");

       obj_Execute.execute();

       deb.println("After sendRequest ");

response.setContentType("text/html");

       dispatcher = getServletContext().getRequestDispatcher("/jsp/endForm.jsp");

       request.setAttribute("OUTPUT.PE_ADDRESS.FORM_OF_AD",obj_Execute.OUTPUT.PE_ADDR ESS.FORM_OF_AD);

       request.setAttribute("OUTPUT.PE_ADDRESS.FIRST_NAME",obj_Execute.OUTPUT.PE_ADDR ESS.FIRST_NAME);

       request.setAttribute("OUTPUT.PE_ADDRESS.NAME",obj_Execute.OUTPUT.PE_ADDRESS.NA ME);

       request.setAttribute("OUTPUT.PE_ADDRESS.NAME_3",obj_Execute.OUTPUT.PE_ADDRESS. NAME_3);

       request.setAttribute("OUTPUT.PE_ADDRESS.NAME_4",obj_Execute.OUTPUT.PE_ADDRESS. NAME_4);

       request.setAttribute("OUTPUT.PE_ADDRESS.DATE_BIRTH",obj_Execute.OUTPUT.PE_ADDR ESS.DATE_BIRTH);

       request.setAttribute("OUTPUT.PE_ADDRESS.STREET",obj_Execute.OUTPUT.PE_ADDRESS. STREET);

       request.setAttribute("OUTPUT.PE_ADDRESS.POSTL_CODE",obj_Execute.OUTPUT.PE_ADDR ESS.POSTL_CODE);

       request.setAttribute("OUTPUT.PE_ADDRESS.CITY",obj_Execute.OUTPUT.PE_ADDRESS.CI TY);

       request.setAttribute("OUTPUT.PE_ADDRESS.REGION",obj_Execute.OUTPUT.PE_ADDRESS. REGION);

       request.setAttribute("OUTPUT.PE_ADDRESS.COUNTRY",obj_Execute.OUTPUT.PE_ADDRESS .COUNTRY);

       request.setAttribute("OUTPUT.PE_ADDRESS.COUNTRNISO",obj_Execute.OUTPUT.PE_ADDR ESS.COUNTRNISO);

       request.setAttribute("OUTPUT.PE_ADDRESS.COUNTRAISO",obj_Execute.OUTPUT.PE_ADDR ESS.COUNTRAISO);

       request.setAttribute("OUTPUT.PE_ADDRESS.INTERNET",obj_Execute.OUTPUT.PE_ADDRES S.INTERNET);

       request.setAttribute("OUTPUT.PE_ADDRESS.FAX_NUMBER",obj_Execute.OUTPUT.PE_ADDR ESS.FAX_NUMBER);

       request.setAttribute("OUTPUT.PE_ADDRESS.TELEPHONE",obj_Execute.OUTPUT.PE_ADDRE SS.TELEPHONE);

       request.setAttribute("OUTPUT.PE_ADDRESS.TELEPHONE2",obj_Execute.OUTPUT.PE_ADDR ESS.TELEPHONE2);

       request.setAttribute("OUTPUT.PE_ADDRESS.LANGU",obj_Execute.OUTPUT.PE_ADDRESS.L ANGU);

       request.setAttribute("OUTPUT.PE_ADDRESS.LANGU_ISO",obj_Execute.OUTPUT.PE_ADDRE SS.LANGU_ISO);

       request.setAttribute("OUTPUT.PE_ADDRESS.CURRENCY",obj_Execute.OUTPUT.PE_ADDRES S.CURRENCY);

       request.setAttribute("OUTPUT.PE_ADDRESS.CURRENCY_ISO",obj_Execute.OUTPUT.PE_AD DRESS.CURRENCY_ISO);

       request.setAttribute("OUTPUT.RETURN.TYPE",obj_Execute.OUTPUT.RETURN.TYPE);

       request.setAttribute("OUTPUT.RETURN.CODE",obj_Execute.OUTPUT.RETURN.CODE);

       request.setAttribute("OUTPUT.RETURN.MESSAGE",obj_Execute.OUTPUT.RETURN.MESSAGE );

       request.setAttribute("OUTPUT.RETURN.LOG_NO",obj_Execute.OUTPUT.RETURN.LOG_NO);

       request.setAttribute("OUTPUT.RETURN.LOG_MSG_NO",obj_Execute.OUTPUT.RETURN.LOG_ MSG_NO);

       request.setAttribute("OUTPUT.RETURN.MESSAGE_V1",obj_Execute.OUTPUT.RETURN.MESS AGE_V1);

       request.setAttribute("OUTPUT.RETURN.MESSAGE_V2",obj_Execute.OUTPUT.RETURN.MESS AGE_V2);

       request.setAttribute("OUTPUT.RETURN.MESSAGE_V3",obj_Execute.OUTPUT.RETURN.MESS AGE_V3);

       request.setAttribute("OUTPUT.RETURN.MESSAGE_V4",obj_Execute.OUTPUT.RETURN.MESS AGE_V4);

       deb.println("after get obj_Execute output");

      }//try.

      catch(BspException BspError)

      {

       deb.println("BspException:"+BspError.getMessage());

response.setContentType("text/html");

       dispatcher = getServletContext().getRequestDispatcher("/jsp/ExceptionForm.jsp");

       request.setAttribute("BspException",BspError.getMessage());

      }

      catch(Exception exception)

      {

       deb.println("Exception:"+exception.toString());

response.setContentType("text/html");

       dispatcher = getServletContext().getRequestDispatcher("/jsp/ExceptionForm.jsp");

       request.setAttribute("Exception",exception.toString());

      }

       dispatcher.include(request, response);

      return;

   }//doGet.

}//main



Previous     Contents     Index     DocHome     Next     
Copyright © 2000 Sun Microsystems, Inc. Some preexisting portions Copyright © 2000 Netscape Communications Corp. All rights reserved.

Last Updated June 08, 2000