Skip to Content
0
Former Member
Jan 23, 2012 at 08:15 PM

ABAP DOI - on_custom_event OF i_oi_document_proxy

275 Views

hi all,

I´m trying to implement in Excel DOI implementation a macro in excel which calls the on_custom_event of document_proxy.

I implemented the following coding:

*----------------------------------------------------------------------*
*       CLASS xls_event_handler DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS xls_event_handler DEFINITION.

  PUBLIC SECTION.

    METHODS: custom_event
      FOR EVENT on_custom_event OF i_oi_document_proxy
      IMPORTING document_proxy event_name param_count param1 param2 param3.

ENDCLASS.                    "xls_event_handler DEFINITION

*----------------------------------------------------------------------*
*       CLASS xls_event_handler IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS xls_event_handler IMPLEMENTATION.

  METHOD custom_event.

    MESSAGE i082(zhv_bug_hr).

  ENDMETHOD.                    "custom_event

ENDCLASS.                    "xls_event_handler IMPLEMENTATION

My Excel marco calls the event with the following call:

Call Application.Workbooks(1).Container.SendCustomEvent("SAVE")

I registered the event during the init_control with register_on_custom_event

CALL METHOD control->init_control
    EXPORTING
      r3_application_name      = l_app_name                 "#EC NOTEXT
      inplace_enabled          = 'X'
      inplace_scroll_documents = 'X'
      inplace_resize_documents = 'X'
      inplace_show_toolbars    = show_toolbars
      parent                   = container
      register_on_close_event  = ''
      register_on_custom_event = 'X'
      name                     = 'ZHV_SAP'
    IMPORTING
      retcode                  = retcode
      error                    = error.

But I doesn´t work :-(. I can not find the missing puzzle piece.

Thanks in advance for your help.

br, Chris