ArcNews Online

Fall 2004
Search ArcNews

Aspects of Esri-SAP Integration at Marin Municipal Water District

By R. Gavin McGhie, MMWD GIS Coordinator

With a mature GIS system and editing environment in place, the goal of the Marin Municipal Water District (MMWD) was to develop an Esri-SAP interface, making minimal changes to its UNIX workstation GIS environment. MMWD also wanted an interface that could be easily migrated to the ArcGIS platform as it began its upgrade path. (See also Marin Municipal Water District Updates Infrastructure With GIS.)

MMWD chose to integrate the systems using a series of simple text files that could be passed between the SAP and Esri GIS systems. One or multiple line text files are sent to SAP from GIS, including an object ID and an action flag (for adds, deletes, etc.). These are termed "command" (CMD) files and are in the following format:


This file signifies that the request is coming from GIS, it is for an Inquire function (I), the F is a residual left from legacy systems, and the object ID (PI-37576) is included to act as the primary key between the disparate systems. Similar formats are used for adding (A), deleting (D), changing (C), abandoning (C), and restoring (S) objects with various action flags. The final information in the string is a transaction ID number and is typically used to track changes between the systems.

  click to enlarge
The popup window shows an attribue short list highlighting valves in a Marin County neighborhood.

Once the file is sent from the GIS system, an SAP "listener program" picks up the file, begins processing, and generates a series of dialogs for the GIS user to interact with SAP. In addition, this action triggers the GIS system to spawn its own listener program, waiting for control to return from the SAP system.

The SAP side of the interface was customized using SAP's ABAP programming language. Most of the interaction and user dialogs were developed in SAP so that the interface was not dependent on a specific GIS program, as long as the GIS could create the needed text files and respond accurately to the response from SAP.

Once the user has completed the required interaction on the SAP side of the interface and closes the interaction, another text file called a return (RTN) file is generated by SAP and passed back to the shared directory where the GIS listener picks it up for processing. This file informs the GIS system if processing on the SAP side was successful, failed, canceled, etc., so it knows how to handle the action (e.g., roll back, save, retry). This file is in the following format:

GISthe file is meant for the GIS system
12345this is a transaction ID
0nonzero integers signify a failure in the interaction
OKcorresponding text message in case GIS must issue a return message to the user
GIS,I,F,PI-37576repeat of the CMD file for troubleshooting when needed

All CMD and RTN text file names are based on the user's login ID so GIS and SAP can manage multiple users at any given time.

The primary key used for communicating between the systems is a unique ID number, specific to the type of equipment being manipulated. This is an ID that has been used by MMWD for many years and is, therefore, familiar to most users. Also, this is the ID that appears on most paper records. This ID is stored in a Classification Characteristic in the SAP system and as a GIS attribute. Eventually, it is planned that GIS will begin to store the SAP equipment and functional location IDs for faster retrieval, although no performance problems have yet been encountered. The benefit of using the common ID is that it makes looking up the equipment easier in either system based on prior staff knowledge and legacy paper records.

This interface was designed primarily for MMWD's legacy UNIX ArcInfo Workstation editing environment, which is based on extensive ARC Macro Language (AML) programming. With minimal modification, it has since been adapted to work with UNIX ArcView 3.x using Avenue and ArcView 8.3 using Visual Basic for Applications (VBA). These latter applications are currently for inquiring or read-only use, but they could be modified to allow changes with limited effort.

Finally, several additional applications were developed in a similar manner for both ArcView 3.x and ArcView 8.3. These applications are for creating information packets based on a selected set of objects in GIS and retrieving information stored in SAP for those objects. A group of objects is selected in GIS, and a button created using VBA is selected. This generates a text file including the ID of each object selected. The user is then instructed to open SAP and run a specific customized transaction. Running said SAP transaction picks up the needed text file, processes it for the selected objects, and generates the custom report, including the requested information.

The above integration approach works well for a limited set of transactions in the current GIS and SAP environments. As MMWD migrates to newer releases of both Esri and SAP software and expands the integration scenarios to include work orders, CCS integration, and other scenarios, more contemporary integration approaches will be evaluated, including SAP connectors (.NET, Java), SAP's Exchange Infrastructure and GIS Business Connector, and solution-oriented approaches from other vendors.

For more information, contact Gavin McGhie, MMWD GIS coordinator (e-mail:

Contact Us | Privacy | Legal | Site Map