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

Perform statement.

Former Member
0 Likes
1,132

Dear all,

may i know what is the differences between

-PERFORM form(prog)

-PERFORM form IN PROGRAM prog

it seems like both statement are calling the form from the program but what is the exact differences between them? Pls kindly advise.

Thanks and regards

YM

7 REPLIES 7
Read only

Former Member
0 Likes
1,070

first perform for executing form in current program

second for executing in program name specified

Read only

Former Member
0 Likes
1,070

Case 1 will work if your form is in an INCLUDE program in ur main program,

second will work for form in a totaly different program

Read only

Former Member
0 Likes
1,070

hi,

in ur syntax

first is for the local subroutine to execute in the current program itself.

second is when u want to access subroutine of some other program in current program we ll go for dat syntax.

if helpful reward some points.

with regards,

Suresh Aluri.

Read only

Former Member
0 Likes
1,070

Hi,

->in the first case the <b>form method</b> should be in the scope of the same program.

->in the second case the <b>form method</b> can be specified outside the program (that program is only specified as "IN PROGRAM prog").

<b>reward points if useful.</b>

regards,

Vinod Samuel.

Read only

Former Member
0 Likes
1,070

hi

good

Calls the subroutine form defined usng a

FORM statement. After the subroutine has finished, processing continues after the PERFORM statement. The parameters of the subroutine are position parameters, and must be passed in the call according to the definition of the formal parameters in the corresponding FORM statement.

Example

PERFORM HELP_ME.

...

FORM HELP_ME.

...

ENDFORM.

The PERFORM statement calls the subroutine HELP_ME.

go through this link which ll help you to clear your doubt.

http://help.sap.com/saphelp_46c/helpdata/en/34/8e72cc6df74873e10000009b38f9b8/content.htm

reward point if helpful.

thanks

mrutyun^

Read only

Former Member
0 Likes
1,070

Hi,

<b>Specifying Subroutines Dynamically</b>

You can specify the name of a subroutine and, in the case of external calls, the name of the program in which it occurs, dynamically as follows:

PERFORM (<fsubr>)[IN PROGRAM (<fprog>)][USING ... <pi>... ]

[CHANGING... <pi>... ]

[IF FOUND].

The names of the subroutine and the external program are the contents of the fields <fsubr> and <fprog> respectively. By using the option IF FOUND, you can prevent a runtime error from being triggered if <fprog> does not contain a subroutine with the name <fsubr>. If you omit the parentheses, this variant of the PERFORM statement behaves like the static variant.

<b>Calling Subroutines</b>

You call subroutines using the statement

PERFORM... [USING ... <pi>... ]

[CHANGING... <pi>... ].

Subroutines can call other subroutines (nested calls) and may also call themselves (recursive calls). Once a subroutine has finished running, the calling program carries on processing after the PERFORM statement. You can use the USING and CHANGING additions to supply values to the parameter interface of the subroutine.

With the PERFORM statement, you can call subroutines which are coded in the same ABAP program (internal calls), or subroutines which are coded in other ABAP programs (external calls). You can also specify the name of the subroutine dynamically at runtime, and call subroutines from a list.

Regards,

Bhaskar

Read only

Former Member
0 Likes
1,070

Thanks all for the contribution. Appreciate it.