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

SOFFICEINTEGRATION error.

Former Member
0 Likes
17,174

Hi gurus,

I've a problem with this package. When I execute t'he function to open an existing word document in a server, the method document->open_document return an error.

The error was 'Error while setting data in data provider object' and then, 'Document not open'.

CALL METHOD document->open_document

EXPORTING

document_title = title

open_inplace = 'X'

open_readonly = ' '

protect_document = ' '

document_url = p_file

IMPORTING

error = error

retcode = retcode.

The p_file contain the value : file://
path of file.

Anybody can help me??? Thanks.

1 ACCEPTED SOLUTION
Read only

b_deterd2
Active Contributor
0 Likes
6,257

Hi,

Hier some pointers. Maybe it helps you.

1.

If you want to open a file on the appserver you can't use file://. This is only for files on the presentation server.

2.

Is your code right.

Somtehing like:


*   control creeren
   c_oi_container_control_creator=>get_container_control( importing control = control error = o_error ).
    control->init_control( exporting r3_application_name = 'Word-Verkoop'
                                     inplace_enabled          = 'X'
                                     inplace_scroll_documents = 'X'
                                     parent                   = o_cnt2
                                     register_on_close_event  = 'X'
                                     register_on_custom_event = 'X'
                                     no_flush                 = 'X'
                           importing error = o_error ).
    append o_error to o_errors.
*   doc proxy objct document creeren
    control->get_document_proxy( exporting document_type = 'Word.Document' register_container = 'X' no_flush = 'X'
                                 importing document_proxy = document  error = o_error ).
    append o_error to o_errors.
*   open document
    document->open_document( exporting open_inplace = 'X' document_url = gv_url no_flush = 'X' importing error = o_error ).
    append o_error to o_errors.
    document->get_wordprocessor_interface( exporting no_flush = 'X' importing error = o_error retcode = lv_ret wp_interface = o_word ).
    append o_error to o_errors.
    cl_gui_cfw=>flush( ).

Regards,

Bert

6 REPLIES 6
Read only

b_deterd2
Active Contributor
0 Likes
6,258

Hi,

Hier some pointers. Maybe it helps you.

1.

If you want to open a file on the appserver you can't use file://. This is only for files on the presentation server.

2.

Is your code right.

Somtehing like:


*   control creeren
   c_oi_container_control_creator=>get_container_control( importing control = control error = o_error ).
    control->init_control( exporting r3_application_name = 'Word-Verkoop'
                                     inplace_enabled          = 'X'
                                     inplace_scroll_documents = 'X'
                                     parent                   = o_cnt2
                                     register_on_close_event  = 'X'
                                     register_on_custom_event = 'X'
                                     no_flush                 = 'X'
                           importing error = o_error ).
    append o_error to o_errors.
*   doc proxy objct document creeren
    control->get_document_proxy( exporting document_type = 'Word.Document' register_container = 'X' no_flush = 'X'
                                 importing document_proxy = document  error = o_error ).
    append o_error to o_errors.
*   open document
    document->open_document( exporting open_inplace = 'X' document_url = gv_url no_flush = 'X' importing error = o_error ).
    append o_error to o_errors.
    document->get_wordprocessor_interface( exporting no_flush = 'X' importing error = o_error retcode = lv_ret wp_interface = o_word ).
    append o_error to o_errors.
    cl_gui_cfw=>flush( ).

Regards,

Bert

Read only

Former Member
0 Likes
6,257

1. I want to open in the client, but this file is in the appserver. Then, I concatenate 'file://' with the path in linux server like '
doc\.....'.

2. Yes, I do it before to open the document. I do this:

CALL METHOD c_oi_container_control_creator=>get_container_control

IMPORTING

control = control

retcode = retcode.

CREATE OBJECT container

EXPORTING

container_name = 'CONTAINER'.

CALL METHOD control->init_control

EXPORTING

r3_application_name = 'Document Container'

inplace_enabled = inplace

parent = container

IMPORTING

retcode = retcode.

CALL METHOD control->get_document_proxy

EXPORTING

document_type = document_type

register_container = 'X'

document_format = 'NATIVE'

IMPORTING

document_proxy = document

retcode = retcode

error = error_crear_ins.

Thank you very much. Thanks.

Read only

b_deterd2
Active Contributor
0 Likes
6,257

Hi Toni,

I think the file:// prefix is only for documents saved on your frontend and not for documents on the appserver.

Try without the file:// or else see if you can create an url for the document on the appserver .

Regards,

Bert

Read only

Former Member
0 Likes
6,256

Hi Bert,

The problem not is in the program. I put anothe file in another url in the appserver, and the program open and launch to printer this file. I put the url like 'file://
appserver_url' and launch the file.

Thank you very much.

Read only

Former Member
0 Likes
6,256

Hy Brert,

the problem was that my user don't had access to the folder in the server that contain the word document.

I try it with another user, and it works fine.

And the url is like 'file://
appserver_url'. It works.

Thanks.

Edited by: Toni Sierra on Apr 23, 2008 5:34 PM

Read only

Former Member
0 Likes
6,256

Hi,

what is the extension of the file you are uploading
if it is .xlsx then try to save the file as .xls and execute the program

regards

muthu