Ver Mensaje Individual
  #10  
Viejo 17/08/06, 14:08:29
thorsven thorsven is offline
Junior Member
 
Fecha de Ingreso: ago 2006
Localización: Valencia, Spain
Mensajes: 2
¿ Ay una manera de ver los archivos PDF en SAP ?

Existe la clase CL_GUI_PDF_VIEWER pero no consiguo utilizarla.

Aqui el programa que he escrito.

program ztst MESSAGE-ID zz LINE-SIZE 110 LINE-COUNT 64
NO STANDARD PAGE HEADING.

*&---------------------------------------------------------------------*
*& Modulpool ZLISTDOC *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*


INCLUDE ZLISTDOCTOP . "

data : control type ref to CL_GUI_CUSTOM_CONTAINER,
pdf type ref to CL_GUI_PDF_VIEWER.

start-of-selection.

call screen 1000.

*&---------------------------------------------------------------------*
*& Module INIT OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE INIT OUTPUT.

if control is initial.
create object control
exporting
container_name = 'CONTAINER'
EXCEPTIONS cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc NE 0.
MESSAGE e208(00)
WITH 'The control HTML_CONTAINER could not be created'.
ENDIF.

create object pdf
exporting
parent = control
NATIVE_TOOLBAR = 'X'
NATIVE_SCROLLBAR = 'X'
NATIVE_CONTEXT_MENU = 'X'
EXCEPTIONS cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4.
IF sy-subrc NE 0.
MESSAGE e208(00)
WITH 'The control HTML_CONTAINER could not be created'.
ENDIF.


call method pdf->OPEN_DOCUMENT
exporting
FILE = 'c:\temp\factura_0073000002.pdf'
EXCEPTIONS cntl_error = 1
cntl_system_error = 2.
IF sy-subrc NE 0.
MESSAGE e208(00)
WITH 'The control HTML_CONTAINER could not be created'.
ENDIF.

call method pdf->CREATE_TOOLBAR
exporting
close_button = 'X'
EXCEPTIONS cntl_error = 1
cntl_system_error = 2.
IF sy-subrc NE 0.
MESSAGE e208(00)
WITH 'The control HTML_CONTAINER could not be created'.
ENDIF.

endif.

ENDMODULE. " INIT OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_1000 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_1000 INPUT.

case sy-ucomm.
when 'BACK'.
leave to screen 0 .
endcase.

ENDMODULE. " USER_COMMAND_1000 INPUT
Responder Con Cita