Description
FineReport provides the source code for EXTRACT_TABLE_DATA and supports subsequent dataset use.
This document provides a detailed explanation of the creation process of EXTRACT_TABLE_DATA and the resolution of the problems that may arise.
Procedure
Creating an ABAP Function
Create an ABAP function named EXTRACT_TABLE_DATA.
Click Source code and paste the source code of EXTRACT_TABLE_DATA, as shown in the following figure.

Click the Tables tab, add four tables: FIELDS/FROMCLAUSE/WHERECLAUSE/DATA. and set Type spec. to LIKE.
According to the source code of the document, set Short text to ZSQL_CLAUSE_ELEMENTS for the first three tables and ZTABLEROWS for the last table, as shown in the following figure.
Note: In this case, an error message indicating that ZSQL_CLAUSE_ELEMENTS and ZTABLEROWS does not exist may be displayed. Save the function first.
Unfold ABAP Workbench and double-click ABAP Dictionary, as shown in the following figure.

Select Data type, name the data structure ZSQL_CLAUSE_ELEMENTS, and click Create, as shown in the following figure.

Select Structure and click √, as shown in the following figure.

Set Short Description, add a data element named TEXT, and set Component type to SO_TEXT, as shown in the following figure.

Using the same method, create a structure named ZTABLEROWS, add a data element with any name (for example, ZTABLEROWS), and set Component type to CHAR2000.

Save these two structures,and click the structure tree button above to open the directory of the package where structures are located.

Unfold Structures to see the two structures defined before. Right-click each one and select Activate.

Go back to EXTRACT_TABLE_DATA, re-click the Tables tab on the left, add four tables (FIELDS/FROMCLAUSE/WHERECLAUSE/DATA), and set Type spec. to LIKE. According to the source code of the document, set Short text to ZSQL_CLAUSE_ELEMENTS for the first three tables, and ZTABLEROWS for the last table.
Saving and Checking
Save the function and click the check button on the toolbar to perform syntax checking.

An error may occur, as shown in the following figure.

In this case, change ZALBUS_STRUCT_WHERECLAUSE to ZSQL_CLAUSE_ELEMENTS within the function.
Double Checking
If no error occurs, the function can be operated normally. Do not forget to select Remote-enabled module for the function to be accessed remotely.

Finally, activate the function to complete the setting.