on 04-04-2008 11:48 AM
Hello friends.
Please anybody tell me how do you find the print program for a z sapscript (custom designed)
Thanks in advance.
Vishal VH
The print program is used to print the actual form ,the functions the print program has to do include retrieving of data from database tables , selecting a FORM and printing of TEXT ELEMENTS in a desired sequence.
The function modules used in aprint prgram are :
OPEN_FORM
START_FORM
WRITE_FORM
CONTROL_FORM
END_FORM
CLOSE_FROM
To start printing a form we must use OPEN_FORM and in the end we should use CLOSE_FORM to complete the spool request.
Function modules in detail.
OPEN_FORM function module
This function module should be called first before any printing can take place , here we specify the name of the form and the print language.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
DIALOG = 'X'
DEVICE = 'PRINTER'
FORM = form name
LANGUAGE = SY-LANGU
OPTIONS =
EXCEPTIONS
CANCELLED = 1
DEVICE = 2
FORM = 3
OTHERS = 11
.
IF SY-SUBRC NE 0.
MESSAGE ...
ENDIF.
In the above function module the parameter
FORM = Name of form
DEVICE = PRINTER (print using spool),TELEFAX (fax output)
SCREEN (output to screen)
OPTIONS = It is a structure of type ITCPO and it controls the various
attributes like number of copies , print preview etc.
START_FROM function module
This function module is called if we want to use different forms with similar characterstics in a single spool request,it must be closed by END_FORM function module.
CALL FUNCTION 'START_FORM'
EXPORTING
FORM =
LANGUAGE =
STARTPAGE =
EXCEPTIONS
FORM = 1
OTHERS = 7
.
IF SY-SUBRC NE 0.
MESSAGE ...
ENDIF.
WRITE_FORM Function module
This function module is used to write text in a window in the form using
text elements (/:E element). We can specify whether the text is to be appended , replaced or added and in which portion of the window it will be printed i.e TOP, BOTTOM ,BODY. In this function module actual printing takes place.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT =
FUNCTION =
TYPE =
WINDOW =
EXCEPTIONS
ELEMENT = 1
OTHERS = 9
.
IF SY-SUBRC NE 0.
MESSAGE ...
ENDIF.
Here in this function module the ELEMENT specifies which textelement is
printed . WINDOW specifies which window of the form to be print in.
TYPE specifies the output area of the window TOP,BOTTOM,BODY.
FUNCTION specifies whether the text is to be appended , replaced or added.
CLOSE_FORM function module
This function module should be called in the end and it has no exporting
parameter.
CALL FUNCTION 'CLOSE_FROM'
IMPORTING
RESULT =
EXCEPTIONS
UNOPENED = 1
OTHERS = 5
.
IF SY-SUBRC NE 0.
MESSAGE ...
ENDIF.
Here the result parameteer returns the status information and print/fax parameters after the form has been printed.
CONTROL_FORM function module
This function module is used to insert SAPScript control commands like NEW-PAGE etc from whithin the ABAP program.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND =
EXCEPTIONS
UNOPENED = 1
OTHERS = 3
.
IF SY-SUBRC NE 0.
MESSAGE ...
ENDIF.
NOTE: The print program and the form are stored in the table TNAPR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi vishal,
Please check once to table TNAPR and NACE T-code.
Nace please select appropriate output type and see.
and first make sure r u running that script with z t-code or calling by some standard t-code if u have z t-code then TNAPR is definatly help you out. other wise you may look towards NACE.
Thanks please reward if Solved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishal,
All you need to is, go to NACE transaction, for the appropriate application type open the output type and find the printing program name.
Example:-
tcode : NACE
Application type: Sales(V1)
Output type : BA00(order confirmation).
for the above application type the FORM DESCRIPTION is:
Standard form : RVORDER01
Standard Print program : RVADOR01
Of course, there are many other methods to follow, but with the above method you can even modify the standard forms if required.
Edited by: subbu sravan on Apr 8, 2008 11:13 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
To find a print program for an SAPscript of a Smart Form, use se16 to show table TNAPR. It will show you all the information you need to find the print program and the matching form.
or
Check the print program and form names in tcode NACE.
Thanks&Regards,
Phani,
Points If Helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If the forms are of custom type then check driver programs in table TTXFP.
Form name : TTXFP-TDFORM
Driver program : TTXFP-PRINT_NAME
Regards
Kiran
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 check table TNAPR for the printing programs related to the output forms.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.