2006 Jun 12 10:10 AM
Hallo,
does anybody know how to use this class...?
I tried to use it, but I always get a short dump...
Thanks,
Mike
2006 Jun 12 10:46 AM
Hi Mike ,
You can use OPEN_DOCUMENT method of the class.
Please go through this program.
REPORT YSHAIL_PDF .
data: container type ref to cl_gui_custom_container,
pdf type ref to cl_gui_pdfviewer.
DATA: ITAB TYPE TABLE OF ZSHAIL_T1 WITH HEADER LINE.
SELECT * FROM ZSHAIL_T1 INTO TABLE ITAB.
call screen 100.
module STATUS_0100 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
if container is initial.
CREATE OBJECT container
EXPORTING
PARENT =
container_name = 'PDF'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT pdf
EXPORTING
parent = container
LIFETIME =
SHELLSTYLE =
AUTOALIGN =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 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 pdf->open_document
EXPORTING
<b> url = 'file://D:\SP\shail''s files\my docs\ab4query.pdf'</b>
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
others = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endif.
endmodule. " STATUS_0100 OUTPUT
module USER_COMMAND_0100 input.
case sy-ucomm.
when 'EXIT'.
leave program.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
<b>Is your problem solved..?? </b>
Regards,
SP.
Hallo,
does anybody know how to use this class...?
I tried to use it, but I always get a short dump...
Thanks,
Mike
2006 Jun 12 10:16 AM
2006 Jun 12 10:18 AM
2006 Jun 12 10:23 AM
2006 Jun 12 10:24 AM
2006 Jun 12 10:36 AM
Thanks guys,
very useful answers...
Here's another one, if you please...
Do you know how to open a pdf document using the same class CL_GUI_PDFVIEWER?
Thanks,
Mike
2006 Jun 12 10:41 AM
2006 Jun 12 10:43 AM
hi,
use the method <b>OPEN_DOCUMENT</b> in the class <b>CL_GUI_PDFVIEWER</b>
Regards
vijay
2006 Jun 12 10:45 AM
2006 Jun 12 10:46 AM
Hi Mike ,
You can use OPEN_DOCUMENT method of the class.
Please go through this program.
REPORT YSHAIL_PDF .
data: container type ref to cl_gui_custom_container,
pdf type ref to cl_gui_pdfviewer.
DATA: ITAB TYPE TABLE OF ZSHAIL_T1 WITH HEADER LINE.
SELECT * FROM ZSHAIL_T1 INTO TABLE ITAB.
call screen 100.
module STATUS_0100 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
if container is initial.
CREATE OBJECT container
EXPORTING
PARENT =
container_name = 'PDF'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT pdf
EXPORTING
parent = container
LIFETIME =
SHELLSTYLE =
AUTOALIGN =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 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 pdf->open_document
EXPORTING
<b> url = 'file://D:\SP\shail''s files\my docs\ab4query.pdf'</b>
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
others = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endif.
endmodule. " STATUS_0100 OUTPUT
module USER_COMMAND_0100 input.
case sy-ucomm.
when 'EXIT'.
leave program.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
<b>Is your problem solved..?? </b>
Regards,
SP.
2006 Jun 12 11:13 AM
Thanks for your answer;
I tried but... it doesn't work; it just shows a white sqare within the dynpro.
Of course I have modified the program using a pdf file that exists on my PC.
2006 Jun 12 11:23 AM
before correcting your program.
just to check whether there is anything wrong with the PDf document or with the PDF viewer in your machine.
just run prorgram SAPHTML_DEMO1 from transaction se38.
enter the file path in the inputfield
d:\Documents and Settings\XXX\Desktop\readme.pdf
and hit enter.
do you see the pdf document in the control?
Regards
Raja
2006 Jun 12 11:30 AM
Hallo,
yes, using program SAPHTML_DEMO1 I can see everything...
2006 Jun 12 11:39 AM
it will be difficult to identify the error without seeing your code.
however if your requirement is to just have a control on the screen to show PDF documents, you dont need pdf viewer class . you can use just html viewer control (SAPHTML_DEMO1 ). even if you look at the code in pdf viewer class, they use html viewer control.
Regards
Raja
2009 Aug 20 10:49 AM
hi: SP.
Because my IDES doesn't have a table called ZSHAIL_T1 that the program can't run.
Can you give me some advice?
Or can you tell me what the table is?
Many thanks!