cancel
Showing results for 
Search instead for 
Did you mean: 

Help me, its Urgent

Former Member
0 Kudos

Hi All,

How to print different text in different copies?

How to code or settings for the above requirement?

Thanks & Regards

SEK

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

The requirement which I understand is that, you want different copies of the same smartform with different texts.

For this,

1. Create a window of type 'Copies Window'.

2. Enter code lines as:

IF sfsy-copycount = 001.

text = ABC'.

ELSEIF sfsy-copycount = 002.

text = 'XYZ'.

ELSEIF sfsy-copycount = 003.

text = 'DEF'.

ENDIF.

give count = as many copies as you want.

3. Print this text.

When printing this form, give number of copies = as many copies as you want.

Hope this helps.

Thanks,

Dawood.

Former Member
0 Kudos

Hi Dawood,

Thank you for your reply, I think you given code is partially helpful for me.

The Same requirement how to implement in SAPScript

Thanks

SEK

Former Member
0 Kudos

Hi,

Try this,

Data: wa_options type ITCPO.

wa_options-TDCOPIES = '3'. (no. of copies you want)

Then call the function module.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

DEVICE = 'PRINTER'

DIALOG = 'X'

FORM = 'ZSCRIPT'

LANGUAGE = SY-LANGU

OPTIONS = wa_options.

With this you will get the required number of copies, but, how to get the texts on those is to be explored.

Thanks,

Dawood.

Former Member
0 Kudos

For SAP Scripts.

do not use tdcopies if you want different texts on each copy.

You will have to call the script in a loop.

The number of times the loop is called shud be equal to the number of copies

You can then change the data accordingly in each loop so different data prints

loop at copycount

if count = 1.

texte = 'original'.

else.

text = 'Copy text'

endif.

OPEN_FORM....

endloop

former_member184657
Active Contributor
0 Kudos

well..

suppose u want to display Orginal copy in the first page and duplicate copy in the second page.

then put this text field in a window and make it a "COPIES WINDOW" in the attributes.

then create 2 text fields under it for the original copy and the dupluicate copy text.

and then in the conditions tab of these text fields type this

SFSY-COPYCOUNT = '001'

SFSY-COPYCOUNT = '002'

respectively.

after that while giving print preview, in the number of copies option give '2'.

then u can see the same output in 2 diff pages, with the only diff being the "original copy" and "duplicate copy" text.

revert back if u have any doubts,

as always

pk

Former Member
0 Kudos

Hi,

Thank you for your reply

Actually my requirement was, i want print on copies not on pages.

For each copy have multipla pages..

Thanks

SEK

former_member184657
Active Contributor
0 Kudos

i guess tats exactly what u are looking for.

for every new copy(not page) the text wud change.

try it

pk