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

CNTL_ERROR when calling Desktop Office Integration remotely

Former Member
0 Likes
463

Hi,

I try to call a RFC from Web Dynpro. This RFC should read a Word document from the database and merge it with variables coming from the Web Dynpro and send the binair code back to the Web Dynpro.

Now it seems that the Desktop Office Integration works fine in the foreground, but not if I try to call this remotely. In that case I get an CNTL error, probably because it needs a GUI.

The first part of the code I use is as follows:

CALL METHOD c_oi_container_control_creator=>get_container_control

IMPORTING

control = control.

CREATE OBJECT container

EXPORTING container_name = 'CONTAINER'.

CALL METHOD control->init_control

EXPORTING r3_application_name = 'MS WORD'

inplace_enabled = 'X'

inplace_scroll_documents = 'X'

parent = container

register_on_close_event = 'X'

register_on_custom_event = 'X'

no_flush = 'X'.

The error is thrown from method init_control

Does anyone know if it is possible to remotely use this kind of functionality? (If not, I probably will have to use Adobe forms as alternative).

Kind regards,

Michiel van Rhoon

1 ACCEPTED SOLUTION
Read only

athavanraja
Active Contributor
0 Likes
344

as you have identified already, this is not possible.

method init_control needs GUI.

just a though:

save the word file in XML format in SAP DB. read it and modify it with the values coming from webdynpro and send this xml to webdynpro and let the webdynpro convert this xml to the required format.

Regards

Raja

Hi,

I try to call a RFC from Web Dynpro. This RFC should read a Word document from the database and merge it with variables coming from the Web Dynpro and send the binair code back to the Web Dynpro.

Now it seems that the Desktop Office Integration works fine in the foreground, but not if I try to call this remotely. In that case I get an CNTL error, probably because it needs a GUI.

The first part of the code I use is as follows:

CALL METHOD c_oi_container_control_creator=>get_container_control

IMPORTING

control = control.

CREATE OBJECT container

EXPORTING container_name = 'CONTAINER'.

CALL METHOD control->init_control

EXPORTING r3_application_name = 'MS WORD'

inplace_enabled = 'X'

inplace_scroll_documents = 'X'

parent = container

register_on_close_event = 'X'

register_on_custom_event = 'X'

no_flush = 'X'.

The error is thrown from method init_control

Does anyone know if it is possible to remotely use this kind of functionality? (If not, I probably will have to use Adobe forms as alternative).

Kind regards,

Michiel van Rhoon

1 REPLY 1
Read only

athavanraja
Active Contributor
0 Likes
345

as you have identified already, this is not possible.

method init_control needs GUI.

just a though:

save the word file in XML format in SAP DB. read it and modify it with the values coming from webdynpro and send this xml to webdynpro and let the webdynpro convert this xml to the required format.

Regards

Raja