This server will be upgraded at 3pm Sydney time on December 3rd (December 2nd, 8pm PST) and will be down for up to 30 minutes.

SAP R3 Table Reader Plugin

Name SAP R/3 Table Reader Plugin
Version 1.0.5
Product Versions Confluence 2.0+, JDK 5.0+
Author(s) Frithjof Eckhardt
Price Free
License BSD
Download JAR smi-plugin-sapr3-table-reader-1.0.5-bin.zip
Download Source smi-plugin-sapr3-table-reader-1.0.5-src.zip (Eclipse project)

Description/Features

The table reader plugin provides some macros to read table content from an SAP R/3 system. The idea is to allow documentation of R/3 customization data within Confluence. The plugin is useful for having up to date R/3 customization information in Confluence and keeping it in sync with the backend system. The plugin uses the SAP Java Connector (SAP JCo) to connect to the system and to call a remote function module (RFM) within SAP that reads data from a single table. The JCo library is not distributed with this plugin due to its license terms and has to be downloaded separately.

Usage

Manual installation required!
  1. Remove any previous installation of the plugin.
  2. Install the smi-plugin-sapr3-table-reader-1.0.5.jar file into WEB-INF\lib. The plugin does not work when uploaded through the Confluence Administration console!
  3. The plugin depends on the SAP Java Connector which must be installed separately (see below)!

Once the plugin is in WEB-INF/lib, there is some configuration needed in order to tell the plugin about your SAP R/3 system landscape. The systems are configured in a plain Spring context file. This file is read from the plugin and has to be named as sapr3-system-landscape.xml and resides in WEB-INF/classes.

SAP Java Connector (SAP JCo) setup (Windows XP)

The Java connector is available for other operating systems too. Please look at the respective download package from the source above for more details about the installation.

SAP R/3 system landscape setup

  • Specify the R/3 system landscape in CODEGEIST:sapr3-system-landscape.xml and put this file into WEB-INF/classes directory of Confluence (the file must be named exactly as sapr3-system-landscape.xml). You can specify as many systems as needed, but usually one development or customization system suffices.
    <!-- Properties of the development system -->
    <bean id="developSystemProps" class="de.ukwuerzburg.smi.remote.JcoProperties">
        <property name="properties">
            <map>
                <entry key="SID">
                  <value>A00</value>
                </entry>
                <entry key="ASHOST">
                    <value>r3server.yourcompany.com</value>
                </entry>
                ...
            </map>
        </property>
     </bean>
    ...
    <bean id="r3-develop" class="de.ukwuerzburg.smi.remote.R3SystemImpl">
        <constructor-arg>
            <ref bean="developSystemProps"/>
        </constructor-arg>
        <constructor-arg>
            <ref bean="r3-function-factory-template"/>
        </constructor-arg>
    </bean>
    ...
    <bean id="default-remote-system-landscape"
          class="de.ukwuerzburg.smi.remote.DefaultRemoteSystemLandscape">
        <property name="systems">
            <map>
               <entry key="dev">
                   <ref bean="r3-develop"/>
               </entry>
               <entry key="qa">
                   <ref bean="r3-qa"/>
               </entry>
            </map>
       </property>
    </bean>
    
  • If you want to call another RFM than RFC_READ_TABLE you can specify this in CODEGEIST:sapr3-system-landscape.xml too. This can be any RFM that commits to the interface of the original RFC_READ_TABLE RFM that usually ships with any R/3 system.
    <bean id="rfcReadTable-template" class="de.ukwuerzburg.smi.remote.fun.sdtx.RfcReadTableImpl">
        <property name="name">
            <value>RFC_READ_TABLE</value>
            <!--value>Z_RFC_READ_TABLE</value-->
        </property>
    </bean>
    ...
    <bean id="r3-function-factory-template"
          class="de.ukwuerzburg.smi.remote.fun.TemplateRemoteFunctionFactory">
        <constructor-arg>
            <map>
                <entry key="RFC_READ_TABLE">
                    <ref bean="rfcReadTable-template"/>
                </entry>
            </map>
        </constructor-arg>
    </bean>
    
Don't worry!
The only thing you really have to specify in the CODEGEIST:sapr3-system-landscape.xml are the JcoProperties. But if you want more security then you should not use the RFC_READ_TABE RFM because it does not check per table permissions. Then there is more work left to do.

Examples

Suppose to read the table DD02T with the following SQL:

select TABNAME, DDTEXT
  from DD02T
 where TABNAME LIKE 'A%'

The corresponding syntax with the {sapr3-table-reader}-Macro within Confluence would be:

{sapr3-table-reader:name=Tables starting with A|system=dev}
  {querytable:DD02T}
  {foi:TABNAME,DDTEXT}
  {options}
     TABNAME LIKE 'A%'
  {options}
{sapr3-table-reader}

and renders the result as

A complete list of the available fields for a table pops up if the table name link in the header of the table is clicked. Tooltips for descriptions are provided for each field of the fields of interest by hovering the mouse over the fieldname in the column's head. These popups are rendered by the overLIB JavaScript library.

Macro syntax more detailed

{sapr3-table-reader}

This macro can have the following parameters:

  • name, the (alphanumeric) name for the result of the query.
  • system, the SAP R/3 system key as specified in the default-remote-system-landscape of CODEGEIST:sapr3-system-landscape.xml.
  • refresh, the duration in days after which the resulting table is refreshed in Confluence if viewed. Default is 7 days. If set to -1, refresh is never made and the refresh link disappears. This is useful to import some data that should not be updated due to references to exactly that data in the describing text near by.
  • rowcount, an integer value specifying the amount of rows read from SAP. The default value is 10.
  • rowskips, an integer specifying the number of rows that are skipped by the read. Default value is 0.
  • nodata, indicates to only test the connection without reading data. Default is false.

{querytable}

The querytable macro has to be placed in the body of the enclosing sapr3-table-reader macro. The only one unnamed parameter is the table to read from.

{foi}

The F ields o f I nterest parameter specifies the fields for the resulting table. This macro takes only one parameter: a comma separated list of the fieldnames.

{options}

The options macro is parameterless and the options are placed in the body of the macro. The syntax is identically equal to ABAP, you can use boolean operators and parenthesis as needed, strings are enclosed in single quotes.

{options}
  TABNAME LIKE 'A%' AND
  ( DDTEXT LIKE 'Plant%' OR DDTEXT LIKE 'Over%')
{options}

Failure hints

A short message helps to determine the cause of failure if something goes wrong with the connection or the remote function call. So for instance, if the user is locked the message is

or if there is no permission to read from a certain table:

These messages are only rendered if the macro execution has not succeeded ever since the first time. From the time on when the first table read is successfull, these messages are not rendered explicitly, but instead the version of the most recent successful read is shown with a small modification: the table name in the header is prefixed with an asterix (*) to indicate that something went wrong (DD02T@dev becomes *DD02T@dev). This makes sense in order to prevent Confluence from rendering error messages in every page the macro is used if the SAP R/3 system is unavailable for some reasons like release upgrade or hardware migration.

Known Problems

Make sure to use different names for multiple {sapr3-table-reader} macros within the same page!

Version History

Version Date Notes
1.0.5 2006/04/29 Problems with unescaped HTML fixed.
1.0.4 2006/03/18 Packages renamed from org.ukwuerzburg to de.ukwuerzburg (it is necessary to replace previous landscape property file)
1.0.3 2006/03/18
  • Fixed problems with overLIB popups with Internet Explorer while rendering multiple
    {sapr3-table-reader} macros within the same page (popups did not work due to multiple inclusion of
    the same JavaScript).
  • Now the results are not saved while the page is in preview mode only.
1.0.2 2006/03/17 Fixed display problems in macro help
1.0.1 2006/03/17 Renaming
  • Macro: {tablereader} => {sapr3-table-reader}
  • Package: smi-plugin-table-reader => smi-plugin-sapr3-table-reader
  • System landscape: remote-system-landscape(.template).xml => sapr3-system-landscape(.template).xml
1.0 2006/03/16 Cosmetic source package change
1.0 2006/03/15 Initial release

Labels

plugin plugin Delete
macro macro Delete
codegeist codegeist Delete
sap sap Delete
rfc_read_table rfc_read_table Delete
non-repository non-repository Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Mar 17, 2006

    David Peterson [CustomWare] says:

    Looks like a handy plugin for SAP users. Just a thought - perhaps it should actu...

    Looks like a handy plugin for SAP users. Just a thought - perhaps it should actually be called the SAP Table Reader? 'Table' is a pretty generic term and doesn't really describe what the plugin actually does. Same with the macro - {saptablereader} or {sap-table-reader} perhaps?