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: 

to download in PDF format

Former Member
0 Kudos

Hi all ,

i have used fuctional module 'conver_otf ' to convert OTF into PDF , after that i want to download them into presentation layer , i think we must use GUI_download but i dont what all the conversion to be used pls help me .

thanking you

sridhar

1 ACCEPTED SOLUTION

Former Member
0 Kudos

go through this<a href="http://help.sap.com/saphelp_47x200/helpdata/en/85/54c73cee4fb55be10000000a114084/frameset.htm">http://help.sap.com/saphelp_47x200/helpdata/en/85/54c73cee4fb55be10000000a114084/frameset.htm</a>

7 REPLIES 7

Former Member
0 Kudos

go through this<a href="http://help.sap.com/saphelp_47x200/helpdata/en/85/54c73cee4fb55be10000000a114084/frameset.htm">http://help.sap.com/saphelp_47x200/helpdata/en/85/54c73cee4fb55be10000000a114084/frameset.htm</a>

Former Member
0 Kudos

Thanks for ur reply but my requirement is as such that i must i must down load into presentation layer or user can specify the directory , i have used fuction module conver_otf in smart forms only ineed after i must down load that into presentation

thanking you

sridhar

Former Member
0 Kudos

tp be more specfic i have done evry thing , just i want to download pls help me

CALL FUNCTION '/1BCDWB/SF00000003'

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

CONTROL_PARAMETERS = p_control_parameters

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

OUTPUT_OPTIONS = p_output_options

USER_SETTINGS = 'X'

IMPORTING

  • DOCUMENT_OUTPUT_INFO =

JOB_OUTPUT_INFO = s_job_output_info

  • 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.

i_otf[] = s_job_output_info-otfdata[].

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

MAX_LINEWIDTH = 132

  • ARCHIVE_INDEX = ' '

  • COPYNUMBER = 0

  • ASCII_BIDI_VIS2LOG = ' '

  • PDF_DELETE_OTFTAB = ' '

IMPORTING

BIN_FILESIZE = v_len_in

  • BIN_FILE =

TABLES

OTF = i_otf

LINES = i_tline

EXCEPTIONS

ERR_MAX_LINEWIDTH = 1

ERR_FORMAT = 2

ERR_CONV_NOT_POSSIBLE = 3

ERR_BAD_OTF = 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.

Former Member
0 Kudos

Hi Sridhar,

Can try:

CONVERT_OTFSPOOLJOB_2_PDF

converts a OTF spool to PDF (i.e. Sapscript document)

or CONVERT_ABAPSPOOLJOB_2_PDF.

Please search in Forum with 'PDF'. This will return lot of other posts.

Check the below postings :

Hope this helps.

Manish

Message was edited by:

Manish Kumar

Former Member
0 Kudos

Hi,

What u can do is, write the smartform to SPOOL and use the FM CONVERT_OTFSPOOLJOB_2_PDF, with the spool no. In this FM u can give the PDF destination.

Sreedhar

Former Member
0 Kudos

Thanks for replies but pls look at this ,

----


form download.

data p_file type STRING.

TYPES: pdf_nuc_line_t TYPE SOLI.

DATA: lt_pdf_nuc_data TYPE STANDARD TABLE OF SOLI.

CALL FUNCTION 'WS_QUERY'

EXPORTING

query = 'CD' "// Current Directory

IMPORTING

return = h_path.

concatenate p_title '.pdf' into P_dir.

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

def_filename = p_dir

def_path = h_path

mode = 'O'

IMPORTING

filename = p_dir

EXCEPTIONS

inv_winsys = 1

no_batch = 2

selection_cancel = 3

selection_error = 4

OTHERS = 5.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = p_dir

IMPORTING

OUTPUT = p_file .

  • To convert PDF file to Binary

call function 'QCE1_CONVERT'

tables

t_source_tab = PDF_TABLE

t_target_tab = lt_pdf_nuc_data

EXCEPTIONS

CONVERT_NOT_POSSIBLE = 1

OTHERS = 2

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

FILENAME = p_file

FILETYPE = 'BIN'

TABLES

DATA_TAB = lt_pdf_nuc_data.

refresh lt_pdf_nuc_data.

endform. " DOWNLOAD

but i am not having all data declartion for this pls send reagrding this

0 Kudos

I use for the download to a file

CALL METHOD cl_gui_frontend_services=>get_sapgui_workdir
  CHANGING
    sapworkdir            = h_workdir
  EXCEPTIONS
    GET_SAPWORKDIR_FAILED = 1
    CNTL_ERROR            = 2
    ERROR_NO_GUI          = 3
    NOT_SUPPORTED_BY_GUI  = 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.

CALL METHOD cl_gui_cfw=>flush

  EXCEPTIONS
    cntl_system_error = 1
    cntl_error = 2
    OTHERS = 3.

Filetype is I believe PDF instead of BIN

and look at program

RSTXPDFT4

which converts you're spoolrequest number to a PDF file

Message was edited by:

A. de Smidt