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: 

Fatal Error in background

Former Member
0 Kudos
133

Hi guys,

I am creating TEXT EDITOR in selection screen for this I'm doing it as below

CREATE OBJECT g_custcont

EXPORTING container_name = 'G_TXT_CUSTCONT'.

CREATE OBJECT g_editor

EXPORTING

wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position

wordwrap_position = line_length

wordwrap_to_linebreak_mode = cl_gui_textedit=>true

parent = g_custcont.

This is working fine in case of online execution, but giving Fatal error: GUI cannot be reached in background scheduling.

I know we can pass blank docking container in case of offline like code given below, but that is not working in case of selection screen.

data: g_doc_con1 TYPE REF TO cl_gui_docking_container.

CREATE OBJECT grid1

EXPORTING i_parent = g_doc_con1.

Thanks in advance...

4 REPLIES 4

Former Member
0 Kudos
65

HI,

ALV Grid cannot be displayed in background.

Use the REUSE_ALV...func,modules, that will take care of both foreground as well as background.

Regards,

Subramanian

0 Kudos
65

My dear friend I'm not facing this problem in output display, this is problem in selection screen..

0 Kudos
65

hi,

I am not able to post you a link for this.

Search for your "Fatal error: GUI cannot be reached in background scheduling" in google search engine.

You will get a document related to this posted in SAP technical.com

Refer to that.

Regards,

Subramanian

Former Member
0 Kudos
65

In ur case u r using text editor control in the selection screen. This control is nothing but OCX control that is stored in ur local PC. And u r using the class cl_gui_textedit(wrapper class) to send instructions to this control. In background SAP cannot access your ur local PC that's it is showing this error.

To avoid it u can try this code;

CREATE OBJECT g_editor

EXPORTING

wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position

wordwrap_position = line_length

wordwrap_to_linebreak_mode = cl_gui_textedit=>true

parent = cl_gui_custom_container=>screen0.

Regards,

Joy.