08-28-2007 1:44 PM
when we need parameters, the concept of formal and acutal perameters with simple examples...pl
08-28-2007 1:50 PM
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
08-28-2007 1:52 PM
Hi,
Look at the below link, you will understand
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db984635c111d1829f0000e829fbfe/content.htm
Regards
Sudheer
08-28-2007 1:58 PM
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,.
08-28-2007 2:28 PM
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 ***