NOTE: SAP has published a new implementation of RFC_READ_TABLE that removes the limitations listed in this document. We recommend using this new version and following the steps in Denodo RFCReadTable Custom Wrapper - User Manual The specific SAP notes including this upgrade may vary depending on your SAP version (e.g. notes 2246160 and 382318). Please check your SAP installation in order to determine whether this new version of the RFC is available for you. For more details see Denodo RFCReadTable Custom Wrapper - Architecture and Features - User Manual Follow the steps in this document ONLY if you cannot use a more modern version of RFC_READ_TABLE. |
Introduction
Denodo’s RFCReadTable Custom Wrapper uses by default SAP’s RFC_READ_TABLE but can use another RFC providing the same functionality by passing the RFC name as parameter during wrapper configuration.
SAP’s RFC_READ_TABLE function has some limitations that we need to take into account:
- The combined length of the retrieved columns must not exceed 512 characters.
- When working with columns of type FLOAT, the module may cause an ABAP exception: ASSIGN_BASE_WRONG_ALIGNMENT.
To avoid the second limitation, you can use SAP’s BBP_RFC_READ_TABLE function instead of the default function.
To avoid the first limitation, you can use a custom function module to retrieve the table content as described in the following SAP solution:
SAP note 758278 provides an implementation of YRFC_READ_TABLE that addresses decimal issues. To apply this fix, install the YRFC_READ_TABLE function module on SAP, then modify the following three advanced data source properties: • Table read function: YRFC_READ_TABLE • Table row length: 4010 • Table decimal fix: Checked
The rest of this document describes how to do that.
Creating the new BAPI
In order to create a modified version of the RFC_READ_TABLE BAPI follow these steps:
Creating a new data type
- Use transaction SE11 to copy the structure TAB512 to ZDENTAB4096 and click on Save.
- Search for ZDENTAB4096 and click on Change.
- Change the “Component Type” column from ZDENTAB4096 to TX4096_D or any other text type with a greater Length.
- Save the changes.
- Click on Ctrl+F3 and click on continue to activate the new structure.
Creating the new BAPI as a copy of RFC_READ_TABLE
- Select a package name or click on Local Object
- In the copy function dialog that automatically appears use ZDEN_RFC_READ_TABLE as the new name for the RFC_READ_TABLE function
Customizing the new BAPI
- Start transaction SE80.
- Search for ZDENSDTX in the Function Group Search box and click on change ZDEN_RFC_READ_TABLE.
- Add the following modifications to the “Source Code” tab. Locate the statement ASSIGN WORK TO CASTING TYPE (QUERY_TABLE) and replace it with the following code:
DATA: BEGIN OF WORK, BUFFER(30000), END OF WORK.
FIELD-SYMBOLS: <WA> TYPE ANY, <COMP> TYPE ANY.
" --- begin of modification
" ASSIGN WORK TO <WA> CASTING TYPE (QUERY_TABLE).
DATA: tab_ref TYPE REF TO data.
CREATE DATA tab_ref TYPE (query_table).
ASSIGN tab_ref->* TO <wa>.
" --- end of modification
IF ROWCOUNT > 0.
ROWCOUNT = ROWCOUNT + ROWSKIPS.
ENDIF.
SELECT * FROM (QUERY_TABLE) INTO <WA> WHERE (OPTIONS).
- In the “Tables” tab modify the type for the Data field
- Save the changes
- Activate the new elements
- Select the function module ZDEN_RFC_READ_TABLE > Right Click > Activate
- Select all objects and click on continue
- Right Click on ZDENSDTX - Activate
- Use the new function name in the RFCReadTable custom connector in Denodo
The information provided in the Denodo Knowledge Base is intended to assist our users in advanced uses of Denodo. Please note that the results from the application of processes and configurations detailed in these documents may vary depending on your specific environment. Use them at your own discretion.
For an official guide of supported features, please refer to the User Manuals. For questions on critical systems or complex environments we recommend you to contact your Denodo Customer Success Manager.