cancel
Showing results for 
Search instead for 
Did you mean: 

Change Office document with OfficeControl

christoph_nagl
Participant
0 Kudos

Hey,

is it possible to change an office document with the office control or is the office control only for viewing an office document?

Thanks for your support.

BR,

Christoph

Accepted Solutions (0)

Answers (3)

Answers (3)

christoph_nagl
Participant
0 Kudos

Hi again,

I have the problem that sometimes the context element which is bound to the office conrol is not actual.

For example:

I have an empty document. I fill the empty document with some text content over the web dynpro office control. After I press a button in the web dynpro the content of the context element i still empty. There was no refresh.

The office control is enabled.

Thanks for your support.

BR,

Christoph

ulrich_brenner2
Participant
0 Kudos
christoph_nagl
Participant
0 Kudos

Hey,

But the document in the DMS system I store is an empty document. Maybe the conversion of the xstring to the binary isn't correct.

And one additional question - the method on save is called twice. Is this normal?

BR,

Christoph

christoph_nagl
Participant
0 Kudos

Is it possible that the office control change the encoding or anyhting else of the context binding element.?

Thanks for your support.

BR,

Christoph

ulrich_brenner2
Participant
0 Kudos

Yes this is possible.

e.g. you can use the onSave-action of the OfficeControl, just check that the context contains the updated file.

Make sure that the "enabled"-property of the OfficeControl is set to true, else the context does not get updated.

christoph_nagl
Participant
0 Kudos

Hey,

thanks for the fast response.

The context binding element has from type XSTRING right?

Here is my code example. This example converts the context xstring element to an binary table.

" convert the current office document to an binary

wd_context->get_attribute( EXPORTING name = 'OFFICE_DOCUMENT' IMPORTING value = document ).

" dokument aus xstring in binary kontaktieren

CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'

EXPORTING

buffer = document

IMPORTING

OUTPUT_LENGTH = size

TABLES

binary_tab = lt_bindata.

DATA: zaehler TYPE i.

zaehler = 1.

loop at lt_bindata into ls_bindata.

clear ls_drao.

ls_drao-mandt = '602'.

ls_drao-orblk = ls_bindata.

ls_drao-orln = size.

ls_drao-dokar = ls_draw-dokar.

ls_drao-doknr = ls_draw-doknr.

ls_drao-dokvr = ls_draw-dokvr.

ls_drao-doktl = ls_draw-doktl.

ls_drao-zaehl = zaehler.

ls_drao-appnr = '1'.

append ls_drao to lt_drao.

ls_drao-orbkl = 2550.

zaehler = zaehler + 1.

endloop.

Thanks for your support.

BR,

Christoph