Tuesday Nov 15, 2011

Debugging OWB generated SAP ABAP code executed through RFC

Within OWB if you need to execute ABAP code using RFC you will have to use the SAP Function Module RFC_ABAP_INSTALL_AND_RUN. This function module is specified during the creation of the SAP source location. Usually in a Production environment a copy of this function module is used due to security restrictions.

When you execute the mapping by using this Function Module you can’t see the actual ABAP code that is passed on to the SAP system. In case you want to take a look at the code that will be executed on the SAP system you need to use a custom Function Module in SAP. The easiest way to do this is to make a copy of the Function Module RFC_ABAP_INSTALL_AND_RUN and call it say Z_TEST_FM. Then edit the code of the Function Module in SAP as below


DATA: END OF listobj.

DATA: begin_of_line(72).
DATA: line_end_char(1).
DATA: line_length type I.
DATA: lin(72).

loop at program.
append program-line to WRITES.


Within OWB edit the SAP Location and use Z_TEST_FM as the “Execution Function Module” instead of  RFC_ABAP_INSTALL_AND_RUN. Then register this location. The Mapping you want to debug will have to be deployed. After deployment you can right click the mapping and click on “Start”.


After clicking start the “Input Parameters” screen will be displayed. You can make changes here if you need to. Check that the parameter BACKGROUND is set to “TRUE”.

After Clicking “OK” the log for the execution will be displayed. The execution of Mappings will always fail when you use the above function module. Clicking on the icon “I” (information) the ABAP code will be displayed.


The ABAP code displayed is the code that is passed through the Function Module. You can also find the code by going through the log files on the server which hosts the OWB repository. The logs will be located under <OWB_HOME>/owb/log.

Patch #12951045 is recommended while using the SAP Connector with OWB For recommended patches for other releases please check with Oracle Support at http://support.oracle.com

Friday May 27, 2011

OWB 11gR2 - SAP ins and outs

In 11gR2 there are a few SAP mapping runtime parameters that are not explained very well and the documentation describes data retrieval techniques without telling you what exact properties to use for each of the approaches. The properties which are not described are the INSTALL ONLY and the Include FTP properties, the table below illustrates for the modes in the documentation what the property values need to be set to.

Mode \ Properties INSTALL ONLY Include FTP
Automated FALSE TRUE
Semi-automated TRUE/FALSE for DEV, then send ABAP to SAP admin for PROD TRUE
Manual TRUE/FALSE for DEV, then send ABAP to SAP admin for PROD FALSE

The INSTALL ONLY property controls the deployment of the ABAP into the SAP system, general the SAP administrator will not let you deploy directly into the production SAP system, so OWB supports the following modes to deploy the mapping into;

  1. OWB runtime schema and the ABAP into SAP, or
  2. OWB runtime schema only, the ABAP report must be manually configured
These modes above are what dictate the system configurations in the doc along with the 'Include ftp' option which impacts how the runtime operator works;
  • The Automated System mentioned in the OWB documentation relates to deploying into SAP (point 1 above) and transferring the file and loading into Oracle (deployment of ABAP to SAP, execution, transfer and loading done by OWB).
  • The Semi-automated System mention in the documentation relates to using point 2 above and transferring the file and loading into Oracle (execution, transfer and loading done by OWB, deployment of ABAP in SAP done by administrator).
  • The Manual System mention in the documentation relates to using point 2 above (execution done by OWB, transfer and load by user's process flow or other mechanism of choice, deployment of ABAP into SAP done by administrator).
Option 2 is used for production environments where the SAP administrator does not let you deploy directly into the SAP system (see this for background). For semi-automated and manual system configurations if the report name is changed by the SAP administrator you can change the mapping's configuration for production in OWB and deploy such that the names match. When the INSTALL ONLY configuration property in the mapping is set to true the ABAP is taken an manually transferred by the SAP administrator.
This relates back to the technical note (552621.1) on deploying and running on production environments - being able to control the ABAP report name, and the execution function module.

When the mapping is executed the file system that SAP writes to can be either a shared folder setup or ftp/https is used to transfer from SAP to the OWB system. If you plan to transfer data using a shared directory (shared between the SAP system and the OWB runtime service) you need to validate that both systems can access the directory. If you are using FTP you need to validate that both ends can transfer into the directory. One thing that is a pain today is that the load is only done when ‘Include FTP’ option is true, soooo if you are using a shared folder..there is no need to ftp right, but can only load when ftp is used.

The 'Include ftp' configuration parameter on the mapping that controls whether when the mapping is executed by OWB will include the transfer of the file by one of the transfer types (ftp/http/https) defined in the SAP location. Above you see I set 'Include ftp' to false, in doing so when the mapping is executed the ABAP code writes a file into /tmp and I will manually transfer the file in a process flow for example (or it may be written to a shared file system). One of the restrictions is that there is no sftp in this list as you notice. So what customers have done mostly is perform the sftp in a process flow after the mapping has been executed. That way the development/test/prod designs are identical. The ABAP generated by OWB when executed generates a SQL*Loader control file that has both the header and the data, so an activity to load the data using the SQL*Loader control file must be constructed (see here for details).

If I change the staging file directory configuration parameter for the mapping...

then the generated ABAP has this value;
…so in reverse if the administrator changes the ABAP report when moving into production you can align the production OWB mapping with the values he used and everything will be in sync (if using OWB's built in ftp capability), or change your custom process flow to have the values in a process flow parameter for example.
My location for the above used FILE transport type. If I had enabled 'Include FTP' above in the mapping configuration then I would have to have set the transport type to FTP/HTTP/HTTPS and supplied credentials for the transport properties. These are just protocols to retrieve the staged file (so they are doing 'ftp get' 'http get' 'https get'), the get is initiated from the OWB runtime connecting to the ftp service. The ftp service could be on the SAP system or on another system that the administrator setup to decouple from the SAP system.
Hopefully that helps bridge the gap between what is mentioned in the automated/semi-automated/manual system configurations in the doc and how you configure the mappings.


ETL, CDC, Real-Time DI and Data Quality for the Oracle Database from the inside.


« July 2016