K2 connect: Troubleshooting Auto Compile Errors

  • 24 February 2022
  • 0 replies
  • 8 views

Userlevel 5
Badge +20
 

K2 connect: Troubleshooting Auto Compile Errors

KB000673

PRODUCT
K2 connect 4.5
BASED ON
K2 connect 4.5
LEGACY/ARCHIVED CONTENT
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

 

Introduction

Users may experience ServiceObjectModel Auto Compile errors when publishing a Service Object. The error is due to BAPI fields or structures containing invalid characters when they are compiled into .NET classes.

 

 

Background

When the SAP BAPI is published it’s converted to C# classes and a C# class or property name cannot start with an invalid character for example a number. Owing to this, when the user attempts to compile ServiceObjectModel Auto Compile Errors are thrown.

Shown in the image below is a BAPI where the structure’s friendly name and the property name contain invalid characters.

 

 

Recommended Troubleshooting Steps

Note: The steps described below are recommended methods to resolve this issue only.

To rectify the problem, the user can change the friendly name to a name that does not start with a number. For example change 2Step_Pick to TwoStep_Pick and then republish. Alternatively, an underscore can be used as a prefix, for example 2Step_Pick can be changed to _2Step_Pick and this is valid.

Note: The Service Object must be republished after any changes have been made for them to take effect.

The above resolution is suitable for making changes where invalid characters are known to exist. To locate other instances where invalid characters may exist the user can browse the *.cs files that have been generated by Microsoft Visual Studio:

  1. Browse to the directory <K2 connect Installation Folder>Configuration empComp folder
  2. Locate the [filename].cs filed for the published entities
  3. Select the file required and open the file using Microsoft Visual Studio
  4. Once the invalid characters have been found as illustrated in the example below, the user can rectify them as discussed above

    [SourceCode.ServiceObjectModel.Server.Runtime.Attribute public virtual string 2STEP_PICK]
    get {
          return _2STEP_PICK;
     }
     
     set {
          _2STEP_PICK = value;
     }
    }

 


0 replies

Be the first to reply!

Reply