Generating C# Object API Code

Generate Object API code for Windows Mobile devices.

Prerequisites
  1. Connect to both the sampledb database and SAP Mobile Server. Code generation fails if the server-side (run-time) enterprise information system (EIS) data sources referenced by the MBOs in the project are not running and available to connect to when you generate object API code.
  2. Switch to the Advanced developer profile to see advanced options in SAP Mobile WorkSpace.
Task
  1. Start SAP Mobile WorkSpace, using the same workspace location you used when you created the SMP101 project in the MBO tutorial.
  2. In SAP Mobile WorkSpace, open the SMP101 mobile application project.
    In WorkSpace Navigator, right-click the SMP101 folder and select Open in Diagram Editor.
  3. In WorkSpace Navigator, expand SMP101. Under Generated Code, add a folder named Windows.
  4. Right-click anywhere in the SMP101 - Mobile Application Diagram and select Generate Code.
  5. On the Code generation configuration screen, click Next.
  6. In the Select Mobile Business Objects window, select the Customer MBO, then click Next.
    Ignore any warning about unresolved mobile business object dependencies.
  7. Enter the information for these configuration options:
    Option Description
    Language Select C#.
    Platform Select .NET Framework for Windows.
    Mobile Server Select My Mobile Server (or the server to which you deployed the SMP101 project, if you used another).
    Server domain Select default.
    Page size Select <blank> (replacing 1024).

    The page size should be larger than the sum of all attribute lengths for any MBO that is included with all the MBOs selected, and must be valid for the database. If the page size is not set, the default page size is 4KB at runtime.

    Namespace Enter SMP101Windows.
    Project path Enter \SMP101\Generated Code\Windows.

    Generate Code wizard, Configure Options page
  8. Click Finish.
    If you see a success notification dialog, click OK.
    In the Generated Code directory, you see Windows\src\SMP101Windows.