I have copied the standard smartform of the Invoice into YLB_BIL_INVOICE and i did the modification according to the client's requirement.
In YLB_BIL_INVOICE, i have taken one window type as Copies Window and i have chosen the radio button Original and Copies. In the window I wrote the code for Copies like Original, Factory Copy, Buyer Copy, Triplicate and Marketing Copy based on SFSY-COPYCOUNT checking. I haven't changed the standard program(RLB_INVOICE).
And I have assigned the smartform YLB_BIL_INVOICE and RLB_INVOICE in NACE settings. When I am viewing the print using VF02/VF03 with output type which configured by SD Consultant it is not showing the Copies means if I mention Number of Copies as 4 in print preview it is showing only single Page and when I gave the print with number of copies as 4 Pages are printing 4 copies but the name of the copies is same for all 4 pages like 1st page as Original and 2nd page as Original etc..
I debugged the code and i am getting NAST-ANZAL = 1. in program, I think it should be 4. Please give me some input to resolve this issue?
Thanks n Regards,
Edited by: muraliabap on Feb 14, 2011 6:35 AM
Thank you for replying. I did what you mentioned, but my problem is when I am issuing the output in VF02 or VF03, if I mention the copies as 4 in preview it is showing only one that to Original, remaining are not showing and in Copies window i have chosen Original and copies with Differ option in Attributes.
Thanks n Regards,
I am not clear about the following context.
if I mention Number of Copies as 4 in print preview it is showing only single Page and when I gave the print with number of copies as 4 Pages are printing 4 copies
Where did you give the no of copies as 4? In the message or Print Dialog?
NAST-ANZAL is from message and OUTPUT_OPTIONS-TDCOPIES is from the Print Dialog. For copies window, no of copies is fetched through OUTPUT_OPTIONS-TDCOPIES (or the Print Dialog), thus SFSY-COPYCOUNT is changed accordingly .
Check the this [link|http://wiki.sdn.sap.com/wiki/display/ABAP/Copies(duplicate,etc.)]
Actually with out assigning my driver program and smartform in NACE, when I execute my driver program in the print there is a option called number of copies there if i enter 4 then i am getting the 4 pages with Original and Duplicates.
If i assigned in NACE and I am issuing the out put in VF02 or VF03 i am getting the pages with the same Original copy to all 4 pages. So, how can i resolve this issue?
As I have the another work in client's place I haven't seen your message. My Apologies for the same. After seeing your message I debug the code RLB_INVOICE and find the both values of NAST-ANZAL and LS_ITCPO-TDCOPIES are same but the value is 1, not 4.
Edited by: muraliabap on Feb 14, 2011 1:39 PM
I am not sure where you are giving the value 4.
Basically it can be given globally in Condition Records (tcode-VV32),
OR it can be given in the messages ( VF02->Issue Output To->Print Options->Number of messages [X-Print Immediately] )
OR if print dialog is enabled, it can be given in Number of copies block->Number.
Instead of going to Print Preview, try to issue (Print) the output directly.
I have created on copy window with option orignal and copy differ.
Now i have added three text element each with conditions SFSY-COPYCOUNT0 = 1. SFSY-COPYCOUNT0 = 2 and SFSY-COPYCOUNT0 = 3.
Now i have added orignal, copy1 and copy 2 in these three text elemnets.
These are working fine as u required.
Please try this.
Hope this will help.
I just checked the standard code
IF ls_composer_param-tdcopies EQ 0. nast_anzal = 1. ELSE. nast_anzal = ls_composer_param-tdcopies. ENDIF. ls_composer_param-tdcopies = 1. " Here it is defaulted DO nast_anzal TIMES. "... * call smartform invoice CALL FUNCTION lf_fm_name
Since ls_composer_param-tdcopies is defaulted as 1, you are not able to acheive SFSY-COPYCOUNT increment in smartform. According to the standard program, it is just repeating the output again and again which does help you for the copies window.
Solution here is go for Z program and change ls_composer_param-tdcopies as the way you need.