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: 

New Screen not displayed

Former Member
0 Kudos
206

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos
173

Hi, the modules have been removed,

the code is as 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.

ENDFORM. "display_pdf_spool

15 REPLIES 15

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
173

Sims, you still need the modules in your code.





* This form will call your screen.  The modules for the 
* screen will be fired by the screen itself. 
FORM display_pdf_spool.

CALL screen 100.

ENDFORM. "display_pdf_spool





** This modules are fired from your screen and in this 
** case have to be or you will not get your data.
** Move these modules to the end of your source code.





MODULE STATUS_0100.

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


Just move the modules outside of the form.

Regards,

Rich Heilman

Message was edited by: Rich Heilman

Former Member
0 Kudos
174

Hi, the modules have been removed,

the code is as 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.

ENDFORM. "display_pdf_spool

0 Kudos
173

Sims, please review my previous post. You NEED the MODULES. You MUST move the code for the MODULES outside of the FORM.

Example.

FORM WHATEVER.

CALL SCREEN 100.

ENDFORM.

MODULE STATUS_100.

* put your code for the status_100 module here.

ENDMODULE

MODULE USER_COMMAND_100.

* Put your code for handle the fcodes here.

ENDMODULE.

Regards,

Rich Heilman

0 Kudos
173

Hi Rich,

I've just tried moving the modules outside the form, as suggested, the screen is displayed now, but as before, but the pdf file cannot be seen.

If I now use set screen 100, in the form , that does not display it either:

the code is as below:

FORM display_pdf_spool.

CALL SCREEN 100.

ENDFORM. "display_pdf_spool

----


  • MODULE status_0100 OUTPUT

----


*

----


MODULE status_0100 OUTPUT.

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 'Unkown Error.' TYPE 'E'.

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 'Unkown Error.' TYPE 'E'.

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 'Unkown Error.' TYPE 'E'.

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 'Unkown Error.' TYPE 'E'.

ENDIF.

FREE viewer.

ENDIF.

IF NOT my_container IS INITIAL.

CALL METHOD my_container->free

EXCEPTIONS

OTHERS = 1.

IF sy-subrc <> 0.

MESSAGE 'Unkown Error.' TYPE 'E'.

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 'Unkown Error.' TYPE 'E'.

ENDIF.

IF NOT viewer IS INITIAL.

CALL METHOD viewer->destroy_viewer

EXCEPTIONS

not_initialized = 1

free_failed = 2.

IF sy-subrc NE 0.

MESSAGE 'Unkown Error.' TYPE 'E'.

ENDIF.

FREE viewer.

ENDIF.

IF NOT my_container IS INITIAL.

CALL METHOD my_container->free

EXCEPTIONS

OTHERS = 1.

IF sy-subrc <> 0.

MESSAGE 'Unkown Error.' TYPE 'E'.

ENDIF.

FREE my_container.

ENDIF.

LEAVE PROGRAM.

ENDCASE.

CLEAR fcode.

ENDMODULE. "USER_COMMAND_0100 INPUT

Thanks

0 Kudos
173

You did copy the screen from the other program to this program, right?

Regards,

Rich Heilman

0 Kudos
173

Hi,

I did copy the screen, and that is the screen it displays. The screen also has a custom control which acts as viewer for the pdf file.

Thanks

0 Kudos
173

I would suggest debugging and make sure the the PBO module STATUS_100 is being executed.

Regards,

Rich Heilman

0 Kudos
173

Hi,

i've just debugged, and what I have noticed that FCODE in the module is never set, how do I link it to what the user has pressed, the values are correct in the pf-status

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 'Unkown Error.' TYPE 'E'.

ENDIF.

FREE viewer.

ENDIF.

IF NOT my_container IS INITIAL.

CALL METHOD my_container->free

EXCEPTIONS

OTHERS = 1.

IF sy-subrc <> 0.

MESSAGE 'Unkown Error.' TYPE 'E'.

ENDIF.

FREE my_container.

ENDIF.

LEAVE PROGRAM.

0 Kudos
173

So gui status 'TESTVIEWER' has the fcodes that you need, but in the PAI, the fcode is not coming. Is FCODE defined as your ok_code of the screen?

Regards,

Rich Heilman

0 Kudos
173

Hi,

how can I check that?

0 Kudos
173

Hi,

Element list -> general attribute screen does have FCODE set as OK

0 Kudos
173

why don't you just declare

fcode as sy-ucomm

thanks

0 Kudos
173

Hi Surjit,

I have

DATA: fcode LIKE sy-ucomm, edurl(2048).

It goes to the loop below but never has a value in it.

FORM display_pdf_spool.

CALL SCREEN 100.

ENDFORM. "display_pdf_spool

----


  • MODULE status_0100 OUTPUT

----


*

----


MODULE status_0100 OUTPUT.

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 'Unkown Error.' TYPE 'E'.

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 'Unkown Error.' TYPE 'E'.

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 'Unkown Error.' TYPE 'E'.

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 'Unkown Error.' TYPE 'E'.

ENDIF.

FREE viewer.

ENDIF.

IF NOT my_container IS INITIAL.

CALL METHOD my_container->free

EXCEPTIONS

OTHERS = 1.

IF sy-subrc <> 0.

MESSAGE 'Unkown Error.' TYPE 'E'.

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 'Unkown Error.' TYPE 'E'.

ENDIF.

IF NOT viewer IS INITIAL.

CALL METHOD viewer->destroy_viewer

EXCEPTIONS

not_initialized = 1

free_failed = 2.

IF sy-subrc NE 0.

MESSAGE 'Unkown Error.' TYPE 'E'.

ENDIF.

FREE viewer.

ENDIF.

IF NOT my_container IS INITIAL.

CALL METHOD my_container->free

EXCEPTIONS

OTHERS = 1.

IF sy-subrc <> 0.

MESSAGE 'Unkown Error.' TYPE 'E'.

ENDIF.

FREE my_container.

ENDIF.

LEAVE PROGRAM.

ENDCASE.

CLEAR fcode.

ENDMODULE. "USER_COMMAND_0100 INPUT

Former Member
0 Kudos
173

Just try

Set SCreen 100.

Leave screen.

Or

Use Set USER-COMMAND <BACK> .

Former Member
0 Kudos
173

Before pressing any button , Check SYSTEM -> STATUS

and see what is the GUI Status and the Screen / Prog

your on.