Application Development 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: 

Disable PDF! command on print preview

former_member213437
Active Participant
0 Kudos

Dear All,

We have a requirement of disbaling  PDF!  command on print preview screen. Can we do this through ABAP or through user authorization level.

Thanks in advance.

Murthy.

1 ACCEPTED SOLUTION

Aashish28
Contributor
0 Kudos

Hiii,

       Their is one solution that comes in my mind  which i have tested is - Create Implicit Enhancement in PBO of program SAPLSTXBC include LSTXBCFOP and put your condition or authorization object inside it if your condition meet than show PDF preview otherwise leave to screen.

See below screenshot .

Note : SAPLSTXBC - this is common program which is responsible for PDF preview when you are in print preview of any SF so for avoiding effect of this check on other tcode except your please apply tcode check or other possible conditions

8 REPLIES 8

edgar_nagasaki
Contributor
0 Kudos

Hi Murthy,

You mean to prevent printing over PDF output devices? I think there's nothing you can do through ABAP, at most output devices itself (not really sure what could be done from auth perspective), don't forget LOCL printing to PDF also.

Edgar

Former Member
0 Kudos

Hi Murthy,

                you want "Suppressing the dialog box for print preview " or

               don't want PDF output ? please clear what u want ,

                i mean is it Z program attachwith some smartfor/script ?

if you want "Suppressing the dialog box for print preview "  then find below sample code .

data : w_cparam TYPE ssfctrlop .

w_cparam-no_dialog = 'X'.
w_cparam-preview = space.          " Suppressing the dialog box for print preview
w_cparam-getotf = 'X'.

* Printer name to be used is provided in the export parameter
* OUTPUT_OPTIONS

w_outoptions-tddest = 'LP01'.

CALL FUNCTION w_fmodule
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
control_parameters = w_cparam
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
output_options = w_outoptions
* USER_SETTINGS = 'X'
IMPORTING
* DOCUMENT_OUTPUT_INFO =
job_output_info = t_otf_from_fm
* JOB_OUTPUT_OPTIONS =
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

Regard's

Smruti

0 Kudos

Hi Nagasaki and Ranjan,

Thanks for your response.

If we execute PDF!  command on command field at print preview it converts the layout to PDF automatically ( If form is implemented using Smartf Forms).

I want to disbale this feature through ABAP/ through User Authorizations.

Please respond if you have a solution.

Thanks & Regards,

Murthy

Former Member
0 Kudos

Hi,

I also need help on this...
Can anybody HELP!!!!

Regards,

Lynette

Aashish28
Contributor
0 Kudos

Hiii,

       Their is one solution that comes in my mind  which i have tested is - Create Implicit Enhancement in PBO of program SAPLSTXBC include LSTXBCFOP and put your condition or authorization object inside it if your condition meet than show PDF preview otherwise leave to screen.

See below screenshot .

Note : SAPLSTXBC - this is common program which is responsible for PDF preview when you are in print preview of any SF so for avoiding effect of this check on other tcode except your please apply tcode check or other possible conditions

0 Kudos

Hi Ashish,

Thanks for the effort.

We thought it can be achieved through Smart forms settings / authorizations level. How ever we tried the solution suggested by you.

It is working fine. Thanks alot.

0 Kudos

If you look for an authorization check, start a trace with ST01 for authorization check, display such a spool and execute function PDF!, then stop trace and look at the performed authorization checks.

Regards,

Raymond

0 Kudos

Thank u very much ASHISH AHIRE 

Today your post is useful to me..

Keep posting..