ABAPCALL_FUNCTION_PARAMETER - CALL FUNCTION PARAMETER
ROGBILLS - Synchronize billing plans Addresses (Business Address Services)This documentation is copyright by SAP AG.
CALL FUNCTION - parameter_list
Syntax
... [EXPORTING p1 = a1 p2 = a2 ...]
[IMPORTING p1 = a1 p2 = a2 ...]
[CHANGING p1 = a1 p2 = a2 ...]
[TABLES t1 = itab1 t2 = itab2 ...]
[EXCEPTIONS [exc1 = n1 exc2 = n2 ...]
[error_message = n_error]
[OTHERS = n_others] ].
Additions
1. ... EXPORTING p1 = a1 p2 = a2 ...
2. ... IMPORTING p1 = a1 p2 = a2 ...
3. ... CHANGING p1 = a1 p2 = a2 ...
4. ... TABLES t1 = itab1 t2 = itab2 ...
5. ... EXCEPTIONS exc1 = n1 exc2 = n2 ...
6. ... error_message = n_error
7. ... OTHERS = n_others
Effect
With the exception of the EXCEPTIONS addition, these additions assign the actual parameters a1,a2, ... to the formal parameters p1, p2, ... or t1, t2, ... of the parameter interface of the function module in func. All data objects whose data typematches thetypingof the appropriate formal parameter can be specified as actual parameters. Each formal parameter assumesall the properties of the actual parameter assigned to it when it is called. You can handle non-class-based exceptions using the addition EXCEPTIONS. The order of the additions is fixed.
In Unicodeprograms, an exception that cannot be handled is raised whenever an incorrect formal parameter andthe name of the function module are specified by a constant or as a literal. If the name of the function module is specified by a variable and is innon-Unicode programs, the specification of an incorrect formal parameter is ignored.
Addition 1
... EXPORTING p1 = a1 p2 = a2 ...
Addition 2
... IMPORTING p1 = a1 p2 = a2 ...
Addition 3
... CHANGING p1 = a1 p2 = a2 ...
Effect
The additions EXPORTING, IMPORTING, and CHANGING assign actual parameters to theinput, output, and input/output parameters of the called function module. The syntax and meaning ofthese additions are the same as for CALL METHOD.
Addition 4
... TABLES t1 = itab1 t2 = itab2 ...
Effect
With the addition TABLES, internal tables itab1, itab2, ... must be assigned to all non-optional table parameters t1, t2, ... of the called function module. For itab1, itab2, ... , onlystandard tables can be specified. The data is passed using a reference (with the exception ofRFC). If a specified table itab1, itab2, ... has aheaderline, this is also passed. Otherwise, the header line of the corresponding table parameter t1, t2, ... is initial after the call.
Addition 5
... EXCEPTIONS exc1 = n1 exc2 = n2 ...
Addition 6
... error_message = n_error
Addition 7
... OTHERS = n_others
Effect
You can use EXCEPTIONS to assign return codes tonon-class-basedexceptions exc1, exc2, ... The syntax and meaning of the addition are the same asfor CALLMETHOD, with the exception that a predefined exception error_message can be specified here. If no exception is raised, a function module call sets sy-subrc to 0.
If the addition error_message is specified after EXCEPTIONS, all messages
- that are sent using the statement MESSAGE without the addition RAISING or
- that are sent by the ABAP runtime environment
during function module processing are affected as follows:
- Messages of the type S, I, or W are not sent but are flagged in the log inbackground processing.
- Messages of the type E and A raise the exception error_message and set sy-subrc to n_error.The message class, message type, message number, and the contents of possible placeholders for the MESSAGEstatement are in the fields sy-msgid, sy-msgno, sy-msgty, and sy-msgv1,... sy-msgv4. With messages of the type A, the ROLLBACK WORK statement is also executed explicitly. For information about behavior inbackground processing, seemessages in background processing.
- Messages of the type X are not affected. As always, they cause a program termination with a short dump.
If the RAISING addition is specified in a MESSAGE statement within the function moduleand a return code is assigned to the corresponding exception exc1, exc2, ..., then sy-subrcis set to this code. If no return code is assigned to the exception after RAISING, the message is influenced, as described above, by the error_message addition.
Function modules can pass on class-based exceptions if exception classes are specified in theFunction Builder. In this case, the EXCEPTIONS addition must not be specified.
Notes
- When handling messages with the predefined exception error_message, it does not make a differencewhether the message is sent in the current function module or in a module that is called by this functionmodule. Unlike the exceptions raised by the statement RAISE,messages sent using the statement MESSAGE are propagated across calling levels.
- When continuing with a program after handling a type A message, note that a complete ROLLBACKWORK was carried out, and not just a database rollback.
- For the addition EXCEPTIONS. CALL FUNCTION also has anobsolete short form, in which the return code =n can be omitted after a specified exception. If an exception is raised, the value 1 is assigned to sy-subrc implicitly. The return code must always be specified explicitly, however.
- For RFC,specifying EXCEPTIONScontrols whether class-based exception handling or classic exception handling takes place (as of Release 7.1, EhP1).
- Among other situations, the ABAP runtime environment sends messages when automatic checks are made onscreen input. These messages are caught using the addition error_message, as are messages sent using MESSAGE.
Example
Calling the function module GUI_DOWNLOAD for saving the content of an internal table to a file on the currentpresentationserver. The name of the function module is specified as a literal, which is the most frequent type of specification in static parameter assignment.
DATA: line TYPE c LENGTH 80,
text_tab LIKE STANDARD TABLE OF line,
fleng TYPE i.
...
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'c:\temp\text.txt'
filetype = 'ASC'
IMPORTING
filelength = fleng
TABLES
data_tab = text_tab
EXCEPTIONS
file_write_error = 1
invalid_type = 2
no_authority = 3
unknown_error = 4
OTHERS = 10.
CASE sy-subrc.
WHEN 1.
...
...
ENDCASE.
Vendor Master (General Section) ROGBILLS - Synchronize billing plans
This documentation is copyright by SAP AG.
Length: 12690 Date: 20120518 Time: 200310 triton ( 333 ms )






