cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple copies in sapscript

Former Member
0 Kudos

Hi All,

I need multiple copies as output from a SAPScript. But my print prog is standard and script is z.

I have to print 'Original' in the first copy, 'Duplicate in the second copy and 'Triplicate' in the thrid copy etc..

Is this possible in sapscript without changing the print program?

Thanks in advance,

Neerja

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

you can call perform like below

PERFORM GET_DATA IN PROGRAM YABC

USING &XYZ&

TABLES &I_TAB&

/: DEFINE &ZGW01&

/: PERFORM CALCULATE IN PROGRAM Z_CALCULATE

/: USING &AFVGD-VGW01&

/: CHANGING &ZGW01&

/: ENDPERFORM

In the program i make this:

REPORT Z_CALCULATE.

FORM CALCULATE TABLES IN_TAB structure itcsy

OUT_TAB structure itcsy.

DATA: ZGW01 LIKE AFVGD-VGW01.

Read table IN_TAB index 1.

ZGW01 = IN_TAB-VALUE * 2.

Read table OUT_TAB index 1.

MOVE ZGW01 TO OUT_TAB-VALUE.

Modify OUT_TAB index 1.

ENDFORM.

this is the repeat output.......

SELECT objky

kschl

erdat

eruhr

vstat FROM nast INTO TABLE gt_date

WHERE objky EQ gv_del_num.

IF sy-subrc EQ 0.

SORT gt_date BY objky erdat DESCENDING .

DESCRIBE TABLE gt_date LINES lv_n.

IF lv_n GT 1.

gv_repeat = lc_x.

ENDIF.

READ TABLE gt_date INTO gwa_date INDEX 1.

ENDIF.

Former Member
0 Kudos

Hi Chenna,

You are setting a flag to repeat based on the internal table rows in gt_date. Will this table not have a single row every time?

After setting a flag to repeat how do we use it in the script layout to print multiple times.