Application Development 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: 

using external subroutine

Former Member
0 Kudos
58

my subroutine is written in one program.

I m using it in another program.

i checked with the breakpoint...

The control goes to the subroutine fetches the data in the structure but when the control returns to the main program the structure is empty.

Now wat should i do either write the routine in the same program or have to use import & export memory which is best based on performance.

3 REPLIES 3

Former Member
0 Kudos
35

Hi Ram,

Do you call the subroutine with PERFORM (.....) CHANGING <output-structure>? IF the structure is only used locally in the other program it will never get into the calling program.

Regards,

John.

former_member181962
Active Contributor
0 Kudos
35

Why not have the Changing addition to the subroutine?

as in:

perform add using num1 num2 changing sum.

Regards,

Ravi

Former Member
0 Kudos
35

hi

let us also the location of the subroutine..i mean in differnt client no or in the same. If the subroutine is in the same client no..then you can use the Perform statement in the sapscript to call the extra functionality from the print program or in any location but with in the same system(client).

In case of external subroutine, i think you need to use the client-specified statement in the print program while selecting the data.

eg.

select f1

f2

f3

from zzkna1

into i_tab

cleint-specified where mandt = <client no from where you are fetching the data>

this may work.

regards,

shamim.