on 07-04-2008 10:14 AM
Hi all,
Suppose I give a print of script output for 3 copies.
For the 1st copy I should get the heading as 'Original ' on the top right side of my page , for the 2nd copy I should get heading 'Duplicate' and for the third copy 'Office document'. How can I make it possible? Please suggest.
Hi,
You have a structure ITCPO.... You have field tdcopies
populate this structure in your print program and in your script create a variable window and write the logic based on this field
Print program.
do tdcopies times
w_index = sy-index.
Your open_form code starts here
write_form etc
end_form
enddo
In your variable window check the condition
if &w_index& eq 1.
original
else
copy
endif.
this should be helpful
any queries revert back
regards
padma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Padma,
It seems, we are calling the script form for as many no. of times as the no. of copies we need. Can't we validate it without putting the DO, ENDDO statement in driver program? Because I can't assure you that we'll take 3 copies every time.Some times we may need only one copy. Your response helped me a lot . I am studying all those structures.Please give more details. Is there any way to change the heading as per the no. of copies given while taking print from SP02 . Here we don't have option for immediate printing.So I have to validate data after entering into SP02. Is this possible?
Hi Jayasri P,
Nice Requirement...
I think it's not possible from SP02 and all...
See the below process...
For SAP Scripts.
You will have to call the script in a loop.(DO... ENDDO)...
The number of times the loop is called shud be equal to the number of copies
and u can get the no of copies from either NAST-ANZAL or TDCOPIES
Now store it's value in variable say TOTAL_COPY
counter = 0. initialize conuter to zero
DO TOTAL_COPY TIMES
counter = counter + 1. " or u can use sy-index here...
if counter = 1.
text = 'original'.
elseif counter = 2.
text = '2nd Copy'.
elseif counter = 3.
text = '3rd Copy'.
elseif counter = 4.
text = '4th Copy'.
endif.
*Now print this text in some variable window as per ur need.
*This is the logic how u can achive this functionality..
OPEN_FORM....
WRITE_FORM (for each window and textelements)
CLOSE_FORM
ENDDO.
also have a look on below threads for more information...
http://help.sap.com/saphelp_nw70/helpdata/EN/d6/0db74a494511d182b70000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/EN/d6/0db875494511d182b70000e829fbfe/content.htm
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Padma,
Actually I am trying to do this for the Tcode J1IF11. Here I have to give the challan no. and should select 'Print immediately' Tab and should save the document.Then I am going to SP02 and looking for the preview. Is n't there any way of looking for the preview there itself from the transaction? That's why I am not getting from where I can pass the no. of copies to be printed.
This code will suffice:
if &PAGE& = 1
heading = 'Original'
elseif &PAGE& = 2
heading = 'Duplicate'
elseif &PAGE& = 3
heading = 'Office document'
endif.
reward points
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.