Issue
Publishing a ServiceObject that calls the BAPI_MATERIAL_SAVEDATA method throws the following error:
ServiceObjectModel AutoCompiler errorCS1519: Invalid token '2' in class, struct, or interface member declarationServiceObjectModel AutoCompiler errorCS1519: Invalid token '{' in class, struct, or interface member declarationServiceObjectModel AutoCompiler errorCS1519: Invalid token '{' in class, struct, or interface member declarationServiceObjectModel AutoCompiler errorCS1519: Invalid token ';' in class, struct, or interface member declarationServiceObjectModel AutoCompiler errorCS0116: A namespace cannot directly contain members such as fields or methodsServiceObjectModel AutoCompiler errorCS1022: Type or namespace definition, or end-of-file expected
Diagnosis
This BAPI has the following structures containing a property with a friendly name starting with a number:
- WAREHOUSENUMBERDATA (BAPI_MLGN Type)
- WAREHOUSENUMBERDATAX (BAPI_MLGNX Type)
The property in question is called 2STEP_PICK.
Resolution
- Rename the property so that it starts with a non-numeric character. Below are examples you can use to change the name to:
- TWOSTEP_PICK
- _2STEP_PICK
- Click on Update Function to save the changes made on WAREHOUSENUMBERDATA and WAREHOUSENUMBERDATAX.
- Publish the ServiceObject.