Adding an SAP Result Checker

Create or add an SAP result checker when you edit Attribute or Operation properties for a mobile business object derived from an SAP data source under the Definitions tab. You can also configure SAP result checkers when you create an object. You can choose a predefined or a custom SAP result checker, if you have created one.

  1. In the New Attributes or New Operation wizard, in the Result checker section, select from these options:
    Option Description
    Default If there is a RETURN parameter found in the currently selected BAPI operation, this option is automatically selected. This option uses the com.sybase.sap.DefaultSAPResultCheck result checker.
    None If there is not a RETURN field found in the currently selected BAPI operation, this option is automatically selected. This option uses the com.sybase.sap.NoOpSAPResultCheck result checker.
    Custom Select this option to specify a custom SAP result checker.
  2. (Optional) If you have not yet created the result checker classes, then in the Result checker area of the New Attributes or New Operation dialog, select Custom and click Create to run the New Java Class wizard.
  3. If prompted, add a Java nature.
    1. Click Yes to add a Java nature. In Eclipse, a Java nature adds Java-specific behavior to projects. A Java nature is recommended because you are adding a Java class to it. By default Unwired Platform projects do not include all the required behaviors for Java development. In the New Java Class wizard, enter:
      Option Description
      Source Folder By default, this is the Filters folder from your project. Click Browse to locate the source folder for the Java class.
      Package Click Browse to locate the package for the new Java class.
      Note: Sybase recommends that you specify the package and do not leave this field blank as the JDK 1.4 Java class in the default package cannot be resolved in other packages.
      Enclosing type Select to choose a type in which to enclose the new class. You can select either this option or the Package option, above. Either enter a valid name or click Browse.
      Name Enter a name for the SAP result checker class.
      Modifiers Select the Java class modifiers.
      Superclass

      By default, this is filled in with java.lang.Object.


      1. Click Browse.
      2. In the Superclass Selection dialog, enter:
        • Choose a Type
        • Matching Items
      3. Click OK.
      Interfaces By default, this is populated with the com.sybase.sap.SAPResultChecker interface. Click Add to select interfaces implemented by the new class.
      Which Method Stubs Would You Like to Create
      • Public Static Void Main
      • Constructors From Superclass
      • Inherited Abstract Methods
      Do You Want to Add Comments Select Generate Comments to add comments.
      Note: If you set the Java project compiler compliance level to later than 1.4, you receive comments about missing classes. Set the Java project compiler compliance level to 1.4 or earlier. Java projects that are configured to compile with a compiler compliance level later than 1.4, have a known issue, where Java files referring to the RIM API have missing class errors.
      Note: The wizard generates a skeleton Java source file only.
    2. Click No if you do not want to add the Java nature to the selected Mobile Application Project.
    3. Click Finish in the wizard to compile the java skeleton source file and add the skeleton java checker class to the MBO.
      The SAP result checker you created appears next to the Custom option.
  4. In the Result checker section, next to the Custom option, click Search to find an existing SAP result checker class.
    1. In the Select SAP Result Checker Class dialog, select the SAP result checker class and click OK. The SAP result checker class appears next to the Custom option.
      Note: A valid SAP result checker is a Java class that implements com.sybase.sup.sap.SAPResultChecker. Only classes implementing the correct interface appear in the search dialog.
  5. Implement the new class by writing the implementation on top of the skeleton, as documented in the topic, Writing a Custom SAP Result Checker.
  6. Test and preview the result of your result checker:
    1. To reuse input values you have already saved for previous previews, select Existing Configuration. Otherwise, load defaults, or create a new set of input values expressly for this preview instance.
    2. Click Preview.


    If the data runs successfully, Execution Succeeded appears at the top of the Preview dialog and data appears in the Preview Result window.