‎2007 Mar 01 9:08 AM
‎2007 Mar 01 9:10 AM
‎2007 Mar 01 9:10 AM
‎2007 Mar 01 9:13 AM
hi,
perform is for defining a Subroutine which are principally for local modularization, that is, they are generally called from the program in which they are defined. You can use subroutines to write functions that are used repeatedly within a program. You can define subroutines in any ABAP program.
you use it like.
perform <fname>.
and later you have to define a form with the name fname.
form <fname>.
// write your logic here.
endform
When you use this perform statment in your abap code, the control goes to the form and the code inside this form gets executed. once the control comes to endfrom, the control goes back to the next line of perform statemnt. it is just a modularization technique.
Regards,
Richa.
‎2007 Mar 01 9:13 AM
Hi,
A Subroutine can only be called within a program, will be destroyed/out of scope at outside the program, cannot be called from any other program.
Where as a Function module is availabe in SAP repository and can used in any no. of programs. It is having Scope in entire SAP repository. It can be declared globally and can be used in any program.
Also,
Subroutines cannot be called in different server
where functional module can be remotely called in another server.....
ABAP contains the following kinds of procedures:
Subroutines
Subroutines are principally for local modularization, that is, they are generally called from the program in which they are defined. You can use subroutines to write functions that are used repeatedly within a program. You can define subroutines in any ABAP program.
Function Modules
Function modules are for global modularization, that is, they are always called from a different program. Function modules contain functions that are used in the same form by many different programs. They are important in the R/3 System for encapsulating processing logic and making it reusable. Function modules must be defined in a function group, and can be called from any program.
Methods
Methods describe the functions and behavior of classes and their instances in ABAP Objects. Methods must be defined in classes. When you call them, you must observe certain special rules of object-oriented programming.
A subroutine is a block of code introduced by FORM and concluded by ENDFORM.
FORM <subr> [USING ... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ]
[CHANGING... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ].
...
ENDFORM.
Subroutines are procedures that you can define in any ABAP program and also call from any program. Subroutines are normally called internally, that is, they contain sections of code or algorithms that are used frequently locally.
Cheers,
Simha.
‎2007 Mar 01 9:13 AM
well u create a sub routine using form & end form ........2 call d subroutine u will use d perform keyword.
eg: Perform ABC
form abc
statmnt 1.
statmnt 2.
endform.
‎2007 Mar 01 9:20 AM
hi,
You call subroutines from ABAP programs using the PERFORM statement.
Subroutines are introduced with the FORM statement and concluded with the ENDFORM statement.
‎2007 Mar 01 10:52 AM
hi
in short and simple terms, i can u that Perform Formname statement is used to create subroutines which can be either internal or external.
regards,
shamim