Basic SAP Procedure

In a SAP data source a basic procedure is the functional unit where input parameter type is basic scalar or basic table. A basic table type is a flat table, and a basic scalar type is based on a basic simple ABAP type. According to SAP terminology, working is executed with export and import options in functions designer. Interaction between Foresight Mobile Platform and SAP NetWeaver Platform is executed via remote function call mechanism (RFC). Remote function calls are executed under the registered user of SAP NetWeaver Platform with mandatory specifying user login and password.

NOTE. Types of input parameters must be declared via vocabulary domains. For example, if the functional module string input parameter is declared with the "string" built-in ABAP type, the mobile platform displays the error that functional module is not a basic stored procedure. To avoid the error, the string parameter must be declared via a vocabulary domain.

The table below contains basic ABAP types and corresponding internal platform types used for development of basic procedure:

Basic ABAP types

Internal platform type

C

text

STRING (g)

text

N

text

D

text

T

text

I

bigint

b

bigint

s

bigint

P

double

F

double

X

bytea

XSTRING (y)

bytea

Detailed description of types is given in description of Predefined Elementary ABAP Types.

IMPORTANT. Basic ABAP types do not support NULL value. ABAP type D (date) supports special value 0000-00-00 that is absent in the Gregorian calendar. The value 0000-00-00 of ABAP type D corresponds to the "text" internal platform type. Other cases when the NULL value corresponds to ABAP value do not exist.

Example of Preparing SAP Data Source

To prepare a SAP data source:

  1. Start the SAP Logon application.

  2. Select the connected server and enter credentials:

  3. Create a table type for returned data:

    1. Start the SE11 transaction on the toolbar and select the Data Type radio button:

    1. Set data type name starting with the letter Z, for example, Z_MEINS_STUDY_15.

    2. Click the Create button. After executing the operation select the Table Type radio button in the popup window:

  1. Fill in the boxes:

  1. Click the Save button and activate the object using the button.

After executing the operations the Create Objects Catalog Record dialog box:

  1. Attach the development to the package using the Local Object button.

  2. Start the SE37 transaction on the toolbar.

  3. Enter name of the new functional module Z_STUDY_MEINS_15 to the Functional Module box.

  1. Click the Create button.

After executing the operation the Create Functional Module dialog box opens:

  1. Attach the functional module to the Z_STUDY group of functions and set short text.

  2. Click the Save button.

After executing the operation, the Functions Designer dialog box opens:

  1. Go to the Import tab in the Functions Designer dialog box:

Select checkboxes of the Optional and Value Transfer parameters.

After executing the operations the Short Text box displays the Base Measurement Unit option.

  1. Go to the Export tab in the Functions Designer dialog box:

Select checkbox of the Value Transfer parameter.

After executing the operations the Short Text box displays the Units Dictionary option.

  1. Go to the Properties tab in the Functions Designer dialog box:

Select the Remote Module radio button in the Execution Type group.

  1. Activate the functional module using the button.

NOTE. Activation may require to select a function in the local objects list. Select the created functional module Z_STUDY_MEINS_15.

After executing the operation the status bar displays the Object(s) is(are) Activated text.

  1. Go to the Source Text tab and create a program with the code:

DATA:
    lv_meins TYPE t006a-msehi,
    lr_meins TYPE RANGE OF t006a-msehi,
    ls_meins LIKE LINE 
OF lr_meins.

  
IF iv_meins IS NOT INITIAL.
    CALL 
FUNCTION 'conversion_exit_alpha_input'
      EXPORTING
        input  = lv_meins
      IMPORTING
        output = lv_meins.

    ls_meins = 
'IEQ'.
    ls_meins-low = lv_meins.
    APPEND ls_meins 
TO lr_meins.
  ENDIF.

  
SELECT * INTO CORRESPONDING FIELDS OF TABLE et_data
     
FROM t006a
    WHERE
    spras = 
'EN'
    
AND msehi IN lr_meins.

  1. Activate the program using the button.

  2. Start the program:

    1. Test the program using the button.

    2. Start the program using the Execute button or press F8:

After executing the operations the program is started.

After executing the program the export parameter contains the records:

To fully view program execution results, click the table icon.

To get data, an application developer can address the prepared data source via API requests.

See also:

Setting Up Integration with Table Data Sources | Basic Postgres Procedure