Creating an SAP extension for the Denodo RFCReadTable Custom Wrapper

Applies to: Denodo 6.0 , Denodo 5.5 , Denodo 5.0
Last modified on: 01 Mar 2016
Tags: SAP

Download document

You can translate the document:

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:

 http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a83ec690-0201-0010-14ac-bd1d75e24a7d?overridelayout=true

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

 

  1. Use transaction SE11 to copy the structure TAB512 to ZDENTAB4096 and click on Save.

  1. Search for ZDENTAB4096 and click on Change.

  1. Change the “Component Type” column from ZDENTAB4096 to TX4096_D or any other text type with a greater Length.

  1. Save the changes.

 

  1. Click on Ctrl+F3 and click on continue to activate the new structure.

 

Creating the new BAPI as a copy of RFC_READ_TABLE

  

  1. Execute transaction SE38, enter SAPLSDTX as Program and click on Copy using ZDENSDTX as the new name

  1. Select a package name or click on Local Object

  1. 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

  1. Start transaction SE80.
  1. Search for ZDENSDTX in the Function Group Search box and click on change ZDEN_RFC_READ_TABLE.
  2. 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).

  1. In the “Tables” tab modify the type for the Data field

  1. Save the changes
  2. Activate the new elements
  1. Select the function module ZDEN_RFC_READ_TABLE > Right Click > Activate

 

  1. Select all objects and click on continue

  1.  Right Click on ZDENSDTX - Activate

  1. Use the new function name in the RFCReadTable custom connector in Denodo

create_base_view.png

Questions

Ask a question
You must sign in to ask a question. If you do not have an account, you can register here

Featured content

DENODO TRAINING

Ready for more? Great! We offer a comprehensive set of training courses, taught by our technical instructors in small, private groups for getting a full, in-depth guided training in the usage of the Denodo Platform. Check out our training courses.

Training