User`s guide

SQL driver provides the ability to call ABAP functions that have defined return types and to display their
results. ABAP functions are also useful in situations where complex pre-processing of the data must
occur before viewing, or in circumstances where you may want to further optimize the performance of
a query.
How it works
Using the steps listed in Selecting tables, views, functions, and clusters, select a function. In the Database
Expert's Available Data Sources area, right-click ABAP Function modules and select Options. Then,
type the full or partial function name in the Table name LIKE field. When you add it to the report, the
function appears on the Links tab of the Database Expert just like a table (assuming there is more than
one table or function already added to the report). All the input and output parameters are displayed
as fields in the table.
Specify the input parameters either by linking them to another table's fields or by adding them to a
record selection formula. If the output of the function is one or more tables, the "virtual table" consists
of rows that are the cross-product of the values in all the tables. If the output of the function is one or
more values or structure instances, the "virtual table" consists of a single row that contains all the
values/structure values.
Limitations
For functions to be used in a report, they must meet two conditions:
Functions must have defined return types for each of the output parameters.
Functions must not have whole tables as input parameters.
Note:
If a function does not meet the first condition, you can write a "wrapper" function with defined return
types, and then call the original function from within the wrapper function.
Finally, the ability to call entire programs is not supported—you may call individual functions only.
Examples
The following examples illustrate the different types of ABAP functions that can be called by the Open
SQL driver and show how they appear in Crystal Reports.
Functions with values as inputs and outputs and in/out (CHANGING) parameters
Function F
IMPORTING
VALUE(NAME) TYPE C
VALUE(DEPARTMENT) TYPE C
EXPORTING
VALUE(Years_of_service) TYPE I
VALUE(Age) TYPE I
CHANGING
DATEFIELD TYPE D
This function would appear as a table called "F" with the following schema:
2012-03-14600
Integrating Business Applications with Crystal Reports