17.08.2013 Views

Data Interfaces

Data Interfaces

Data Interfaces

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Local Call of Function Modules<br />

ABAP/4 function module ...<br />

Import parameter Reference field Ref. type Proposal Optional Reference<br />

f1 ...<br />

Export parameter Reference field Ref. type Reference<br />

f2 ...<br />

Changing parameter Reference field Ref. type Proposal Optional Reference<br />

f3 ...<br />

Tables parameter Reference field Optional<br />

t1 ...<br />

...<br />

CALL FUNCTION 'TEST'<br />

EXPORTING<br />

f1 = a1<br />

© SAP AG<br />

ABAP/4 program ABAP/4 function module<br />

IMPORTING<br />

f2 = a2<br />

CHANGING<br />

f3 = a3<br />

TABLES<br />

t1 = tab<br />

The function<br />

module is<br />

executed locally<br />

in the same<br />

R/3 System.<br />

FUNCTION TEST.<br />

...<br />

ENDFUNCTION.<br />

In R/3, function modules are ABAP/4 programs which are stored centrally in the Function Library.<br />

They can be called locally by any ABAP/4 program. Function modules are similar to functions in C, and<br />

procedures in PASCAL or COBOL. Both C functions and PASCAL or COBOL procedures are also<br />

stored in a central library.<br />

Function modules have a defined interface. Input parameters are passed to them via the IMPORTING<br />

or CHANGING interface. Single result parameters can be returned via the EXPORTING and<br />

CHANGING interface, but internal tables are passed to the TABLES interface. When creating a<br />

function module, you can define IMPORTING parameters as optional. Since they have a predefined<br />

value, you do not have to assign a value when calling a function module.<br />

Interface parameters should reference Dictionary reference structures.<br />

CHANGING parameters contain fields or field strings which can be passed from the program to the<br />

function module when the function module is called, and returned to the calling program when the<br />

processing of the function module has finished.<br />

For each function module, you can raise exceptions which the function module can trigger if an error<br />

occurs.<br />

You maintain function modules with Transaction SE37.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!