Exercise 1: Define OLE Objects and Other Data 

Prerequisites

Procedure

To define the program data and OLE objects required, enter these statements in the declaration section of the ABAP program OLECLIENT:

report oleclient.

tables: kna1, brfckna1.

parameters: kunnr like kna1-kunnr default   '1'.

*

* Internal table customer_data with structure of BRFCKNA1

*

data: begin of customer_data occurs 0.

include structure brfckna1.

data: end of customer_data.

*

* OLE-specific include file

*

include ole2incl.       " OLE-specific include file

*

* Define OLE objects of type OLE_OBJEKT

*

data: excel type ole2_object.         " EXCEL object

data: books type ole2_object.         " collection of books

data: book type ole2_object.          " book

data: cell type ole2_object.          " cell

 

*

* Loop counter: Start value --->        1st output line in EXCEL table

*

data: i type i value '4'.

How to Continue

Exercise 2: Initialize OLE Objects