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

help please

Former Member
0 Likes
682

wat does perform keyword will do

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
654

Hi,

It is used to define the SUBROUTINES.

Regards,

Anji

6 REPLIES 6
Read only

Former Member
0 Likes
655

Hi,

It is used to define the SUBROUTINES.

Regards,

Anji

Read only

Former Member
0 Likes
654

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.

Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
654

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.

Read only

Former Member
0 Likes
654

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.

Read only

Former Member
0 Likes
654

hi,

You call subroutines from ABAP programs using the PERFORM statement.

Subroutines are introduced with the FORM statement and concluded with the ENDFORM statement.

Read only

Former Member
0 Likes
654

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