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 function builder. 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.
To prepare a SAP data source:
Start the SAP Logon application.
Select the connected server and enter credentials:
Create a table type for returned data:
Start the SE11 transaction on the toolbar and select the Data Type radio button:
Set data type name starting with the letter Z, for example, Z_MEINS_STUDY_15.
Click the Create button. After executing the operation select the Table Type radio button in the popup window:
Fill in the boxes:
Brief Description. Enter description of the table <Units Dictionary>.
Row Type. Enter the <T006A> row type on the Row Type tab.
Click the Save button and activate the object using the button.
After executing the operations the Create Objects Catalog Record dialog box:
Attach the development to the package using the Local Object button.
Start the SE37 transaction on the toolbar.
Enter name of the new functional module Z_STUDY_MEINS_15 to the Functional Module box.
Click the Create button.
After executing the operation the Create Functional Module dialog box opens:
Attach the functional module to the Z_STUDY group of functions and set short text.
Click the Save button.
After executing the operation, the Function Builder dialog box opens:
Go to the Import tab in the Function Builder dialog box:
Parameter Name. Enter the parameter name <IV_MEINS>.
Reference Type. Enter the parameter reference type <MEINS>.
Select checkboxes of the Optional and Value Transfer parameters.
After executing the operations the Short Text box displays the Base Measurement Unit option.
Go to the Export tab in the Function Builder dialog box:
Parameter Name. Enter the parameter name <ET_DATA>.
Reference Type. Enter the previously created reference type <Z_MEINS_STUDY_15>.
Select checkbox of the Value Transfer parameter.
After executing the operations the Short Text box displays the Units Dictionary option.
Go to the Properties tab in the Function Builder dialog box:
Select the Remote Module radio button in the Execution Type group.
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.
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.
Activate the program using the button.
Start the program:
Test the program using the button.
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