cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in Original & Duplicates copy of scripts

Former Member
0 Kudos

Hi Friends,

I got one issue in Scripts. I want to print 3 copies. In that script, first copy should display 'Original' and other 2 copies doesn't display anything. Now I have created a Original window, but it is displaying 'Original' for all the 3 copies. How to restrict 'Original' only for first copy? Please help me.

Regards,

Sruthi.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Think a bit more about what can/shall happen there are way more possibilities.

1. you print your form with 3 copies, 1 should have "original" on it and the 2 copies not. Now you print it again with 3 copies, what shall happen? Again the same? Or should none of the 3 newly printed form have original on it?

Former Member
0 Kudos

Whenever the script is executing it should have 3 copies. In that 1st copy should have text 'Original' and others should not have.

But here in my issue, it is all the 3 copies having 'Original' text.

Former Member
0 Kudos

well yeah, i understand that problem. What i wanted to know is, if you print your 3 copis a second time, should the first one again be original? That would be a really rare requirement since in case it is a 1 original and 5 copies then and not 2 originals and 4 copies.

I hope you got my point.

Anyway normally you check for NAST-records.with vstat 1. Means you do a select on table NAST with KSCHL, OBJKY and VSTAT = 1. if sy-subrc <> 0, print original, otherwise print copy or nothing.

This approach results in just the first one will be named "original" and every following not, even if you print it half a year later.

If you need to print original on the first one again when doing this for a second time i´d propose to install a counter variable in your driver program, which counts the number of the actual copy beeing printed. Then print "original" only if it is 1.

Former Member
0 Kudos

you can try this way.

in your Print Program

data : lv_n type n.

lv_n = 1.

loop itab.

if lv_n =1 . here 1 is your first page..

call wirte form with element like 999

in your script

/E 999

original text

endif.

lv_n = lv_n + 1.

endloo