cancel
Showing results for 
Search instead for 
Did you mean: 

no. of copies : SMART FORM.

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Puneindia,

Did you try chacking the parameter user_seting during function call and your user default settings?

Former Member
0 Kudos

Venky,

I could not find user_setting parameter in ssf* structure / FM parameter..

Pls let me know the where can i find this parameter.

Former Member
0 Kudos

Hi,

It is the parameter for the FM of your smartform, check and pass space in it.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Venky,

Thanks for your analysis and help.

Issue is resolved with your code??

with my code, there are no issues with SPOOL ie, new spools are creating as per the need.

with issue was printing 3 times than required.

Pls let me know .

Former Member
0 Kudos

Hi,

Can you send me your new modified code..so that i can analyze your code and give the suggestion.

Edited by: MR Venkat on Sep 8, 2009 5:20 PM

Edited by: MR Venkat on Sep 8, 2009 5:20 PM

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Puneindia,

Did you try chacking the parameter user_seting during function call and your user default settings?

Former Member
0 Kudos

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....

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi,

Did you try my reply above? let me know how u r geting the printouts?

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

former_member755502
Participant
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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