SAP Knowledge Base Article - Public

2607221 - ABAP Function import values does not appear as parameters in Crystal Reports

Symptom

  • Missing parameters.
  • ABAP Function does not display import values as parameters.
  • How to pass values to an ABAP Function input parameters in Crystal Reports?

Environment

  • SAP Crystal Reports 2016
  • SAP Crystal Reports 2020
  • SAP Crystal Reports 2025

Reproducing the Issue

  1. In SAP Netweaver, create an ABAP Function like:              

       FUNCTION MYTEST

       IMPORTING
       VALUE(NAME) TYPE C
       VALUE(DEPARTMENT) TYPE C
      
       EXPORTING
       VALUE(Years_of_service) TYPE I
       VALUE(Employee_ID) TYPE I

  2. In Crystal Reports, create a report off the ABAP Function.
       
  3. Notice the import values are not shown as parameter in Crystal Reports. How to pass values to the import values / input parameter?
       
    Like in the above example, how to pass a value to: Name, and Department?

Cause

  • When reporting off an ABAP Function in Crystal Reports, all the input and output parameters are displayed as fields in the table. This is why Crystal Reports does not create Crystal Reports Parameter for the ABAP Function input parameters.

Resolution

  •  To pass values to input parameters, you can either:
    • Link them to another table's fields, in the Database Expert; or
    • Add them to a Record Selection Formula.
             
  • To pass values to the ABAP Function input parameters using a Record Selection:
         
    1. In Crystal Reports, create a report off an SAP ABAP Function.
        
    2. Under the menu "Record", select "Selection Formula - Record..."
        
    3. In the "Record Selection Formula", pass the values to the ABAP Function input parameters ( import values )  

      For example:

      If you have an ABAP function like:

          FUNCTION MYTEST

          IMPORTING
          VALUE(NAME) TYPE C
          VALUE(DEPARTMENT) TYPE C

          EXPORTING
          VALUE(Years_of_service) TYPE I
          VALUE(Employee_ID) TYPE I 

      Then in Crystal Reports, you will see the following database fields:
      - Name
      - Department
      - Years_of_service
      - Employee_ID

      To pass values to the fields used in the IMPORTING part of the function:
      - Name
      - Department

      You need to add he fields to the Record Selection Formula like:

          {Name} = "Smith" and {Department} = "Support"

      Once this is done, then the report will return the information for Mr. Smith in Support, which is the year of service and Employee ID in this case.
              
      Also, note that you can manually create Crystal Reports parameters, and substitute those values in the Record Selection Formula, so every time the report is refresh, you can enter different values without having to manually modify the Record Selection Formula every time.

Keywords

CR, ABAP Function , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

SAP Crystal Reports 2016 ; SAP Crystal Reports 2020 ; SAP Crystal Reports 2025