‎2007 Apr 29 10:13 AM
‎2007 Apr 29 10:43 AM
Dear Balu,
Actual and formal parameters are used in modularization technique while calling a subroutine. Generally we use subroutines using PERFORM statement and the functionality of this subroutine is defined at the end of the program using FORM and ENDFORM statements. The variables used in perform statement are called ACTUAL PARAMETERS and the variables used in form, endform statements are called FORMAL parameters. During the program execution these actual parameters are passed to the formal parameters. We can use the same variable name for both actual and formal parameters.
EXAMPLE:
data: n3 type i.
parameters: n1 type i,
n2 type i.
perform addition using n1 n2 n3. " n1, n2, n3 are actual parameters.
write:/ n3.
form addtion using a b c. " a, b and c are formal parameters.
c = a + b.
endform.
Regards
Biswaranjan.
‎2007 Apr 29 10:43 AM
Dear Balu,
Actual and formal parameters are used in modularization technique while calling a subroutine. Generally we use subroutines using PERFORM statement and the functionality of this subroutine is defined at the end of the program using FORM and ENDFORM statements. The variables used in perform statement are called ACTUAL PARAMETERS and the variables used in form, endform statements are called FORMAL parameters. During the program execution these actual parameters are passed to the formal parameters. We can use the same variable name for both actual and formal parameters.
EXAMPLE:
data: n3 type i.
parameters: n1 type i,
n2 type i.
perform addition using n1 n2 n3. " n1, n2, n3 are actual parameters.
write:/ n3.
form addtion using a b c. " a, b and c are formal parameters.
c = a + b.
endform.
Regards
Biswaranjan.
‎2007 Apr 30 8:35 AM
hi,,
Actual parameters r those values wht we pass they n formal parameters r those that r created as refernce paramenetrs for actuall parameters....
for eg;
parameters : a type i,
b type i.
data : c type i.
perform add using a b. ( Here a b r the actualparameters.
form add using x y. (Here x y r the formal parameters taken as reference of a b parameters.)
c = x + y.
write 😕 c.
endform.
After writing perform statement just double click on add n click on continue it will cretaed the formal parameters on it own.
with regards,
madhuri. n if useful reward with points.
‎2007 Apr 30 8:38 AM
refer the link
http://help.sap.com/saphelp_47x200/helpdata/en/9f/db979d35c111d1829f0000e829fbfe/frameset.htm
Regards
Nilesh
‎2007 Apr 30 8:41 AM
hi,
parameters defined in FORM/ENDFORM are formal parameters.
else are actual parameters.
thanks and regards
shyam
‎2007 Apr 30 8:49 AM
HI,
The Actual params are the one which u actually send to the subroutine..
See here..
data: a,b,c
perform data_process using a b c.
"a, b, c are actual parameters.they forward the values into the subroutine..
This parameters should be define before itself as above
When comes to Formal.. The formal parameters are the one formal to actual..
FORM data_PROCESS using f_a type char
f_b type char
f_c type char.
"f_a, f_b, f_c are forma paramss./
remember one this these F_A,f_b, f_c are not defined so we need to define their character type as above..
Using -- is just for using the value.
Changing-- it uses the value and changes too..
reward if useful
regards,
nazeer