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

Getting dump while calling method CALL METHOD my_pdf_viewer->open_document

Former Member
0 Likes
1,334

Hi,

<removed_by_moderator>

I want to display PDF files through report.But while calling method OPEN_DOCUMENT I am getting dump.

error as follows:

Control Framework : Error processing control

CALL FUNCTION 'AC_FLUSH_CALL'

EXPORTING

SYSTEM_FLUSH = 'X'

CALLED_BY_SYSTEM = CALLED_BY_SYSTEM

IMPORTING

MESSAGE_NR = sysubrc

MESSAGE_TEXT = SY-MSGLI.

sy-subrc = sysubrc.

CASE SY-SUBRC.

WHEN 0.

WHEN 1.

system_error

MESSAGE ID 'CNDP' TYPE 'X' NUMBER 007 RAISING CNTL_SYSTEM_ERROR.

WHEN 2.

method_call_error

MESSAGE ID 'CNDP' TYPE 'X' NUMBER 006 RAISING CNTL_ERROR.

WHEN 3.

property_set_error

MESSAGE ID 'CNDP' TYPE 'X' NUMBER 006 RAISING CNTL_ERROR.

WHEN 4.

property_get_error

MESSAGE ID 'CNDP' TYPE 'X' NUMBER 006 RAISING CNTL_ERROR.

WHEN OTHERS.

RAISE CNTL_ERROR.

ENDCASE.

ENDFUNCTION.

Edited by: Julius Bussche on Jun 30, 2009 11:34 AM

5 REPLIES 5
Read only

Former Member
0 Likes
867

Hi

Follow the following steps for PDF

1) * Converting data to PDF.

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = u2018PDFu2019

IMPORTING

bin_filesize = lv_len_in ( which is a variable of type SOOD-OBJLEN )

TABLES

otf = t_otfdata

lines = lt_tline

2) Function Module: QCE1_CONVERT

Input the LT_LINE Table obtained from CONVERT_OTF FM.

This FM returns a table which contains the actual output in PDF

format(LT_OBJBIN).

CALL FUNCTION 'QCE1_CONVERT'

TABLES

t_source_tab = lt_tline

t_target_tab = lt_objbin

Call the FM to send the E-mail

3) CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = lw_doc_chng

put_in_outbox = u2018Xu2019

TABLES

packing_list = lt_objpack

object_header = lt_objhead

contents_bin = lt_objbin

contents_txt = lt_objtxt

receivers = lt_reclist

Internal table fill as like

  • Packing as PDF

lt_objpack-transf_bin = u2018Xu2019.

lt_objpack-head_start = u20181u2019.

lt_objpack-head_num = u20181u2019.

lt_objpack-body_start = u20181u2019.

lt_objpack-body_num = lv_lines_bin.

lt_objpack-doc_type = u2018PDFu2019.

lt_objpack-doc_size = lv_lines_bin * 255.

APPEND lt_objpack.

*Populating the recipient internet addresses

CLEAR lt_reclist.

lt_reclist-receiver = u2018u201D .(Recepient Email id)

lt_reclist-rec_type = u2018Uu2019. "External Address

APPEND lt_reclist.

Thanks

Shambhu

Read only

Former Member
0 Likes
867

Try the below code, replace with your file or variable which contains file name.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
  EXPORTING
    DOCUMENT               = 'C:Documents and Settingssap-2Desktop	est.pdf'
  EXCEPTIONS
    CNTL_ERROR             = 1
    ERROR_NO_GUI           = 2
    BAD_PARAMETER          = 3
    FILE_NOT_FOUND         = 4
    PATH_NOT_FOUND         = 5
    FILE_EXTENSION_UNKNOWN = 6
    ERROR_EXECUTE_FAILED   = 7
    SYNCHRONOUS_FAILED     = 8
    NOT_SUPPORTED_BY_GUI   = 9
    others                 = 10.
IF SY-SUBRC <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Regards

Karthik D

P.S.: Asking a Ur-gent question is against the [Community Guidelines|https://www.sdn.sap.com/irj/scn/blogs-communityguidelines]

Edited by: Karthik D on Jun 30, 2009 2:56 PM

Read only

Former Member
0 Likes
867

I am displaying invoices ( in PDF format ).

Read only

Former Member
0 Likes
867

guys,

Please reply..............

Read only

0 Likes
867

PO number will be the input and you want the see the purchase order in PDF format. is this your requirement?