Skip to Content
avatar image
Former Member

Problem when call method of COM Object

I am trying to call external program from ABAP. I have built and registered COM object.

When Creating Objects it open new process (I can see from Task Manager). But CALL METHOD it gives error SY-SUBRC = 2

PS. This App has Method by name PrintBarcode with 2 params.

What is the problem can be?

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 <> 0 OR RET_CODE <> 0.
       RAISE ERROR.
    ENDIF.
    FREE OBJECT H_LABELPRNCOM.
                             .
ENDFUNCTION.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 05, 2017 at 05:48 PM

    Problem with types of parameters?

    Add comment
    10|10000 characters needed characters exceeded