<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Problem when call method of COM Object in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447704#M13466</link>
    <description>&lt;P&gt;I am trying to call external program from ABAP. I have built and registered COM object.&lt;/P&gt;&lt;P&gt;When Creating Objects it open new process (I can see from Task Manager). But CALL METHOD it gives error SY-SUBRC = 2&lt;/P&gt;&lt;P&gt;PS. This App has Method by name PrintBarcode with 2 params.&lt;/P&gt;&lt;P&gt;What is the problem can be?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INCLUDE OLE2INCL.

DATA: H_LABELPRNCOM TYPE OLE2_OBJECT
      ,RET_CODE TYPE I
     .

    CREATE OBJECT H_LABELPRNCOM 'KGSLabelPrn.Application'.
    IF SY-SUBRC = 0.
       CALL METHOD OF H_LABELPRNCOM 'PrintBarcode'
                 = RET_CODE
                 EXPORTING #1 = SY-HOST
                           #2 = BARCODE.
    ENDIF.


    IF SY-SUBRC &amp;lt;&amp;gt; 0 OR RET_CODE &amp;lt;&amp;gt; 0.
       RAISE ERROR.
    ENDIF.
    FREE OBJECT H_LABELPRNCOM.
                             .
ENDFUNCTION.

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 05 May 2017 17:17:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2017-05-05T17:17:05Z</dc:date>
    <item>
      <title>Problem when call method of COM Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447704#M13466</link>
      <description>&lt;P&gt;I am trying to call external program from ABAP. I have built and registered COM object.&lt;/P&gt;&lt;P&gt;When Creating Objects it open new process (I can see from Task Manager). But CALL METHOD it gives error SY-SUBRC = 2&lt;/P&gt;&lt;P&gt;PS. This App has Method by name PrintBarcode with 2 params.&lt;/P&gt;&lt;P&gt;What is the problem can be?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INCLUDE OLE2INCL.

DATA: H_LABELPRNCOM TYPE OLE2_OBJECT
      ,RET_CODE TYPE I
     .

    CREATE OBJECT H_LABELPRNCOM 'KGSLabelPrn.Application'.
    IF SY-SUBRC = 0.
       CALL METHOD OF H_LABELPRNCOM 'PrintBarcode'
                 = RET_CODE
                 EXPORTING #1 = SY-HOST
                           #2 = BARCODE.
    ENDIF.


    IF SY-SUBRC &amp;lt;&amp;gt; 0 OR RET_CODE &amp;lt;&amp;gt; 0.
       RAISE ERROR.
    ENDIF.
    FREE OBJECT H_LABELPRNCOM.
                             .
ENDFUNCTION.

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 May 2017 17:17:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447704#M13466</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-05-05T17:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when call method of COM Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447705#M13467</link>
      <description>&lt;P&gt;Problem with types of parameters?&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 17:48:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447705#M13467</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-05-05T17:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when call method of COM Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447706#M13468</link>
      <description>&lt;P&gt;ABAP documentation says:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"The return value of the external method meth can be stored in a data object rc. This data object expects, in accordance with the called method, a character-like data type of length 8 or a data type of type ole2_object from the type group OLE2 to be able to accept the addressed object. "&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 17:58:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447706#M13468</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-05-05T17:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when call method of COM Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447707#M13469</link>
      <description>&lt;P&gt;Thank you Sandra,&lt;/P&gt;&lt;P&gt;In my case: I've tried void method and string return method also. But nothing changes same error.&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 13:34:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447707#M13469</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-05-08T13:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when call method of COM Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447708#M13470</link>
      <description>&lt;P&gt;What about input params, i have only 4 input params in my .NET application&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 13:35:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447708#M13470</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-05-08T13:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when call method of COM Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447709#M13471</link>
      <description>&lt;P&gt;I was also talking about types of arguments. And about RET_CODE too.&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 14:59:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447709#M13471</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-05-08T14:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when call method of COM Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447710#M13472</link>
      <description>&lt;P&gt;You should also try rewriting your COM object, with a method without parameter, just to make sure whether you can call it from ABAP, to know whether it's related to parameters.&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 15:02:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447710#M13472</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-05-08T15:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when call method of COM Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447711#M13473</link>
      <description>&lt;P&gt;Thank you Sandra&lt;/P&gt;&lt;P&gt;I found the problem. This method must return string value "0" &lt;/P&gt;&lt;P&gt;That it was a problem in my case.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 08:46:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-call-method-of-com-object/m-p/447711#M13473</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-05-10T08:46:24Z</dc:date>
    </item>
  </channel>
</rss>

