Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

subroutines

Former Member
0 Likes
402

I wanted to know the difference between the parameters present in the perform and parameters present in the form statement using and changing options that r mentioned in form.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
384

Under USING we specify those parameters whose value will b needed in the PERFORM for say som calculation etc..but itself wont be changed during these operations..its value will b used n not changed..

while under CHANGING v specify those parameters whose value cud b changed during the operations in th PERFORM.it will hav som value while being passed..however by the end of PERFORM operations it wud be changed unlike the USING parameters

Hope dis helps..

Reward if it does

I wanted to know the difference between the parameters present in the perform and parameters present in the form statement using and changing options that r mentioned in form.

2 REPLIES 2
Read only

Former Member
0 Likes
385

Under USING we specify those parameters whose value will b needed in the PERFORM for say som calculation etc..but itself wont be changed during these operations..its value will b used n not changed..

while under CHANGING v specify those parameters whose value cud b changed during the operations in th PERFORM.it will hav som value while being passed..however by the end of PERFORM operations it wud be changed unlike the USING parameters

Hope dis helps..

Reward if it does

Read only

Former Member
0 Likes
384

Hi,

These additions define formal parameters parameters. Formal parameters can be used in the subroutine as data objects on all operand positions that match their typing and their changeability defined by USING or CHANGING.

When you define the formal parameters parameter, you have the option of defining either pass by reference or value. The effect of this definition for formal parameters defined with USING and CHANGING is as follows:

Pass by reference for USING parameters

For the formal parameters p1 p2 ..., no local data object is created in the subroutine. Instead, when it is called, a reference is passed to the specified actual parameter. A change to the formal parameter in the subroutine also changes the value of the actual parameter.

Pass by reference for CHANGING parameters

The formal parameters p1 p2 ... are handled exactly like those parameters defined for pass by reference using USING.

Pass by reference for USING parameters

For each formal parameter p1 p2 ..., a local object with the same data type as the corresponding actual parameter is created in the subroutine and filled with its values. A change to the formal parameter in the subroutine does not change the value of the actual parameter. The actual parameter also retains its original value even after the subroutine has ended.

Pass by reference for CHANGING parameters

For each formal parameter p1 p2 ..., a local data object with the same data type as the corresponding actual parameter is created in the subroutine and filled with its values. A change to the formal parameter in the subroutine does not directly change the value of the actual parameter. If the subroutine is ended using ENDFORM, RETURN, CHECK or EXIT however, the content of the formal parameter is assigned to the actual parameter. If the subroutine is ended by a message or an exception, the actual parameter remains unchanged.

Plzz reward points if it helps.