cancel
Showing results for 
Search instead for 
Did you mean: 

Differentiate between print and print preview event trigger for sapscript

Former Member
0 Kudos

Hi guys,

For sapscript, is there a way to know if the user presses the print or the print preview button? I need a way to determine if it is a print or print preview event triggering.

I've checked the OPEN_FORM fm but found nothing useful.

Please help. Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Pawan_Kesari
Active Contributor
0 Kudos

I think in print preview OPTIONS-TDPREVIEW will be 'X'.

Former Member
0 Kudos

Nope. when i debug the sapscript, TDPREVIEW is not X.

Sandra_Rossi
Active Contributor
0 Kudos

Of course, it can't be OUTPUT-TDPREVIEW as it is a parameter you can only "export" to OPEN_FORM.

But you have a return parameter RESULT-TDPREVIEW. It works for me.

For more info: [SAP library - SAPscript - OPEN_FORM|http://help.sap.com/saphelp_nw2004s/helpdata/en/d6/0dba1a494511d182b70000e829fbfe/frameset.htm]

Former Member
0 Kudos

Thanks. Problem is... i'm not allowed to modify the std SAP print program RQCAAP00 and it does not import the RESULTS structure when it calls OPEN_FORM. 😕

Sandra_Rossi
Active Contributor
0 Kudos

This is not supported by SAP, but well this is a possibility:


FIELD-SYMBOLS <ls_itcpp> TYPE itcpp.
ASSIGN ('(SAPLSTXC)ITCPP') TO <ls_itcpp>.
IF sy-subrc = 0.
* here you may use <ls_itcpp>-tdpreview
ENDIF.

Another way maybe is to declare the interface work area ITCPP (shared data in the same internal session):


TABLES ITCPP.
* here you may use itcpp-tdpreview

Former Member
0 Kudos

Thank you very much! That pretty much solved my problem.

Sandra_Rossi
Active Contributor
0 Kudos

Good !

Which approach of the two did work?

Former Member
0 Kudos

The first one.

Answers (0)