Use This ABAP Program to Download SAP Table Data and Table Structures

  • by Fahim Ahmad, Senior ABAP and Workflow Consultant, Descon Engineering Limited
  • September 14, 2012
See how to download an SAP table structure (i.e., the data types of each field), convert it into data types of the underlying database, and transfer table data with a large number of records. Use Object Linking and Embedding objects to concoct the database, create the table, and transfer data. This method uses Microsoft SQL Server 2005 Express Edition for this purpose.
Key Concept
You can use Object Linking and Embedding automation objects to connect with an external database and transfer information between the two landscapes. Using Microsoft Active data objects you can connect and execute SQL statements. The result is to transfer table definition and data to the underlying database. This transferred data can be used for multiple purposes such as reporting and data warehousing, and to use BI tools.

There are times when you need to transport a data structure and data to other databases to archive data or to use decision support systems such as BI tools.

The utility ABAP program I describe here is cost effective as you do not need to purchase costly data transferring tools. You can use it to transfer data from one or many tables in one session. The progress of the transfer of the structure and data is shown in the front end and a log is generated for the completion of each step.

Unlike other utilities that are available, this one creates a table in the underlying database with primary keys and converts compatible data types. You can use it with SAP NetWeaver 7.0 and later, and you can use it to transfer a batch of tables in one go.

In addition to table data, this utility also transfers the metadata of tables. If there is no table on the database side it creates a table in the database and then starts the transfer of data from SAP tables to the underlying database. This program gets the metadata of tables from the SAP system using a function module. It converts this metadata into proper SQL statements to create a table in the database.

The data is then transported using SQL statements. Object Linking and Embedding (OLE) objects connect and execute the SQL statements. Log entries are generated during the process and can be viewed by browsing the log table in the database. This transported data can be used by BI systems to generate analytical reporting.

Fahim Ahmad

Fahim Ahmad is a senior ABAP consultant for Descon Engineering Ltd. He has master’s degrees in statistics and computer science from the University of Punjab in Lahore, Pakistan. He has 10 years of experience as a software engineer. Fahim specializes in ABAP enhancements and reports, workflow, RFC programming, interfacing, OLE, and SAP Web services configuration and development.

See more by this author


Comments

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.