07-10-2006 6:27 AM
hii frnds ..
can anybody tell me how to get the output in my smartforms that how many times a page have been printed out by a system ... like i hv made a smartform for voucher printing .. so i would have to output in the header that how many times the printing has been taken out ..
thanking you
rohit gupta
07-10-2006 6:31 AM
Hi,
The only way is to maintain a `Z` table and update it whenever print is clicked.
The same table can be accessed and the number of times it is printed can be populated on the screen field of smartform.
Best regards,
Prashant
07-10-2006 6:31 AM
There is no other way than tracking the system variable SFSY-FORMPAGES. But then this is a dynamic variable, so I am not sure how are you planning to use the same. Are your header and voucher two different smart forms?
Regards,
Ravi
07-10-2006 6:34 AM
well i am having only 1 smartform and header is a part of it .. but how will i acces the no of times the printing has been taken out of my voucher .. like if a declare a internal table .. then which field should i take and from which table .. to get the times of print out taken ..
07-10-2006 6:37 AM
i don't think there is any such type of command in sapscript/smartform.
ya u can only print the number of pages in sapscript/samartform.
07-10-2006 6:37 AM
Well there is no straight forward of doing this.
Can you explain the flow of the smart form, so that we can see if there is a work around for the same? What do you print first, header / voucher?
regards,
Ravi
07-10-2006 6:41 AM
its a voucher printing smartform .. just help me to print the no of time the print out has been taken place ..
07-10-2006 6:45 AM
If the user is printing multiple copies in one shot then you can find the no. of copies from the interface parameter SSFCOMPON-TDCOPIES.
In that case what you can do is to append the header information in a internal so many times as the no. of copies and then print the internal table. Appending of the header data to a internal table can be done using the PROGRAM LINES.
However, if the user is printing the form individually then there is no other way unless you are storing in a Z Table.
Regards,
Ravi
Note : Please mark all the helpful answers
07-10-2006 6:50 AM
well mr ravi just help to do this work wid the help of a ztable ... my reqrment is just to print the no of times the user has taken the print out of my voucher ... my smartform is of only 1 page ... if possible then suggest me wid any fm os any standard table which is having any fls that stores this counter ..
07-10-2006 6:54 AM
Well, create a Z Table with the form name and a counter field.
At the starting of the smart form, get the counter for the given form name and append the header details into a internal table so many times. Now, you can print the header as many times as the no. of times its printer.
At the end of the smart form write code to update the Z Table with the incremented counter so that the next time you get the right number.
Your table can container columns like this
MANDT
FORM NAME
COPIES.
Regards,
Ravi
Note : Please mark all the helpful answers
07-10-2006 6:51 AM
Hi,
Create a ZPRINT_PAGES table with following structure
MANDT
COPIES
In the Smartform Print program, the FM would return the number of copies printed as mentioned by Ravi. Include a logic to store that value in ZPRINT_PAGES.
l_new = <New value from Smartform FM>
update zprint_pages set copies = l_new
where copies = l_copies.
select copies
into l_copies
from ZPRINT_PAGES.
While calling the Smartform pass this value<l_copies> to the Smartform. Include logic in smartform to display this value.
Best regards,
Prashant
Message was edited by: Prashant Patil