on 10-16-2007 10:55 AM
hey can any one help how we can print single form multiple times each printed copy have different header information on it.
FOR E.G. IN CASE OF INVOICE WE HAVE TO MAKE MULTIPLE COPIES OF ONE INVOICE AND ON FIRST COPY I HAVE TO PRINT ORIGINAL AND ON SECOND COPY I HAVE TO PRINT DUPLICATE AND ON THIRD COPY I HAVE TO PRINT TRIPLICATE
below i m sending my code.
REPORT ZVIBT2.
type-pools : abap.
tables : SSFSPOUTOP,SSFCRESPD,ssfpp.
data: fmname type rs38l_fnam,
COUNT TYPE f150v-pcount ,
COUNT1 type f150v-pcount.
Parameter: INVNO type vbrk-vbeln.
parameter: V_form type tdsfname default 'ZIBT' NO-DISPLAY.
types : itab type ssfpp .
DATA : ITAB TYPE SSFCRESOP.
DATA : ITAB2 TYPE SSFCOMPOP.
ITAB-tdcopies = 3.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting formname = V_form
variant = ' '
direct_call = ' '
importing fm_name = fmname
exceptions no_form = 1
no_function_module = 2
others = 3.
if sy-subrc <> 0.
error handling
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
exit.
endif.
CALL FUNCTION FMNAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
OUTPUT_OPTIONS =
USER_SETTINGS =
XVBELN = INVNO
TABLES
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Welcome to SDN.
Two changes are needed, one to the print program, one to the Smartform.
In the program specify the number of copies;
data: params type SSFCOMPOP.
params-tdcopies = '3'.
Then pass this params structure to the function module parameter OUTPUT_OPTIONS.
In the Smartform;
Create three windows, say ORIGINAL, DUPLICATE, TRIPLICATE each in the same place on the page with a suitable text element. Make the window type 'copies window'. The for ORIGINAL choose 'Only Original', for DUPLICATE and TRIPLICATE choose 'Only copies - copies differ'. Then apply a condition on DUPLICATE and TRIPLICATE based on SFSY-COPYCOUNT being either 2 or 3.
Regards,
Nick
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 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
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.