‎2005 Sep 14 8:59 AM
Hi,
I've a problem. I'd like to distinguish inside the form if it is print preview or normal printout which goes to printer , but such structure like OPTIONS isn't passed by print program (it's empty). Also inside form RESULT and OPTIONS structures are initial. Is there any field TDPREVIEW which is field after selection screen with printing options? I cannot modify print program.
Regards,
Wojtek
‎2005 Sep 14 9:30 AM
Hi,
Check in the OPEN_FORM Function ( in the print program ) and see which field name is passed to parameter ITCPO.
You can directly use XITCPO-TDPREVIEW in your sapscript . XITCPO - Name of data object passed to FM. You will have to find this.
TDPREVIEW will be "X" if its a print preview.
Cheers
‎2005 Sep 14 9:30 AM
Hi,
Check in the OPEN_FORM Function ( in the print program ) and see which field name is passed to parameter ITCPO.
You can directly use XITCPO-TDPREVIEW in your sapscript . XITCPO - Name of data object passed to FM. You will have to find this.
TDPREVIEW will be "X" if its a print preview.
Cheers
‎2005 Sep 14 9:50 AM
This structure XITCPO is also empty. In Open_form in printing program there isn't passed any options because this structure (type itcpo is empty).
Regards,
Wojtek
‎2005 Sep 14 9:56 AM
maybe you know is holded information from this printing selection screen.
Regards,
Wojtek
‎2005 Sep 14 10:05 AM
Hi Wojtek
You could try to read that value from memory.
Insert a form in you sapscript, and in that form inset a piece of code like that:
DATA ITCPP LIKE ITCPP.
FIELD-SYMBOLS: <FS> TYPE ANY,
FIELD(30) TYPE C VALUE '(SAPLSTXC)ITCPP'.
ASSIGN (FIELD) TO <FS>.
ITCPP = <FS>.
If you're lucky you should get the print data.
Max
Message was edited by: max bianchi
‎2005 Sep 14 10:44 AM
Thank you Max,
I've done this:
DATA: ITCPP LIKE ITCPP,
FIELD(30) TYPE C VALUE '(SAPLSTXC)ITCPP'.
FIELD-SYMBOLS: <FS> TYPE ANY.
ASSIGN (FIELD) TO <FS>.
ITCPP = <FS>.
Regards,
Wojtek
‎2005 Sep 14 10:08 AM
Have you tried by putting a breakpoint at open form and then check the values in ITCPO. When you call print preview from the application you will get an "X" here.
‎2005 Sep 14 10:17 AM
Yes,I've tried to do this. But this structure is empty. All information are configured in printing selection screen.
‎2005 Sep 14 10:22 AM
‎2005 Sep 14 10:25 AM
‎2005 Sep 14 10:32 AM
Use field FODEVICE directly in SCRIPT.
It will have value "SCREEN" for print preview.
For print it will have value "PRINTER".
Cheers.
‎2005 Sep 14 11:34 AM