Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sapscript options inside form

Former Member
0 Likes
1,342

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,247

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

11 REPLIES 11
Read only

Former Member
0 Likes
1,248

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

Read only

0 Likes
1,247

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

Read only

0 Likes
1,247

maybe you know is holded information from this printing selection screen.

Regards,

Wojtek

Read only

0 Likes
1,247

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

Read only

0 Likes
1,247

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

Read only

Former Member
0 Likes
1,247

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.

Read only

0 Likes
1,247

Yes,I've tried to do this. But this structure is empty. All information are configured in printing selection screen.

Read only

Former Member
0 Likes
1,247

What is the transaction / print program name.

Read only

0 Likes
1,247

transaction: f.2c

program:RFDUZI00

Read only

Former Member
0 Likes
1,247

Use field FODEVICE directly in SCRIPT.

It will have value "SCREEN" for print preview.

For print it will have value "PRINTER".

Cheers.

Read only

0 Likes
1,247

FODEVICE also contains "PRINTER" for print preview