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: 

in subroutines

Former Member
0 Kudos

hi

i have one subroutine in one report and that i want to use that in another report? how is it possible?

1 ACCEPTED SOLUTION

marcelo_ramos
Active Contributor
0 Kudos

Hi,

Try this way,

<b>PERFORM calculate IN PROGRAM zreport.</b>

Regards.

Marcelo Ramos

10 REPLIES 10

Former Member
0 Kudos

yes,

it is possible:

PERFORM form IN PROGRAM prog.

if helpful reward some points.

with regards,

Leo Ierardi.

Former Member
0 Kudos

u have this Perform command for it..

PERFORM subroutine-name IN PROGRAM prog-name.

Former Member
0 Kudos

Hi,

You can use it in the following way.

In the SAP SCRIPT you can write :

perform get_address using g_adrnr changing a1 a2 a3 a4

p1 'Address1' &a1& " Prnting it on the output form

P1 'Address2' &a2&

P1 'Address3' &a3&

P1 'Address4' &a4&

P1 is the paragraph in the sap script. YOu can use default paragraph if you wish.

" This will send the g_adrnr to the form. The form will accept g_adrnr and do the oprtations and return back a1 a2 a3 and a4.

a1 a2 a3 and a4 could be 4 fields you fetch from say ADRC table.

form get_address will be in the print program for your sapscript.

Please dont foget to reward if you find it useful.

reagrds,

ASHOK KUMAR

Former Member
0 Kudos

take photocopy of that report

Former Member
0 Kudos

Hi,

Try the creating program type 'Subroutnine Pool' from Tcode SE38. & use Perform subroutine statement in the report.

Reward points if helpful answer.

Ashvender

Former Member
0 Kudos

PERFORM routine-name(<b>rep-name</b>) USING comp1 comp2 CHANGING comp3.

rep-name : Report or program name where sub routine is defined.

Reward if useful

Regards

Prax

marcelo_ramos
Active Contributor
0 Kudos

Hi,

Try this way,

<b>PERFORM calculate IN PROGRAM zreport.</b>

Regards.

Marcelo Ramos

Former Member
0 Kudos

Hi,

I notice you are asking lots and lots of simple questions. I assume you have either an interview or you have been given a test to complete before an interview?

These forums are for helping people out with proper SAP related problems, not helping people to bluff through exams/interviews... Please stop asking all of these questions - if you don't know the answers you shouldn't be going for the job.

Gareth.

(What amazes/annoys me more is the number of people who reply to these questions looking for points...)

0 Kudos

hi

if u dont want to give the answer , dont give. y r u forcing others , not to do. this is not correct

0 Kudos

Hi,

I'm not forcing anyone to do anything. If people want to answer these questions just to get the points then fine by me.

In reality, there is only 1 answer to these sort of questions - read help.sap.com and use the F1 key in the ABAP editor - learn to help yourself. If that doesn't find you the answer then try searching these forums. Not surprisingly, questions like this have been asked lots of times before so if you searched you would find an answer. Lots and lots of people read these SDN forums to gain knowledge and help with problems - if a lot of what seem like interview questions are posted it just gets in the way of the proper content.

If you don't already know this stuff and are going for an interview for a job doing it then that is not correct... If you are simply trying to learn ABAP then posting numerous basic questions in here isn't the way to do it. Try looking on Amazon for ABAP books or consider buying through SAPPress - there are a multitude of books that explain the basics through to complicated levels of ABAP.

Gareth.