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

subroutine

Former Member
0 Likes
542

how to call a subroutine from one program to another program?

4 REPLIES 4
Read only

Former Member
0 Likes
510

Hi

PERFORM SUBOUTINE(PROGRAM_NAME).

Regards,

Ravi

Read only

Former Member
0 Likes
510

Hai Kiran

1) Subroutines are programming modules which can be called from ABAP/4 programs.

Frequently used parts of program can be put into subroutines and these subroutines can be called explicitly from the program.

We use subroutines mainly to modularize and structure our program.

2) A subroutine is a block of code introduced by ‘FORM’ and concluded by ‘ENDFORM’.

FORM

ENDFORM.

3) PERFORM form.

Calls the subroutine form defined using 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.

4) You list these parameters after USING or CHANGING without the VALUE addition:

FORM

ENDFORM.

Thanks & Regards

Sreenivasulu P

Read only

Former Member
0 Likes
510

Hi Kiran,

U can call subroutine from another program using the following sytax..

PERFORM <Subroutine_name> IN PROGRAM<prog_name> IF FOUND.

Regards,

Tanveer.

Please mark helpful answers

Read only

Former Member
0 Likes
510

Hi Kiran,

You can call subroutine in another program with the following syntax.

PERFORM <subroutine> IN PROGRAM <program_name>.

You can call dynamic subroutines in another program with the follwoing syntax.

PERFORM <b>(subroutine)</b> IN PROGRAM <program_name>.

At the runtime, the name of subroutine is called in another program.

You can call subroutine in dynamic program with the following syntax.

PERFORM <subroutine> IN PROGRAM <b>(program_name)</b>.

You can have both subroutine and program as dynamic.

PERFORM <b>(subroutine)</b> IN PROGRAM <b>(program_name)</b>.

Thanks,

Vinay