on 07-08-2009 12:59 PM
Hi guys,
I am working on scripts.
I need to generate 3 copies for script: Original, duplicate, triplicate.
Please let me know the procedure.
Hi,
You will have
Open_form
Start_form
Write_form
End_form
Close_form
Statements in your Print Program. So place your statements from Start_form to End_form in a DO statement.
You said you want 3 Copies. So
Open_form.
DO 3 times.
Start_form.
Write_form.
End_form.
ENDDO.
Close_form .
This will create 3 copies.
In order to print different text on each copy, create a new window in the SAPSCRIPT at the required position.
Create three text elements in that window
E/ ORIGINAL
ORIGINAL
E/ DUPLICATE
DUPLICATE
E/ TRIPLICATE
TRIPLICATE.
Now inside DO ENDDO, call this window along with the name of the text element, based on the count.
data: count type c. "This should be declared globally
Open_form.
DO 3 times.
count = count + 1.
Start_form.
If count = 1.
Write_form.
window = newwindow
Element = original.
elseif count = 2.
Write_form.
window = newwindow
Element = Duplicate.
elseif count = 3.
Write_form.
window = newwindow
Element = Triplicate.
End_form.
ENDDO.
Close_form .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can pass parameter ITCPO-TDCOPIES to function module 'OPEN_FORM' and for printing of text 'Duplicate' i think you have to write logic as mention in other replies, you can also try symbol &SAPSCRIPT-COUNTER_x& if its useful to store current copy number in sap script.
Thanks,
Santosh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
several procedures possible.
In NACE define trhee steps to print.
In printprogram gave 3 copies ijn the parameters
and maybe more.
But start with trying on this 2
Gr., Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
U need to change the logic of print program.
I can suppose u need to print at least 3 copies (1 for original, 1 for duplicate and 1 for triplicate), that shouldn't depends on how many copies the user has choosen to print, so if the user chooses two copie, that means it should be printed 6 copies( 2 for original, 2 for duplicates,.......).
So u should create DO cycle to repeat the print third, and insert all ABAP code to manage the print into the cycle, then u can set a variable where u insert the word COPY, DUPLICATE and TRIPLICATE.
DO 3 TIMES.
CASE SY-INDEX.
WHEN 1. _COPY = 'COPY'.
WHEN 2. _COPY = 'DUPLICATE'.
WHEN 3. _COPY = 'TRIPLICATE'.
ENDCASE.
......... abap code to print the document
ENDDO.
Max
Hi,
I think this is not possible in Script. This is possible in smartforms. Because in smartforms we can get the copy count. Based on this we do.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Now my requirement changed to smart form from Script.
Please let me know, how to get Original, duplicate, triplicate in smart forms.
SDN frds sugested that we can make use of COPY window.
we can use SFSY-copycount. (001/002/003).
But where can we make the variable/configuration that, total no of copies =3??
There exists NO configuration for my Driver prgm.
Edited by: puneindian on Jul 13, 2009 4:14 PM
Hi,
In print program before calling the Generated Function module of the form you need to pass the number of copies to that function module.
DATA: ls_composer_param TYPE ssfcompop.
......
ls_composer_param-tdcopies = 3.
CALL FUNCTION lf_fm_name
EXPORTING
..................................
control_parameters = ls_control_param
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.