Getting the synchronization engine running requires satisfying a small set of infrastructure prerequisites, building the project for the correct platform target, and dropping a single configuration file next to the executable. The four steps below take you from a fresh clone to a working scheduled sync.Documentation 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.
Prerequisites
Verify that every dependency is in place on the machine that will run the sync before you attempt a build or execution.Runtime and build tools
- .NET Framework 4.8 Developer Pack (SDK + targeting pack) installed on the build machine
- Visual Studio 2019 or later (Community edition is sufficient) with the .NET desktop development workload
- x64 operating system — the project targets
x64due to theSAPBusinessOneSDK.dlldependency
- SAP HANA ODBC driver (
HDBODBC) installed and registered in the Windows ODBC Data Source Administrator. TheDSNvalue inconfig.inimust reference this driver using the syntax{HDBODBC}. - Network access to the SAP HANA server on port 30015 (HANA SQL / ODBC)
- SAP Business One Service Layer accessible at
https://your-hana-server:50000/b1s/v1/ - A dedicated SAP B1 user (e.g.
Hechizo06) with permissions to read and write items, business partners, orders, invoices, payments, and GL accounts across all ten company databases - Network access to the Service Layer HTTPS port (50000 by default) from the machine running
MCH_IC.exe
Clone and Build
Clone the repository and open the solution in Visual Studio. The project must be compiled for the In Visual Studio:
x64 platform — the SAPBusinessOneSDK.dll is a 64-bit assembly and the build will fail or produce a non-functional binary under AnyCPU or x86.- Open
Inter_Hechiz.sln. - In the toolbar platform dropdown, select x64 (not
Any CPU). - Choose Debug or Release from the configuration dropdown.
- Press Ctrl+Shift+B (Build Solution).
- Debug:
MCH_IC/bin/x64/Debug/MCH_IC.exe - Release:
MCH_IC/bin/x64/Release/MCH_IC.exe
Configure config.ini
config.ini is not embedded in the binary — the application reads it from the same directory as MCH_IC.exe at startup using Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location). Copy the file to your output directory (bin/x64/Debug/ or bin/x64/Release/) and fill in the [ConexionHanaProd] section with your environment’s values.| Field | Used by | Description |
|---|---|---|
UserSL | Conexion.CrearToken() | SAP B1 username embedded in every Basic Auth token |
PassSL | Conexion.CrearToken() | SAP B1 user password — combined with UserSL and CompanyDB to produce each company’s token |
DSN | Conexion.conexionhana() | ODBC driver name; must match the installed HANA ODBC driver string |
SERVERNODE | Conexion.conexionhana() | HANA host and SQL port, e.g. hana-007:30015 |
ORIGEN | Conexion.Consultar_Hechizo() | SAP database name for the hub (Hechizo) company |
sur … desampa | Conexion.Consultar_*() | SAP database names for each of the nine branch companies |
[CodSocio] | Runtime lookups | Internal business partner codes used when creating intercompany partner records |
The
UrlSL key in [ServiceLayer] is read directly by Intercompany.cs as the base URL for every Service Layer REST call (e.g. POST {UrlSL}Manufacturers). Ensure it points to your actual SAP Business One Service Layer endpoint, typically https://your-hana-server:50000/b1s/v1/. The SERVERNODE key in [ConexionHanaProd] is used separately for the HANA ODBC connection string.Run the Sync
Execute Monitoring progressAll activity is written to a daily rolling log file in the Each entry is timestamped in
MCH_IC.exe directly or invoke it from a script. The console window disappears immediately — this is intentional (OcultarConsola.DisappearConsole() is called as the very first statement in Main()). The process runs to completion in the background and then exits.Log/ subdirectory next to the executable:HH:mm:ss tt format. Successful operations produce confirmation lines (e.g. Cliente Creado : CL00009/ Hora: 11:28:31 AM). Errors include the full exception message and the operation context (e.g. Error en Orden Compra, ERROR [IM002] ...).A full sync cycle touches hundreds of API calls across all ten companies. Execution time depends on the volume of unsynced records and Service Layer response latency — plan for several minutes per run in a production environment.Errors that cannot be resolved mid-run are persisted to the custom SAP table
@SINCROERROR via Data.Intercompany.SINCROERROR_V2(), which is the first method called in Main(). This means you can query SELECT * FROM "@SINCROERROR" directly in SAP HANA Studio or from within SAP Business One’s user-defined table viewer to see any records that failed to sync during the last execution.