The entire runtime behaviour of MCH_IC.exe is driven by a single plain-text INI file namedDocumentation 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.
config.ini. The file must be placed in the same directory as the executable — i.e., the build output folder (e.g. MCH_IC/bin/x64/Debug/ during development, or the deployment folder in production). Every key is read at process startup through the IniFile class, which delegates directly to the Windows kernel32.dll GetPrivateProfileString API, so the file must exist and be accessible before the first sync cycle begins.
Two config files ship in the output folder.
config.ini targets the production HANA company databases (e.g. 10071_HECHIZO_DEP). config2.ini targets the test environment — it is identical in structure but every database name carries a _TEST suffix (e.g. 10071_HECHIZO_DEP_TEST). To run MCH_IC.exe against the test environment, rename or swap config2.ini to config.ini before launching the process.How the file is loaded
IniFile wraps two P/Invoke declarations from kernel32.dll:
LeerINI(section, key) helper method calls GetPrivateProfileString with a 255-character buffer and returns the string value (the Windows API automatically strips leading and trailing whitespace from INI values). All reads happen through Conexion.cs static field initializers at class-load time, meaning any missing or malformed key will produce an empty string — including UserSL and PassSL, which are guarded by ?? throw new ArgumentNullException(...) but in practice receive empty strings rather than null when absent.
The path to the file is always resolved relative to the executing assembly:
Section reference
[ServiceLayer]
Defines the base URL for the SAP Business One Service Layer REST API. This section also duplicates the HANA system user/password for legacy reasons — the primary Service Layer credential keys live in [ConexionHanaProd].
| Key | Type | Description |
|---|---|---|
UrlSL | URL | Full base URL of the Service Layer, including the trailing slash. All REST calls are built by appending resource paths to this value (e.g. Manufacturers, ItemGroups). |
Legacy keys in [ServiceLayer] (not used by Conexion.cs)
Legacy keys in [ServiceLayer] (not used by Conexion.cs)
The
[ServiceLayer] section in the shipping config.ini also contains UID, PWD, and DATABASENAME keys. These are not read by Conexion.cs or any other class in the current codebase. They appear to be remnants of an earlier configuration layout and can be safely ignored, but removing them is not required.[ConexionHanaProd]
This is the primary section. It provides both the Service Layer authentication credentials and the ODBC connection parameters for direct HANA SQL queries, plus the logical name-to-database mapping for every company.
Service Layer credentials
| Key | Description |
|---|---|
UserSL | SAP Business One application user name used to authenticate against the Service Layer for every company. This value is embedded in the Base64 JSON token (see Authentication). |
PassSL | Password for UserSL. Appended after a colon to the serialised JSON credential before Base64 encoding. If absent, LeerINI returns an empty string and the token will be malformed. |
ODBC / HANA direct connection
These keys are assembled at startup into theConexion.strCon connection string used by all OdbcConnection queries.
| Key | Description | Example value |
|---|---|---|
DSN | ODBC driver specification. Must match the driver name registered in ODBC Data Sources. | {HDBODBC} |
SERVERNODE | SAP HANA server hostname and SQL port. | hana-007:30015 |
UID | SAP HANA database system user. This account needs SELECT access on all company schemas listed below. | SYSTEM |
PWD | Password for the HANA UID system user. | (your HANA password) |
DATABASENAME | HANA multi-tenant instance/catalog name. Currently commented out in conexionhana() but kept for reference. | NDB |
Company database names
Each key maps a logical short name (used throughout the C# codebase) to the actual SAP HANA schema/database name.| Key | Role | Description |
|---|---|---|
ORIGEN | Hub (Hechizo) | The master source-of-truth company. Master data is replicated from this database to all branches. |
sur | Branch | Deportes Sur company database. |
omdo | Branch | OMDO company database. |
nedn | Branch | NEDN company database. |
hogar | Branch | Hogar Ideal company database. |
flores | Branch | Flores Deportes company database. |
vital | Branch | Encanto Vital company database. |
emde | Branch | EMDE company database. |
central | Branch | Ave Central company database. |
desampa | Branch | Company database identified by fiscal code 3_102_956112. |
[CodSocio]
Maps each company’s logical key to the SAP Business One Business Partner CardCode that represents that company inside Hechizo’s own database. These codes are used by intercompany transaction sync methods (e.g. ConsultarCardCode()) to identify the counterpart when creating purchase orders and vendor invoices.
| Key | CardCode in Hechizo | Description |
|---|---|---|
ORIGEN | PL00001 | Hechizo’s own vendor/supplier code (used when Hechizo is the destination). |
sur | 2703 | Hechizo’s BP code for Deportes Sur. |
omdo | 2704 | Hechizo’s BP code for OMDO. |
nedn | 2706 | Hechizo’s BP code for NEDN. |
hogar | 2776 | Hechizo’s BP code for Hogar Ideal. |
flores | 2731 | Hechizo’s BP code for Flores Deportes. |
vital | 2775 | Hechizo’s BP code for Encanto Vital. |
emde | 2705 | Hechizo’s BP code for EMDE. |
central | 2738 | Hechizo’s BP code for Ave Central. |
desampa | CL00041 | Hechizo’s BP code for the Desamparados company. |
Annotated file template
The block below shows the exact structure ofconfig.ini with real credentials replaced by descriptive placeholders. Use this as a deployment checklist.