Application Development 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: 

parameters....formal and actual parameters...

Former Member
0 Kudos

when we need parameters, the concept of formal and acutal perameters with simple examples...pl

4 REPLIES 4

Former Member
0 Kudos

Hi,

We need concept of formal and actual parameters in subroutines (Perform......Form).

<b>PERFORM file_upload TABLES i_upload USING g_file.</b>

i_upload and g_file are actual parameters.

<b>FORM file_upload TABLES ut_upload USING uv_file TYPE string.</b>

.

.

.

.

<b>endform.</b>

ut_upload and uv_file are formal parameters.

<b>Reward with points if it helps.</b>

Regards,

Amit

Former Member
0 Kudos

Hi,

Look at the below link, you will understand

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db984635c111d1829f0000e829fbfe/content.htm

Regards

Sudheer

Former Member

hi,

formal and actual parameters are used when u want to call a subroutine and wants to pass values to calling area.

for ex:

perform asb_disp using p_matnr, s_aluri....................

form asb_disp using p_matnr type i

s_aluri type s.

.............................

in the above ex the parameters used in perform are called as actual parameters which are used in subroutine calling and parameters which are defined in form are called formal parameters.

if helpful reward some points.

with regards,

Suresh Aluri,.

Former Member
0 Kudos

Hi Balaji..

We need parameters for Modularization and reuse of the code..

Suppose that your report have five internal tables and you have to consolidate(sum up) the records in the table. This way you will need the same logic 5 times..

So, instead of coding 5 times, we create a subroutine with parameters.. We will give a parameter type table to this subroutine and call this subroutine 5 times, passing the name of our 5 tables..

The formal parameters are the parameters that you define in the subroutine declaration.. FORM f_test_subroutine TABLES t_itab STRUCTURE e_itab

USING us_par1

CHANIGN ch_par2.

However, the actual parameters are the actual values passed to the subroutine while calling the subroutine..

PERFORM f_test_subroutine TABLES t_mytab

USING w_par1

CHANGING w_par2..

Thanks and Best Regards,

Vikas Bittera.

***Points for useful answers ***