Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

To avoid Printing Immediately when converting to PDF

Hi,

Currently a report is executed which displays the Open Items .On the output screen a Button is created to Download it in a PDF format.

Currently when the user clicks on the PDF button a spool is created and also it Prnts Immediately..

Follwing is the code written to convert the Ouput of the report to PDF.

DATA : l_print_parameters TYPE pri_params,

l_valid_flag TYPE c LENGTH 1.

CLEAR : l_print_parameters,

l_valid_flag.

*Fetching PRINT Parameters

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

NO_DIALOG = c_x

IMPORTING

OUT_PARAMETERS = l_print_parameters

VALID = l_valid_flag

EXCEPTIONS

INVALID_PRINT_PARAMS = 2

OTHERS = 4.

IF sy-subrc = 0.

l_print_parameters-linsz = sy-linsz.

l_print_parameters-linct = sy-linct.

ENDIF.

  • Start of spool recording for List output

NEW-PAGE PRINT ON NEW-SECTION PARAMETERS l_print_parameters

NO DIALOG.

  • Writing the list output from ASCII Format

CLEAR wa_lines.

LOOP AT it_lines INTO wa_lines.

IF wa_lines-txtlines EQ space.

WRITE:/ .

ENDIF.

WRITE:/ wa_lines-txtlines.

ENDLOOP.

  • Spool recording off, the data will be stored in spool request

NEW-PAGE PRINT OFF.

IF sy-spono IS NOT INITIAL.

SUBMIT rstxpdft4 WITH spoolno EQ sy-spono

AND RETURN.

ENDIF.

I checked the Default setting of the user in USR01.

SPLD DS05

SPLG

SPDB G

SPDA D

DATFM 1

DCPFM X

HDEST

HMAND

HNAME

MENON

MENUE

STRTT

LANGU EN

CATTKENNZ

TIMEFM 0

I want to avoid printing the PDF document when the user tries to save the Document on the local Drive.

Thanks

Nishant

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question