Application Development 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: 

ABAP DOI - on_custom_event OF i_oi_document_proxy

Former Member
0 Kudos
350

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

2 REPLIES 2

Former Member
0 Kudos
71

can somebody help me?

thx, br, christian

Former Member
0 Kudos
71

Hi Christian,

try to replace the EXCEL coding

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

with

Call ThisWorkbooks.Container.SendCustomEvent("SAVE")

I hope this solves your problem.

All the best

Günter