‎2006 Sep 12 7:32 AM
hi,
when using FM 'open_form' to print scriptform, generally a dialog popup to set the printer parameters,
how to set these parameters in program for need not to fill manually?
thanks advance!
‎2006 Sep 12 7:39 AM
Hi Edgar,
There is a structure called as ITCPP - SAPscript output parameters and ITCPO - SAPscript output interface.
With the function modules PRINT_TEXT and OPEN_FORM, you can set output formatting and print control using the parameter OPTIONS. The data you pass to this parameter must have the structure ITCPO. The fields of this structure come from the areas SAPscript, the spool, and SAPcomm. Some of these fields can be changed by the user on the selection screen, if you requested it using the parameter DIALOG with the above function modules. The print program evaluates these changes using the corresponding fields of the parameter RESULT.
For e.g
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = SPACE
LANGUAGE = SY-LANGU
DEVICE = 'PRINTER'
DIALOG = 'X'
<u><b>OPTIONS = ITCPO</b></u>
............................
So in the options you can pass that structure, so that all the values to be changed can be done through that.
P.S. Mark all helpful answers for points.
Regards,
JLN
‎2006 Sep 12 7:34 AM
We have an parameter options in the functiom module ther in that structure u can set all the fileds u want.
‎2006 Sep 12 7:34 AM
Hi,
Use GET_PRINT_PARAMETERS.
http://help.sap.com/saphelp_40b/helpdata/en/9f/dba5ef35c111d1829f0000e829fbfe/content.htm
Cheers
VJ
‎2006 Sep 12 7:35 AM
Hi,
Set the IMPORT parameter 'OPTIONS' for this FM and make DIALOG as space in the import param.
Regards
Nishant
‎2006 Sep 12 7:39 AM
Hi Edgar,
There is a structure called as ITCPP - SAPscript output parameters and ITCPO - SAPscript output interface.
With the function modules PRINT_TEXT and OPEN_FORM, you can set output formatting and print control using the parameter OPTIONS. The data you pass to this parameter must have the structure ITCPO. The fields of this structure come from the areas SAPscript, the spool, and SAPcomm. Some of these fields can be changed by the user on the selection screen, if you requested it using the parameter DIALOG with the above function modules. The print program evaluates these changes using the corresponding fields of the parameter RESULT.
For e.g
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = SPACE
LANGUAGE = SY-LANGU
DEVICE = 'PRINTER'
DIALOG = 'X'
<u><b>OPTIONS = ITCPO</b></u>
............................
So in the options you can pass that structure, so that all the values to be changed can be done through that.
P.S. Mark all helpful answers for points.
Regards,
JLN
‎2006 Sep 12 8:02 AM
Hello,
Fill in the 'ITCPO' structure with appropriate values the call the open_form
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = SPACE
LANGUAGE = SY-LANGU
DEVICE = 'PRINTER'
DIALOG = 'X'
OPTIONS = ITCPO