Get Data From Any Table in Another SAP System: A Generic Way in ABAP

  • by George Chen, SAP Consultant, Lynk, Inc.
  • July 2, 2015
Learn a new way to load data from any table in any SAP system to any other SAP system. See how to use a Remote Function Call (RFC) function module call, Runtime Type Service (RTTS), and JavaScript Object Notation (JSON) serialization/deserialization.
Learning Objectives

Reading this article you will learn how to:

  • Extract data from any SAP source system with a Remote Function Call (RFC) function module into any SAP system without a standard or customized data source
  • Dynamically determine the data structure at run time with a generic solution.
  • Use a generic JSON serialization/deserialization as an optional data import/export method
Key Concept

A Remote Function Call (RFC)-enabled function module is a function module that can be triggered from another SAP source system through an RFC. Metadata is data about data. Function module DDIF_FIELDINFO_GET can help get the metadata of the data structure. This metadata structure is generic in all SAP systems. In software engineering, the singleton pattern is a design pattern that restricts the instantiation of a class to one object. JavaScript Object Notation (JSON) is an open standard format that uses human-readable text to transmit data objects consisting of attribute-value pairs. It is used primarily to transmit data between a server and web application, as an alternative to XML.

Say you want to get the contents of a table from one of your SAP systems (called the source system) into a current system (called the client system). Most of the time if you want to access the table content of a source system, you need to:
  • Check to see if the content is in the standard business content
  • Check to see if business content is installed on both the source system and the target system
  • Ensure the business content is the same version on both systems
  • If yes, you need to activate the business content, build or activate the transformation and InfoProvider, and start data extraction
  • If no, you need to build your own customized data source, sync it on both systems, build the transformation and InfoProvider, and start extraction

The business content mostly covers master data and transaction data. Sometimes you need to access configuration data. Here are some examples:

  • In Trade Promotion Management (TPM)–Business Planning and Simulation (BPS) integration, you need to get the BPS planning profile information into the context of a Customer Relationship Management (CRM) environment. Even though you could get this through the IMG, you don’t have the flexibility in ABAP programming. The BPS planning profile can be connected to TPM through the IMG and planning data can be retrieved to TPM applications. However, what if you want to incorporate BPS planning data anywhere in TPM Web Dynpro? ABAP programming with this solution provides the flexibility.
  • When doing customizing development in Web Dynpro ABAP for TPM planning, you can get multiple BPS planning profiles and compare. This usually is not a big amount of data but something critical that you need to look up in coding as a reference.
  • You want to check the material cost in table MBEW of an ERP Central Component (ECC) system when you build a report in CRM, or you need to get planning results from Enterprise Performance Management (EPM)/Business Planning and Consolidation (BPC) into a CRM report.
  • Instead of getting data into an SAP BW staging InfoProvider, you may want to get information from the source system at run time and release the data once you finish the work (e.g., you don’t want to maintain or update the data in the target system on a daily basis).
  • In addition to extracting data without business content and flexibility as shown in the TPM example above, a third requirement is that ideally you want to have one generic solution for all situations. It would be a lot of work if you needed to write 20 different program/function modules, one for each table. It would be best to have one program/function module for all situations.


George Chen

George Chen is the owner of Lynk, Inc. An SAP consultant, he has worked on SAP Netweaver ABAP/HANA/BPC/BW/IP/TPM/CRM for the past 17 years. He specializes in process integration, performance tuning, and introducing advanced ABAP design patterns in development. He has worked with SAP America many times to conduct ABAP performance tuning and troubleshooting. His focuses are ABAP for HANA and ABAP OO in SAP NetWeaver.

See more by this author


No comments have been submitted on this article. 

Please log in to post a comment.

To learn more about subscription access to premium content, click here.