Skip to content

Issue with OLE2_OBJECT (Microsoft interface) #175

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
yellowfisch opened this issue Oct 26, 2023 · 2 comments
Closed

Issue with OLE2_OBJECT (Microsoft interface) #175

yellowfisch opened this issue Oct 26, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@yellowfisch
Copy link

Hi!

I think this is rarely used, but occasionally the OLE2_OBJECT is used to call the interface to Microsoft products.

  DATA: lr_outlook        TYPE ole2_object,
        lr_mail           TYPE ole2_object,
        lr_ole_attachment TYPE ole2_object.
...

  " Create handler for outlook
  CREATE OBJECT lr_outlook 'Outlook.Application' NO FLUSH.

  " Create new mail
  CALL METHOD OF
      lr_outlook
      'CreateItem' = lr_mail
    EXPORTING
      #1           = 0.

The ABAP cleaner converts these lines as follows:

" Create handler for outlook
  lr_outlook = NEW #( 'Outlook.Application' NO FLUSH ).

  " Create new mail
  OF(
      lr_outlook
      'CreateItem' = lr_mail
      EXPORTING #1 = 0 ).

This, of course, gives us a syntax error. The rules that intervene here are:

Replace CREATE OBJECT with NEW constructor

Replace CALL METHOD with functional call

Perhaps it is possible to recognise that the data type is OLE2_OBJECT, and in that case exclude the coding from the rule?

Kind Regards,
Jürgen

@jmgrassau jmgrassau added the bug Something isn't working label Oct 26, 2023
@jmgrassau jmgrassau self-assigned this Oct 26, 2023
@jmgrassau
Copy link
Member

Hi Jürgen,

thanks a lot for reporting these bugs! These cases were indeed not yet considered, but the issue will be fixed with the next release.

Kind regards,
Jörg-Michael

@jmgrassau
Copy link
Member

Hi Jürgen,

thanks again for reporting this! The issues should now be fixed in version 1.9.0, which was just released.

Kind regards,
Jörg-Michael

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants