Hi,
I have a report , with a selection screen , which displays lists etc..
I have a form which displays it's own screen, this form is called from the report, based on user events.
The problem I get, is when the form is NOT shown when calling the form, until I press the back button on the current form. I've tried using CALL SCREEN 100, AND SET SCREEN 100, with call screen 100, it does not pouplate the screen with the data, set screen 100 does, but is not visible until I press the back button.
The code for my form is shown below
FORM display_pdf_spool.
set screen 100.
set PF-STATUS 'TESTVIEWER'.
SET TITLEBAR '001' WITH delimiter.
IF my_container IS INITIAL.
CREATE OBJECT my_container
EXPORTING
container_name = 'VIEW'
EXCEPTIONS
OTHERS = 1.
CASE sy-subrc.
WHEN 0.
WHEN OTHERS.
RAISE cntl_error.
ENDCASE.
ENDIF.
IF viewer IS INITIAL.
CALL METHOD c_oi_container_control_creator=>get_document_viewer
IMPORTING
viewer = viewer
EXCEPTIONS
unsupported_platform = 1.
IF sy-subrc NE 0.
MESSAGE i009.
ENDIF.
CALL METHOD viewer->init_viewer
EXPORTING
parent = my_container
EXCEPTIONS
cntl_error = 1
cntl_install_error = 2
dp_install_error = 3
dp_error = 4.
IF sy-subrc NE 0.
MESSAGE i009.
ENDIF.
ENDIF.
CLEAR edurl.
******************************************************************
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\A.PDF'
filetype = 'BIN'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = mycontent_table
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
************************************************************************
***********************
************************************************************************
***********************
type = 'application'.
subtype = 'PDF'.
inplace = 'X'.
CALL METHOD viewer->view_document_from_table
EXPORTING
type = type
subtype = subtype
size = 72704
show_inplace = inplace
CHANGING
document_table = mycontent_table
EXCEPTIONS
cntl_error = 1
not_initialized = 2
dp_error_general = 3
invalid_parameter = 4
dp_invalid_parameter = 5.
IF sy-subrc NE 0.
MESSAGE i009.
ENDIF.
*ENDMODULE. "STATUS_0100 OUTPUT
&----
*& Module USER_COMMAND_0100 INPUT
&----
*MODULE user_command_0100 INPUT.
CASE fcode.
WHEN 'BACK'.
IF NOT viewer IS INITIAL.
CALL METHOD viewer->destroy_viewer
EXCEPTIONS
not_initialized = 1
free_failed = 2.
IF sy-subrc NE 0.
MESSAGE i009.
ENDIF.
FREE viewer.
ENDIF.
IF NOT my_container IS INITIAL.
CALL METHOD my_container->free
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE i009.
ENDIF.
FREE my_container.
ENDIF.
LEAVE PROGRAM.
WHEN 'CLOSE'.
CALL METHOD viewer->close_document
EXCEPTIONS
cntl_error = 1
not_initialized = 2.
IF sy-subrc NE 0.
MESSAGE i009.
ENDIF.
IF NOT viewer IS INITIAL.
CALL METHOD viewer->destroy_viewer
EXCEPTIONS
not_initialized = 1
free_failed = 2.
IF sy-subrc NE 0.
MESSAGE i009.
ENDIF.
FREE viewer.
ENDIF.
IF NOT my_container IS INITIAL.
CALL METHOD my_container->free
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE i009.
ENDIF.
FREE my_container.
ENDIF.
LEAVE PROGRAM.
ENDCASE.
CLEAR fcode.
*ENDMODULE. "USER_COMMAND_0100 INPUT
ENDFORM. "display_pdf_spool
Thanks