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: 

ole

Former Member
0 Kudos
204

This is the first time i am using ole.How do i use the functions.what is actually ole application and what are the fuctions which are called using the handler?how is it that the word file accessed???

Please do help me out.Thanks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos
135

Go to Se38 . In Menu ENVIRONMENT>EXAMPLES>CONTROLs EXAMPLES..

You will get some of the examples of OLE Examples.

some ex: are as follows..

in Se38 check these

1. SAPRDEMODOCUMENTCONTAINER

2.RSDEMO01

3. RSOLETT1.

Reward if usefull..

7 REPLIES 7

Former Member

Former Member
0 Kudos
135

Hi,

Through its Open Object Interface, ABAP supports the OLE2 Automation technique. Desktop applications that provide their functionality in the form of an OLE2 Automation Server (such as Excel or WinWord) can be thus be integrated into R/3.

All applications controlled by ABAP must be registered in R/3.

The following ABAP key words control the applications:

<b>CREATE OBJECT

SET PROPERTY

GET PROPERTY

CALL METHOD

FREE OBJECT</b>

When called from an ABAP program, the SAPGUI acts as OLE client, and the desktop application as the OLE server.

while working with ole, you must <b>include OLE2iNCL</b> program and define each object of type <b>OLE2_OBJECT</b>

<b>for more information follow these links.</b>

http://help.sap.com/saphelp_46c/helpdata/en/59/ae3c98488f11d189490000e829fbbd/frameset.htm

sample program on excel

http://help.sap.com/saphelp_46c/helpdata/en/72/90fd343603c95ee10000009b38f844/frameset.htm

regards,

Ashok Reddy

0 Kudos
135

my requirement is that there is a word document,where there is a value as &word& and this should be replaced by the value passed from sap.Is this possible.If possible how,Could you please give the code.this is done using ole

0 Kudos
135

hi nisha,

I am alos having the same requirement.

Can you plz send me a sample code @ doshivinod@gmail.com.

I will be gr8 help for me.

Former Member
0 Kudos
135

how do i get to know what are the functions available for the application used?

Former Member
0 Kudos
136

Go to Se38 . In Menu ENVIRONMENT>EXAMPLES>CONTROLs EXAMPLES..

You will get some of the examples of OLE Examples.

some ex: are as follows..

in Se38 check these

1. SAPRDEMODOCUMENTCONTAINER

2.RSDEMO01

3. RSOLETT1.

Reward if usefull..

former_member189059
Active Contributor
0 Kudos
135

* word declarations
  DATA: WORD             TYPE OLE2_OBJECT.
  DATA: DOCUMENTS        TYPE OLE2_OBJECT.
  DATA: ACTDOC           TYPE OLE2_OBJECT.
  DATA: SELECTION        TYPE OLE2_OBJECT.
  DATA: FIND             TYPE OLE2_OBJECT.

  CREATE OBJECT WORD 'WORD.APPLICATION' .
  IF SY-SUBRC NE 0 .
    MESSAGE S000(SU) WITH 'Error while creating OLE object!'.
    LEAVE PROGRAM .
  ENDIF .

*--setting object's visibility property
  SET PROPERTY OF WORD 'visible' = '1' .

  GET PROPERTY OF WORD 'documents' = DOCUMENTS.
  CALL METHOD OF DOCUMENTS 'Open'
    EXPORTING
      #1 = 'C:file.doc'. " your current doc

*--Getting active document handle
  GET PROPERTY OF WORD 'activedocument' = ACTDOC .

*--Getting applications handle
  GET PROPERTY OF ACTDOC 'application' = APPLICATION .
  GET PROPERTY OF APPLICATION 'Selection' = SELECTION.

* find
  GET PROPERTY OF SELECTION 'find' = FIND.
  SET PROPERTY OF FIND 'Text' = '&word&'.

  do 10 times.
    CALL METHOD OF FIND 'Execute'.

    CALL METHOD OF selection 'TypeText'
      EXPORTING
      #1 = 'some value'.
  enddo.