Excel Datei erzeugen mit DOI (Desktop Office Integration)

Die Objektorientierung mit ABAP®: Vererbung, Dynamische Programmierung, GUI Controls (u.a. ALV im OO).
1 Beitrag • Seite 1 von 1
1 Beitrag Seite 1 von 1

Excel Datei erzeugen mit DOI (Desktop Office Integration)

Beitrag von Haubentaucher (ForumUser / 11 / 0 / 0 ) »
Hallo zusammen,

kennt jemand eine Möglichkeit eine Exceldatei mit DOI zu erzeugen OHNE das Excel geöffnet wird.
Die Erzeugung der Datei funktioniert bei mir problemlos, man kann aber dabei zusehen wie die Datei erzeugt wird. Nun möchte ich dass die Erzeugung "unsichtbar" für den Benutzer abläuft.

Die OLE-Automation ist KEINE Lösung für mich.

Danke für eure Hilfe.

Anbei mein Code für die Initialisierung von DOI Excel:

Code: Alles auswählen.


* first get the SAP DOI i_oi_container_control interface
  CALL METHOD c_oi_container_control_creator=>get_container_control
                    IMPORTING control = control
                              error = error.
* check no errors occured
  CALL METHOD error->raise_message EXPORTING type = 'E'.

*Erzeugung Container-Objekt und Verknüpfung mit Custom Control
  CREATE OBJECT container
            EXPORTING container_name = 'EXCELCONT'.
* initialize the SAP DOI Container, tell it to run in the container
* specified above and tell it to run Excel in-place
  CALL METHOD control->init_control
                      EXPORTING r3_application_name =
                                'Excel'
                                inplace_enabled = 'X'
                                inplace_scroll_documents = 'X'
                                inplace_resize_documents = 'X'
                                parent = container
                                register_on_close_event = 'X'
                                register_on_custom_event = 'X'
                                no_flush = ''
                      IMPORTING error = errors.
* save error object in collection
  APPEND errors.
* ask the SAP DOI container for a i_oi_document_proxy for Excel
  CALL METHOD control->get_document_proxy
                      EXPORTING document_type = 'Excel.Sheet'
                                no_flush = ''
*                       REGISTER_CONTAINER = 'X'
                      IMPORTING document_proxy = document
                                error = errors.
  APPEND errors.

  CALL METHOD document->open_document
    EXPORTING
*    DOCUMENT_TITLE   = ' '
      document_url     = path
*    NO_FLUSH         = ' '
     OPEN_INPLACE     = 'X '
*    OPEN_READONLY    = ' '
*    PROTECT_DOCUMENT = ' '
*    STARTUP_MACRO    = ''
*    USER_INFO        =
        IMPORTING
          error            = errors.
  APPEND errors.


* check if our document proxy can serve a spreadsheet interface  data:
  DATA: has TYPE i.
  CALL METHOD document->has_spreadsheet_interface
                    EXPORTING no_flush = ''
                    IMPORTING is_available = has
                              error = errors.
  APPEND errors.
  CALL METHOD document->get_spreadsheet_interface
                    EXPORTING no_flush = ' '
                    IMPORTING
                              sheet_interface = spreadsheet
                              error = errors.
  APPEND errors.

  LOOP AT errors.
    CALL METHOD errors->raise_message
                    EXPORTING  type     = 'E'.
  ENDLOOP.
  FREE errors.

* Performance-Verbesserung
  CALL METHOD spreadsheet->load_lib
      EXPORTING no_flush = ''
      IMPORTING error    = errors.
  APPEND errors.

  CALL METHOD control->set_focus
      EXPORTING no_flush = ' '
      IMPORTING error = errors.
  APPEND errors.
  LOOP AT errors.
    CALL METHOD errors->raise_message
                    EXPORTING  type     = 'E'.
  ENDLOOP.
  FREE errors.


gesponsert
Stellenangebote auf ABAPforum.com schalten
kostenfrei für Ausbildungsberufe und Werksstudenten


Seite 1 von 1

Vergleichbare Themen

9
Antw.
6538
Views
Office Desktop Integration mit Excel im SAP SolMan
von OnkelSAP » 22.04.2010 08:00 • Verfasst in Dialogprogrammierung
9
Antw.
3919
Views
Desktop Office Integration - Excel: Spalten ausblenden
von ralf.wenzel » 12.11.2012 12:27 • Verfasst in ABAP Objects®
4
Antw.
2342
Views
Desktop Office Integration
von CKremer » 28.04.2006 09:36 • Verfasst in ABAP Objects®
2
Antw.
1377
Views
DOI: Desktop Office Integration
von MarkusW » 22.04.2008 11:55 • Verfasst in ABAP® Core
0
Antw.
1008
Views
Drag & Drop und die Desktop Office Integration
von CKremer » 13.03.2006 13:48 • Verfasst in ABAP Objects®

Über diesen Beitrag

Haubentaucher
Unterstütze die Community und teile den Beitrag für mehr Leser und Austausch

Aktuelle Forenbeiträge

PDF-Anzeige unter EDGE
vor 5 Tagen von jocoder 2 / 75

Newsletter Anmeldung

Keine Beiträge verpassen! Wöchentlich versenden wir lesenwerte Beiträge aus unserer Community.
Die letzte Ausgabe findest du hier.
Details zum Versandverfahren und zu Ihren Widerrufsmöglichkeiten findest du in unserer Datenschutzerklärung.

Aktuelle Forenbeiträge

PDF-Anzeige unter EDGE
vor 5 Tagen von jocoder 2 / 75

Unbeantwortete Forenbeiträge

Zwischensumme Adobe Forms
vor 4 Wochen von Lucyalison 1 / 132
Group Items auf einer Filterbar
vor 4 Wochen von Bright4.5 1 / 166