cancel
Showing results for 
Search instead for 
Did you mean: 

subroutine problem.

Former Member
0 Kudos

Hi, all.

May i know how to run the PERFORM subroutine for just one time only in sapscript ??

PERFORM READ_ADRNR IN PROGRAM ZYX

USING &EKPO-ADRNR&

CHANGING &ADRNR&

ENDPERFORM

Bcz the routine will run a lot of times, but i just want the first record/data only. what sohuld i do?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi jiansi,

Create two pages:

page next page

first page---->second page.

second page--->second page

In first page create the variable window in that write the perform.

In second page display the data as per your requirement.

Regards,

Sravanthi

Former Member
0 Kudos

sorry...i wrong state already.

What i mean is, inside the main window in sapscript there, i have a perform routine. As we know, the routine will run repeatly. But I want take out the first and the only data, others will be ignored.

My problem now is each time after execute the program, the output result show out the final result. What i want is the first data.

What should i do in the script editor in main window (PERFORM)? or modify my print/report program (FORM) ?

tnx in advance.

Former Member
0 Kudos

if &v_flag& ne 'X'.

perform your_subroutine using v_flag

other_parameters.

endif.

inside the the perform after fetching all your data

set v_flag = X.

declare the v_flag globally in sap script driver program.

That does it.

Former Member
0 Kudos

Hi,

try this....

In your driver program... loop - endloop

loop at ekpo.

at first.

call the function module "Write_form"

with the window and text element name which has the perform statement

endat.

endloop.

regards

padma

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

It depends on when u have insert that perform: in which window? in which text elements?

U should insert it in a secondary windows placed in the first page only or in a text element u call once.

Max

Edited by: max bianchi on Sep 22, 2008 6:35 PM

Former Member
0 Kudos

If insert that perform in which main window ?

I know that the PERFORM will run repeartly until all the data are processed.

But my situation now is i just want to get the first record once the PERFORM runs for it's first time, others data are ignored.

so what should i do?

Thanks in advance.