Get Example source ABAP code based on a different SAP table
Parameter Passing This example demonstrates the difference between passing a parameter to a procedure by value or by reference.
ABAP_SOURCE_CODE DEMO CL_DEMO_PROCEDURE_PARAM
ABAP_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>.