General interface integration method for SAP and other systems
By developing unified RFC functions and webservice services in SAP systems, using XML message format for interface calls and log management, the problem of inconsistent interfaces between SAP systems and other systems is solved, the code reusability and integration efficiency are improved, and the Maintenance cost enables rapid integration of data between systems.
Patent Information
- Application Number
- CN202411101967.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-11-29
AI Technical Summary
SAP systems have many interfaces with other systems, inconsistent message formats, low code reusability, high maintenance costs, and changes in external systems require regenerating proxy classes, resulting in low interface integration efficiency and difficulty in maintenance.
By developing unified RFC functions and webservice services in the SAP system, interface calls and log management are used in XML message format, business processing functions are called dynamically, and interface configuration modules and log access modules are used to achieve unified interface management and retransmission.
It improves the code reusability and scalability of the interface, reduces maintenance costs, realizes fast and efficient integration of data between systems and unified access and retransmission of logs, and solves the internal data integration problem of enterprise.
Smart Images

Figure CN119046028A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of interfaces of management information systems, and in particular to a general interface integration method between SAP and other systems. Background Art
[0002] As a powerful enterprise management software, SAP system has been introduced into more and more enterprises to manage sales, procurement, finance, production, inventory and other businesses. At the same time, there are other business systems developed in languages such as C#, Java, and C++ in the enterprise. In order to eliminate information islands, it is necessary to integrate SAP system with other heterogeneous systems to achieve data interconnection and sharing. In practical applications, SAP system has many interfaces with other systems, and the integration technology and message format adopted are not unified, the code reusability is low, and the scalability is poor, resulting in high maintenance costs of the interface. Therefore, it is of great practical significance to study and design a universal integration method between SAP system and other systems. At present, the integration technology between SAP system and other systems mainly adopts webservice (sending data) and RFC (receiving data). The message formats of each interface are inconsistent, which is not convenient for unified access and retransmission of interface logs. The code reusability is low, and when the external system webservice changes, the proxy class needs to be regenerated. Summary of the invention
[0003] The purpose of the present invention is to overcome the deficiencies of the prior art and provide a general interface integration method for SAP and other systems.
[0004] The objective of the present invention is achieved through the following technical solutions: The present invention provides a general interface integration method between SAP and other systems, including a method for an external system to call a SAP system to send data and a method for the SAP system to call an external system to send data. The SAP system includes an interface configuration module, a message receiving module, a message sending module, an XML message generating module, an XML message parsing module and a log storage and resending module. The method for the external system to call the SAP system to send data comprises the following steps: S1. Develop an RFC function in the SAP system for unified message reception, and publish the RFC function to the external system as a webservice service; S2, after the RFC function receives the first XML message from the external system through the message receiving module, the first XML message is parsed through the XML message parsing module to obtain the interface ID; S3. Obtain the business processing function name corresponding to the interface ID through the interface configuration module, dynamically call the business processing function, obtain the return result, convert the return result into a second XML message through the XML message generation module, and return it to the external system; The method for the SAP system to call an external system to send data comprises the following steps: Step 1: The external system publishes a webservice for receiving data. The SAP system generates a proxy class according to the wsdl address of each external system, and stores the interface ID and proxy class information in the interface configuration table. Step 2: The SAP system creates a first function, which includes two parameters: an interface ID and an internal table; Step 3: In the place where the SAP system function code needs to call the external system to transmit data, the first function is called. After receiving the data, the first function obtains the proxy class name of the corresponding external system according to the interface ID, and then calls the XML generation module to encapsulate the data into an XML message in a specified format to obtain a third XML message. Step 4: The SAP system calls the proxy class of the external system to send the third XML message to the external system; Step 5: The external system receives and processes the third XML message to obtain a fourth XML message, and returns the fourth XML message to the SAP system.
[0005] Furthermore, the development interface configuration module is used to manage interface configuration information, and the management interface configuration information includes interface ID, name, enabled state or disabled state, function name, proxy class name and creation date and time.
[0006] Furthermore, the method for the external system to call the SAP system to send data further includes: when obtaining the first XML message and the second XML message, calling a log storage function in an asynchronous manner.
[0007] Furthermore, the method for the SAP system to call an external system to send data further includes: when obtaining the third XML message and the fourth XML message, calling a log storage function in an asynchronous manner.
[0008] Preferably, the interface log storage includes a log table and long text, the log table is used to store the header data in the parsed XML, the long text includes creating two long text objects, which respectively store the complete interface input and output XML messages, the interface input XML message includes the first XML message and the third XML message, and the interface output XML message includes the second XML message and the fourth XML message.
[0009] Furthermore, the method for the SAP system to call an external system to send data also includes: interface log retransmission, recording the message sent by the SAP system to the external system through a log access retransmission module, and when the external system has a demand, sending the recorded message to the external system again through the proxy class of the external system.
[0010] The beneficial effects of the present invention are: 1) The present invention unifies the calling mode and message format of the interface between systems, and uniformly stores and resends the interface logs, thereby enhancing the reusability and extensibility of the code, greatly improving the system integration efficiency and reducing the subsequent maintenance cost. It is also more convenient to perform log retrieval and message resending, thus realizing the rapid and efficient integration of the SAP system with other systems and solving the problem of internal data integration in the enterprise; 2) The present invention assigns an ID to each interface, obtains the interface ID by parsing the input XML message, and then implements dynamic calling of the interface according to the interface configuration, thereby improving code reusability; 3) The present invention uses a combination of log table and long text to uniformly store interface logs, which can be easily retrieved and resent. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A flowchart of a method for integrating a general interface between SAP and other systems according to an embodiment of the present invention, in which an external system calls a SAP system to send data; Figure 2 The present invention is a flowchart of a method for integrating SAP with other systems through a universal interface, in which a SAP system calls an external system to send data. DETAILED DESCRIPTION
[0012] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0013] Exemplarily, the present invention provides a universal interface integration method between SAP and other systems, which fully adopts the webservice mode to integrate the SAP system with other systems, assigns a unique ID to each interface, and formulates a unified XML message format. At the same time, the SAP system and the external system both provide a unified called entry, which implements the dynamic call of a specific business processing method according to the interface ID parsed by XML. The SAP system includes an interface configuration module, a message receiving module, a message sending module, an XML message generation module, an XML message parsing module and a log access and retransmission module. In the SAP system, an interface configuration module is developed to manage interface configuration information, including interface ID, name, enabled or disabled status, business processing function name provided by the SAP system, interface proxy class name provided by the external system and creation date and time, etc.
[0014] Exemplarily, the flowchart of the external system calling the SAP system to send data in the present invention is as follows: Figure 1 As shown, an RFC function for uniformly receiving messages is developed in the SAP system, and the RFC function is published to the external system as a webservice service; the RFC function receives a first XML message from the external system through a message receiving module, and parses the first XML message through an XML message parsing module to obtain an interface ID; the business processing function name corresponding to the interface ID is obtained through the interface configuration module, the business processing function is dynamically called, and a return result is obtained; the return result is converted into a second XML message through the XML message generation module, and returned to the external system.
[0015] Exemplarily, the flowchart of the SAP system of the present invention calling an external system to send data is as follows: Figure 2 As shown, the external system publishes a webservice for receiving data. The SAP system generates a proxy class according to the wsdl address of each external system, and stores the interface ID and proxy class information in the interface configuration table; the SAP system creates a first function, which includes two parameters, the interface ID and the internal table; the first function is called in the place where the external system needs to be called to transmit data in the SAP system function code. After receiving the data, the first function obtains the proxy class name of the corresponding external system according to the interface ID, and then calls the xml generation module to encapsulate the data into an xml message in a specified format to obtain a third xml message. Finally, the message sending module is called to send the third xml message to the external system. The external system processes the third xml message to obtain a fourth xml message, and the external system returns the fourth xml message to the SAP system. Interface log retransmission is to record the message sent by the SAP system to the external system, and then take out the message and send it to the external system when necessary.
[0016] For example, when the SAP system calls an external system to send data or when the external system calls the SAP system to send data, both include using the log storage and resending module for log storage and access. The interface log storage adopts a combination of log table and long text. The log table stores the header data parsed in xml (including interface ID, production order, sales order, purchase order and other document numbers, material number, user ID, date and time) for quick retrieval. Create two long text objects to store complete interface input xml messages and interface output xml messages respectively. The interface input xml message includes the first xml message and the third xml message, and the interface output xml message includes the second xml message and the fourth xml message, which is convenient for viewing details and reading resending. The input xml data example is as follows: <?xml version="1.0" encoding="utf-8" ?> <info> <header><!--Message header--> <id> MES001< / id> <!--Interface ID--> <ordernum> 6000025365< / ordernum> <!--Order number--> <matnr> 120000005< / matnr> <!--Material number--> <zdate> 20240315< / zdate> <!--Date--> <ztime> 102511< / ztime> <!--Time--> <userid> 08409< / userid> <!--User ID--> < / header> <!--Message body--> <item> <vornr> 10< / vornr> <!--Process line--> <num> 2< / num> <!--Quantity--> <arbpl> 105< / arbpl> <!--Work Center--> <settime> 10< / settime> <! --Accurate working hours--> <piecetime> 20< / piecetime> <!--Piece Working Hours--> <unit> MIN< / unit> <!--Working time unit--> < / item> <item> ........... < / item> < / info> Output XML data. When no detailed data is returned, the message body is empty. The following is an example of outputting XML data: <?xml version="1.0" encoding="utf-8" ?> <info> <header> <type> S< / type> <!--Processing result, S: Success, E: Failure--> <msg> Supplier created successfully!< / msg> <!--Message--> <item> <lifnr> 10001< / lifnr> <!--Return the successfully created supplier number--> < / item> The above are only the preferred embodiments of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein, should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be changed within the scope of the concept described herein through the above teachings or the techniques or knowledge in related fields. Any changes and modifications made by those skilled in the art without departing from the spirit and scope of the present invention shall fall within the protection scope of the appended claims of the present invention.< / header> < / info>
Claims
1. A general interface integration method between SAP and other systems, Features: It includes a method in which an external system calls a SAP system to send data and a method in which the SAP system calls an external system to send data. The SAP system includes an interface configuration module, a message receiving module, a message sending module, an XML message generating module, an XML message parsing module and a log storage and resending module. The method for the external system to call the SAP system to send data comprises the following steps: S1. Develop an RFC function in the SAP system for unified message reception, and publish the RFC function to the external system as a webservice service; S2, after the RFC function receives the first XML message from the external system through the message receiving module, the first XML message is parsed through the XML message parsing module to obtain the interface ID; S3. Obtain the business processing function name corresponding to the interface ID through the interface configuration module, dynamically call the business processing function, obtain the return result, convert the return result into a second XML message through the XML message generation module, and return it to the external system; The method for the SAP system to call an external system to send data comprises the following steps: Step 1: The external system publishes a webservice for receiving data. The SAP system generates a proxy class according to the wsdl address of each external system, and stores the interface ID and proxy class information in the interface configuration table. Step 2: The SAP system creates a first function, which includes two parameters: an interface ID and an internal table; Step 3: In the place where the SAP system function code needs to call the external system to transmit data, the first function is called. After receiving the data, the first function obtains the proxy class name of the corresponding external system according to the interface ID, and then calls the XML generation module to encapsulate the data into an XML message in a specified format to obtain a third XML message. Step 4: The SAP system calls the proxy class of the external system to send the third XML message to the external system; Step 5: The external system receives and processes the third XML message to obtain a fourth XML message, and returns the fourth XML message to the SAP system.
2. A general interface integration method for SAP and other systems according to claim 1, Features: The development interface configuration module is used to manage interface configuration information, and the management interface configuration information includes interface ID, name, enabled or disabled status, function name, proxy class name and creation date and time.
3. A general interface integration method for SAP and other systems according to claim 1, It is characterized in that The method for an external system to call a SAP system to send data further includes: when obtaining the first XML message and the second XML message, calling a log storage function in an asynchronous manner.
4. A general interface integration method for SAP and other systems according to claim 1, It is characterized in that The method for sending data by calling an external system by a SAP system further includes: when obtaining the third XML message and the fourth XML message, calling a log storage function in an asynchronous manner.
5. A general interface integration method for SAP and other systems according to claim 3 or 4, Features: The interface log storage includes a log table and long text. The log table is used to store the header data in the parsed XML. The long text includes creating two long text objects to respectively store complete interface input and output XML messages. The interface input XML message includes a first XML message and a third XML message, and the interface output XML message includes a second XML message and a fourth XML message.
6. A general interface integration method for SAP and other systems according to claim 1, It is characterized in that The method for the SAP system to call an external system to send data also includes: interface log retransmission, recording the message sent by the SAP system to the external system through a log access retransmission module, and when the external system has a demand, sending the recorded message to the external system again through the proxy class of the external system.
Citation Information
Cited By
SAP-based system integration docking interface management method and system
CN121349555A
