on 09-07-2009 8:33 AM
Hi guys..
my requirement is for smart forsms. I have custom print program and custom smartform.
In the selection screen: i have option of number of copies.
for every copy, I need to print "ORIGINAL", "DUPLICATE" and "TRIPLICATE"
I am able to achive the functionalit, but I have two issues.
1) I do not want printouts. Just spool requests are sufficient. but now i am getting printouts and spools.
2) I am getting 3 times of printouts than required. in spool i am getting as per the requirement.
example: no of copies in selection screen :2. It means, 2 original, 2 duplicates, 2 tripcates to be printed ie TOTAL->6.
But now I am getting 6 original, 6 duplicate and 6 triplicate ie, total 18 instead of 6.
It may be bacuse, I am hard coding
wa_ssfcompop-tdcopies = 3.
If I do not do this, "original" "duplicate" triplicate" concept is not working for the forms( I used copy window to achive this in smartform)
my logic is as follows.
-
start-of-selecton
wa_ssfcompop-tdcopies = 3.
wa_ssfcompop-tdimmed = ' '. " no print immediately
wa_ssfcompop-tdnoprev = 'X'. "NO PRINT PREVIEW
wa_ssfcompop-tdnewid = 'X'. "no spool ID
wa_ssfctrlop-no_dialog = 'X'. "SAP Smart Forms: General Indicator
-
DO s_copy TIMES. (s_cpoy is selection screen copy)
PERFORM call_function_module.
ENDDO.
SP01, spool requests are perfect and able to see the SPOOL IDs are generated based on the no. of copies we provide in selection screen.
Problem(3 TIMES OF PRINT OUTS) is with the PRINTER?????
If there is need to improve the code to acieve this, please help me.
Hi Puneindia,
Did you try chacking the parameter user_seting during function call and your user default settings?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try like this :
do 2 times. (2 is the value from Selection screen)
do 3 times. (3 no of copies every time)
SSFCTRLOP-NO_DIALOG = 'X'.
SSFCOMPOP-TDNEWID = 'X'.
SSFCOMPOP-TDNOPREV = 'X'.
CALL FUNCTION l_fmname
xxxxxxxxx
xxxxxxxx
enddo.
enddo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Venky,
We do like this.
But this will lead to performance issues.
as we use do 3 times...total time execution will be 3 times than anticipated.
As input selection screen has select options ie multiple documents(BKPF), time execution is too much for more documents.
That is the reason, SAP provides COPIES window in smart form and variable SFSY-COPYCOUNT.
Hi,
I know it leads to more execution time..But in this case TDCOPIES field value is not working fine. I had already tested here with small example...But any how
you must call the fields
SSFCTRLOP-NO_DIALOG = 'X'.
SSFCOMPOP-TDNEWID = 'X'.
SSFCOMPOP-TDNOPREV = 'X'. before Call function . Then only it will working..means generating new spools
Venky,
code is as mentioned in the thread
my logic is as follows.
-
start-of-selecton
wa_ssfcompop-tdcopies = 3.
wa_ssfcompop-tdimmed = ' '. " no print immediately
wa_ssfcompop-tdnoprev = 'X'. "NO PRINT PREVIEW
wa_ssfcompop-tdnewid = 'X'. "new spool ID
wa_ssfctrlop-no_dialog = 'X'. "SAP Smart Forms: General Indicator
-
DO s_copy TIMES. (s_cpoy is selection screen copy)
PERFORM call_function_module.
ENDDO.
I also tried with
DO s_copy TIMES. (s_cpoy is selection screen copy)
wa_ssfcompop-tdcopies = 3.
wa_ssfcompop-tdimmed = ' '. " no print immediately
wa_ssfcompop-tdnoprev = 'X'. "NO PRINT PREVIEW
wa_ssfcompop-tdnewid = 'X'. "new spool ID
wa_ssfctrlop-no_dialog = 'X'. "SAP Smart Forms: General Indicator
PERFORM call_function_module.
ENDDO.
Still same problem.
Are you useing header level output type, it is poassible item level out put only.
in your case each documnet needs print 3 copies, like ORIGINAL", "DUPLICATE" and "TRIPLICATE.
first create output type in item level, then each item needs to append 3 times with page numbers 1,2,3.....
in your code should be like
for item 10
page number 1 = ORIGINAL
page no 2 = DUPLICATE
page no 3 = TRIPLICATE.
for item 20 ( here also appned page number 1,2,3...
page number 1 = ORIGINAL
page no 2 = DUPLICATE
page no 3 = TRIPLICATE.
try this way it may resolve your problem....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kesava,
Each document may contain more than 1 page also.
In main window, there are so many line items.
I could not get clear idea of your sugestion. Please elaborate it.
I can achive the requirement, without using td-copies & copy window.Like, in the loop do 3 times...call FM...based on sy-index..we can pass sy-index....to samart form through interface parameter.....sy-index 1->original...2->du..3-> trip...
But this solution could have performance issue.
Because, input selection screen have select-options...some times there can be 100 different records of BKPF.
Hi,
Did you try my reply above? let me know how u r geting the printouts?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Venky,
I am printing directly. NOT from the Spool.
1) when I give 1 in the selection screen, td- copies = 3 in code,
i am getting 3 original , 3 duplicate and 3 triplicates instead of 1 original, 1 dup, 1 tripl.
2)even i am printing directly, in the spool, it is showing correctly. I mean, when s_copy =2, 2 spools are generated. each spool contain 1 org, 1 dup and 1 trip.
Based on your idea...of changed parameters in SP01..i already checked.. There it is showing 3 rather than 1.
I did not try to print by changing 3 to 1 As, printouts are already printed(3 times). No point of trying this, with out solving, how to stop printouts from code.
Even if, if we resolve this, no use. because, in my requirement, i am generating somany documents from BKPF(based on BUKRS, BELNR, GJAHR). So in this case, may be some times 100 documents need to be printed. End user may not be interested to check each spool and print manually.
What ever we do, better we need to do through ABAP code in print program.
I am also thinking that, this problem arises may be due to printer settings.
Edited by: puneindian on Sep 8, 2009 7:13 AM
Hi,
Firstly to stop the direct printing, check if you are not passing space in the paramete user_setting and pass the printer details, because there are chances that the user setting defaults for you is maintained to print immediatly.
once the direct printing is solved then wil think about the other issue.
Hi,
I dont think you should use both of these following statements -
wa_ssfcompop-tdcopies = 3.
and
DO s_copy TIMES. (s_cpoy is selection screen copy)
PERFORM call_function_module.
ENDDO.
the reason for printing 6 copies of each original, duplicate and triplicate are -
if you make wa_ssfcompop-tdcopies = 1. In that case, it will print 1 original, 1 duplicate and 1 triplicate. Thus, by keeping wa_ssfcompop-tdcopies = 3, you are printing 3 originals, 3 duplicates and 3 triplicates i.e. 9 cpoies. Addition to that, you are calling the smartform twice i.e. DO s_copy TIMES. (assuming s_copy = 2), hence it is printing 18 copies in total i.e. 9 copies eac time.
So, you can solve your problem in two ways -
either,
wa_ssfcompop-tdcopies = 1.
DO s_copy TIMES. (s_cpoy is selection screen copy)
PERFORM call_function_module.
ENDDO.
or
wa_ssfcompop-tdcopies = s_copy.
PERFORM call_function_module.
I hope it will solve your issue.
Regards,
Sambaran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
I already tried with this.
wa_ssfcompop-tdcopies = 1.
DO s_copy TIMES. (s_cpoy is selection screen copy)
PERFORM call_function_module.
ENDDO.
if i do this, I am not getting duplicate and triplicates.
in this case, i am getting only one ORIGINAL.
i HOPE YOU UNDERSTAND THE PROBLEM.
iF TD-COPIES = 1, YOU NEVER GET DUPLICATE AND TRIPLICATE. BECAUSE, SY-SFSY COUNT in copies window of smartform will always become 1...you get only ORIGINAL.
My requirement is : if selection screen copy =1 : i should get 1 original, 1 duplicate and 1 triplicate.
s_copy =2:-> 2 original, 2 duplicate and 2 triplicate.
hi Puneindian,
Actually I dont see any issue with the coding, but would not be the case with the printer also. my question is when you have passed space in the parameter wa_ssfcompop-tdimmed why is that it is printing?. if i am wrong and you are taking the printout from the spool then it is the issue with the printer or the user settings definitly not the program issue, so first please do let me know about how you are geting the printouts?.
also if u can debug your code just give one copy at the selecton screen and debug your code .
If you are taking the printout from sp01 then u have to change the number of copies to print in spo1(selec your spool no and press Shift F1)
Edited by: venkatesh PH on Sep 7, 2009 2:26 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.