Application Development and Automation 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: 
Read only

Fatal Error in background

Former Member
0 Likes
614

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
Read only

Former Member
0 Likes
546

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

Read only

0 Likes
546

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

Read only

0 Likes
546

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

Read only

Former Member
0 Likes
546

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.