如何从 SAP 调用 ActiveX?

发布于 2024-08-24 04:47:16 字数 72 浏览 5 评论 0原文

我有一个自定义 ActiveX 控件,我想从 SAP 调用它。

在这种情况下我无法使用 PI,我还有什么其他选择?

I have a custom ActiveX control that I would like to Call from SAP.

In this case I cannot use PI, what other options do I have?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

皓月长歌 2024-08-31 04:47:16

请参阅程序 SAPRDEMO_ACTIVEX_INTEGRATION 作为示例。

 DATA: control       TYPE REF TO i_oi_container_control, 
      ocx_document  TYPE REF TO i_oi_document_proxy,
      has_activex   TYPE flag,
      retcode       TYPE soi_ret_string,
      doc_handle    TYPE cntl_handle,
      document_type TYPE soi_document_type VALUE 'SAPActiveXDoc.Example1'.

"Test whether activeX is supported"
CALL FUNCTION 'GUI_HAS_ACTIVEX'
    IMPORTING return  = has_activex.
CHECK NOT has_activex IS INITIAL.

CALL METHOD control->init_control
       EXPORTING r3_application_name      = 'R/3 Basis'
                 inplace_enabled          = 'X'
                 register_on_close_event  = 'X'
                 register_on_custom_event = 'X'
                 parent                   = cl_gui_container=>default_screen
       IMPORTING retcode                  = retcode.

CALL METHOD control->get_document_proxy
       EXPORTING document_type  = document_type
       IMPORTING document_proxy = oxc_document
                 retcode        = retcode.

CALL METHOD oxc_document->open_activex_document
       IMPORTING retcode = retcode.

CALL METHOD ocx_document->get_document_handle
       IMPORTING handle  = doc_handle
                 retcode = retcode.

CALL FUNCTION 'CONTROL_CALL_METHOD'
       EXPORTING h_control = doc_handle
                 method    = 'MyMethod'
                 p_count   = 0.

CALL METHOD ocx_document->clsoe_activex_document
       IMPORTING retcode = retcode.

我已经去掉了屏幕处理和示例程序的错误处理,以便概述所需的主要调用。

See program SAPRDEMO_ACTIVEX_INTEGRATION as an example.

 DATA: control       TYPE REF TO i_oi_container_control, 
      ocx_document  TYPE REF TO i_oi_document_proxy,
      has_activex   TYPE flag,
      retcode       TYPE soi_ret_string,
      doc_handle    TYPE cntl_handle,
      document_type TYPE soi_document_type VALUE 'SAPActiveXDoc.Example1'.

"Test whether activeX is supported"
CALL FUNCTION 'GUI_HAS_ACTIVEX'
    IMPORTING return  = has_activex.
CHECK NOT has_activex IS INITIAL.

CALL METHOD control->init_control
       EXPORTING r3_application_name      = 'R/3 Basis'
                 inplace_enabled          = 'X'
                 register_on_close_event  = 'X'
                 register_on_custom_event = 'X'
                 parent                   = cl_gui_container=>default_screen
       IMPORTING retcode                  = retcode.

CALL METHOD control->get_document_proxy
       EXPORTING document_type  = document_type
       IMPORTING document_proxy = oxc_document
                 retcode        = retcode.

CALL METHOD oxc_document->open_activex_document
       IMPORTING retcode = retcode.

CALL METHOD ocx_document->get_document_handle
       IMPORTING handle  = doc_handle
                 retcode = retcode.

CALL FUNCTION 'CONTROL_CALL_METHOD'
       EXPORTING h_control = doc_handle
                 method    = 'MyMethod'
                 p_count   = 0.

CALL METHOD ocx_document->clsoe_activex_document
       IMPORTING retcode = retcode.

I've stripped out the screen processing & error handling of the example program in order to give an overview of main calls that are needed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文