Ansicht
Dokumentation

ABENPROCEDURE_PARAM_ABEXA - PROCEDURE PARAM ABEXA

ABENPROCEDURE_PARAM_ABEXA - PROCEDURE PARAM ABEXA

CPI1466 during Backup   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

Parameter Passing

This example demonstrates the difference between passing a parameter to a procedure by value or by reference.

Source Code

Execute

Description

The method fibb calculates the sequence term with the number range in a Fibonacci sequence with the start values x and y. In this case, the next sequence term is always the sum of two previous sequence terms (that is, two start values). The method inherits two parameters, a structured parameter l_line with which input values are passed, and a parameter r of type i used to provide the result. Since the parameter l_line is defined as an IMPORTING parameter but still has to be changed in the method, the keyword VALUE must be set before the parameter when the method is defined. Otherwise, a syntax error occurs. This ensures that a local copy of the parameter is used within the method. The addition VALUE of the output parameter r assigns the result to the static class attribute res only after the method has been processed completely. Otherwise res would be changed for each step of the algorithm.

The internal table param contains the input values for calculating three different sequence terms of the Fibonacci sequence. The method fill_table is used to provide param with values and the method solve_table is used to calculate and output fibb for each line of param.






Fill RESBD Structure from EBP Component Structure   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 1657 Date: 20240427 Time: 053721     sap01-206 ( 55 ms )