The Hechizo SAP Intercompany application uses a small set of lightweight model classes for two purposes: deserializing HTTP responses from the SAP Business One Service Layer REST API, and representing SAP document line data read from HANA via ODBC. All classes are plain C# POCOs (Plain Old CLR Objects) — no base classes, no attributes, no ORM mapping. Serialization and deserialization is performed entirely byDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/FCS-Consultores/hechizo-SAP-intercompany/llms.txt
Use this file to discover all available pages before exploring further.
Newtonsoft.Json (JsonConvert.DeserializeObject).
DetallesOPORT
Namespace:Intercompany.modelsFile:
Models/DetallesOPORT.cs
DetallesOPORT represents a single detail line read from a SAP Business One opportunity or order document. It is used internally to carry line-level data — quantities, prices, discount percentages, tax groups, and project codes — through the intercompany document flow methods before the data is serialized into Service Layer JSON payloads.
The SAP internal document entry number of the parent document. Used to correlate lines back to their header record when building the Service Layer request body.
The item master code identifying this line’s product (e.g.
"JF-C2-AZ-10"). Must match an existing item in the destination company before the document is posted.The ordered or requested quantity for this line.
The total monetary amount for this line, after discounts and before taxes.
The line-level discount percentage (e.g.
5.0 for 5 %). Applied when the discount is expressed as a percentage rather than a fixed amount.The SAP tax group code applied to this line (e.g.
"IVA13" for 13 % VAT). Must match a valid tax group in the destination company.A user-defined field (UDF) holding the project code linked to this document line. Mapped to
U_PROYECTO in the Service Layer JSON payload.The free-text item name or description to be embedded in the document line. Sourced from
OITM.ItemName in the origin HANA schema.Respuesta
Namespace:Inter_Hechiz.Data (defined at the bottom of Intercompany.cs)
Respuesta is the standard return type for all Intercompany methods that return a result. It carries a numeric status code and a human-readable message, allowing callers to branch on outcome without catching exceptions.
Numeric result code.
0 indicates success. Negative values indicate failure: -1 for an unhandled .NET exception, -2 for a Service Layer API error response.A human-readable description of the result. On error this is the exception message or the
error.message.value string from the Service Layer error envelope. On success it may be empty or contain a summary of the operation.Marketing
Namespace:Inter_Hechiz.Data (defined in Intercompany.cs)
Marketing is used to deserialize the success response body returned by the SAP Business One Service Layer when a document is created or updated. The Service Layer returns a JSON object containing the new document’s internal entry number and display number, which are captured in this class by the EnviaSapPorBasicAuth helper.
The SAP-assigned internal entry number (
DocEntry) of the newly created or updated document. This value is stored in the origin database’s UDF (e.g. U_DocEntryDestino) so that subsequent update operations can PATCH the correct record.The user-facing document number (
DocNum) as displayed in SAP Business One. Used in log messages to make error entries traceable by users without needing database access.The document’s line items as returned by the Service Layer. Each element is a
SapDocumentLine with LineNum, ItemCode, and UnitPrice. This collection is present in the response for document-type endpoints; it is null for master-data endpoints.Marketing object is stored in the private static field ObjSap inside Intercompany immediately after EnviaSapPorBasicAuth returns 0:
SapDocumentLine
Namespace:Inter_Hechiz.Data (defined in Intercompany.cs)
SapDocumentLine is a nested detail model used within Marketing.DocumentLines to capture individual line-level data from Service Layer create/update responses.
The zero-based line number within the document.
The item code on this document line.
The unit price recorded on this line in the SAP document.
Root / Error / Message
Namespace:Inter_Hechiz.Data (defined in Intercompany.cs)
These three classes form the error response envelope returned by the SAP Business One Service Layer when a request fails. EnviaSapPorBasicAuth deserializes the error body into a Root object and extracts the human-readable message.
The top-level error object in the Service Layer error JSON envelope.
The SAP-specific numeric error code (e.g.
305 for “Record already exists”).The localized error message object.
The language code of the error message (e.g.
"en" or "es"), set by the Service Layer based on the company language settings.The human-readable error text. This value is stored in the private static field
RR inside Intercompany and written to the log file.bases
Namespace:Intercompany.ModelsFile:
Models/basestest.cs
bases is an internal reference class that hard-codes HANA schema name constants. It was used during development and testing to avoid relying on config.ini when running against known environments.