Re: OLE Field

Gunjan,
When you Forte OLE Field, the Forte GUI environment is known as a
'Container Application'. Using the 'InsertObject' command, it can host
different 'Insertable OLE 2.0 Objects'.
When clicking on the Insert Object button, you will be presented with a
list of OLE objects that have identified themselves as 'Insertable OLE 2.0
object'.
One problem with hosting these OLE objects is that you cannot keep state.
For example, you run an Excel object and modified a spreadsheet -- when you
exit the container, the state information goes away. Forte solves this by
giving you a cache file, which is essentially a persistance image of the
OLE object. You can later use the LoadCacheFile method to retrieve the data.
By the way, using the ActiveXField, Forte can also host OLE Custom Controls
(OCX).
Lee Wei
At 01:41 PM 7/6/98 -0400, Gunjan Vijayvergia wrote:
>
This is what I got from the Forte OLE field documentation. I did not
understand teh part about the cache file and Insert Object . have
been using Visual C++ mostly before this and we all know how easy
this is there !!!
Could somebody explain ?
Documentation from Forte Help File Forte Ver 2.0
OLE Field Properties dialog
This dialog allows you to set the properties of OLE fields.
The Fort
é properties dialog for the OLE field allows you to set only the
attribute name, help text, and size policy for the OLE field. To set the
cache file name, and the default linked or embedded object for the OLE
field, you must use the Insert Object button on the OLE Field properties
dialog to open the Windows? Cache File and Insert Object dialogs. Because
these dialogs are provided by Windows, you need to use Windows to access
them. See your Windows documentation for information about the Insert
Object dialog.
The OLE field properties that can be set in this dialog are as follows:
Property Setting
Attribute Name The attribute name for the outline field.
Cache File Name This is a read-only property that shows the cache file
name specified in the Windows Cache File dialog for the OLE field.
Insert Object Opens the Windows Cache File and Insert Object dialogs,
where you can specify the cache file name and default linked or embedded
object for the OLE field respectively.
Help Text Opens the Help Text dialog for the field. See Help Text...
command for
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

Nextver field was locked because it was from 2004 and some very new forum user resurrected it to ask a new question. They should have been polite and posted their inquiry freshly new. Then they would have availed themselves of actually getting assistance directed to them.
Thus some moderator froze it to prevent the thread being hijacked away from the original poster. By the way, that O.P. hasn't posted anything to the forums since that 2004 date.

Similar Messages

  • Using .jpg images in a MS Access BLOB OLE field

    Post Author: bsorensen
    CA Forum: General
    This is condensed from page 124 of the CR v8.5 User's Guide:
    "BLOB (Binary Large Object) fieldsIn general, Crystal Reports allows you to access BLOB fields containing: JPEG, TIFF, or PNG images. In addition, if your data resides in a Microsoft Access database, then Crystal Reports enables you to report on BLOB fields containing OLE 1 and 2 objects and metafiles."
    I have a report that prints one page for each record. I want to include an image that is unique to each record. The above says I should be able to use .jpg's; however, when I do, each page displays only the path to the image and not the image itself.
    I defined an OLE object field in my Access 03 database, performed an insert object and pointed the path to each file. I use CR v8.5 Standard.
    When I change the images to bitmap (.bmp files), it does display the images; however, the resolution is inferior to .jpg.
    Any Ideas?

    You can try ps.setDate, which takes an instance of java.sql.date.
    or ps.setTimestamp to include the time.
    Edited by: fgb on 06-Feb-2010 13:00

  • Dynamic OLE - Field Data - Path Format??

    If I want to dynamically link my OLE to a variable-specific path, what is the correct format in Excel?
    For instance, I've used
    Z:\Jesse\Crystal Reports Tests\9-15-2009\FILENAME.slddrw to link to a SolidWorks drawing file...the original OLE image is correct, but I can't get the "dynamic" part to link correctly to show different files for different variables. HELP! PLEASE!

    Not a Database issue. Moving to Report Design forum

  • Ole object missing on pdf file

    i have long raw field in database. i am saving excel workbook in it through ole container. it displays well on report but when i generate pdf from report it miss ole field and show that portion of report blank. It exports ole object in postscript format (.eps) but i dont now any software which can open this file and show result on screen.
    i am using developer 6i with oracle 9i database in client-server environment.
    thanks

    Hello,
    Take a look to the thread :
    Re: Image in Reports
    eps files are "Encapsulated PostScript", for more details :
    http://www.tailrecursive.org/postscript/eps.html
    for example
    Regards

  • OLE document and AbapWebdynpro

    Dear All, we want to create an AbapWebdyn pro web application in order to manage our documents.
    We are using template document that contain OLE fields "SAP.OLELinkServer".
    Using Abap webdynpro, how could we manage to update these fields at document creation based?
    Regards
    Patrice
    PS : Question also posted in document management forume

    Welcome to the Apple Community.
    Documents & Data storesz your iWork documents, you'll find them in Pages, numbers or Keynote. Several other apps also use documents & data, if you use any of these apps, you'll find that data when you open those apps.
    To see exactly what is using documents and data, look at system preferences > iCloud > manage.

  • Re: OLE Intergration

    Tom,
    I have tried connecting to Microsoft Excel as an OLE automation
    server. I used both in-place-activation with Forte's OLE Field
    and dynamically communicating with Excel using OLE automation.
    That worked fine, but I find it quite difficult to
    get the right parameter datatypes, and in finding the right
    Excel class/method to use.
    I did all this by looking at the graph example provided on the
    Forte installation - if you have not already done so.
    Lee Wei
    >
    Has anyone successfully implemented data exchange between Forte
    application and (for example a Microsoft Word document). We are
    having a lot of trouble trying to pass data to Word. We are receiving
    some very low-level (interface) errors.
    If anyone has a working example of passing data from Forte screen to
    Word or any other Microsoft Windows application, I would appreciate it
    if you could send me a copy.
    Any help would be greatly appreciated.

    DDE is an interface much like OLE - e.g. it has calls to invoke methods and set properties - again you need the doc from the vendor to know what properties to set and methods to call. Likewise the C interface can be used to call public apis exposed by the vendor in a DLL or EXE. This uses the ORA_FFI package. Again the interface is simple (fo someone who understands C) but without the vendor doc about any APIs they expose it's of no use.
    What interfaces does the software expose?

  • Ole / longraw

    I have a OLE field of longraw type. I want
    to get the contents of the OLE field.
    1) which select command in sql? and
    2) which function can get that?
    thanks:
    zehavishul

    Hi Alex,
    "If u use the file dialog u can specify the extension"
    I don't use this dialog because I don't know how to load such a file into the database (I know only read_image_file, text_io etc).
    OLE shows a file dialog but I can't find the property for restricting the files to pdf.
    Wolfram

  • Storing Adobe file into OLE filed

    I'm moving a PDF file to store it as an OLE field into a table of Microsoft Access. Recently I had to update from Adobe Acrobat 6.1 to Adobe Reader 9.0. After getting the new Version of Adobe, I can store the document but when I want to open it, I'm getting this message: The operation on the Acrobat Document object failed. The OLE server may not be registered. To register the OLE server, reinstall it. The second problem is that the dadabase is growing like a monster and it takes too much storage. Can anybody help me with this? Thanks.

    I don't really know forms very well. I think you would get a better answer in the forms forum.
    Larry

  • Print Word File from Oracle Report Builder 6.0

    Dear All
    I am using Reports 6 , I have a requirement that i have to print a word document (somewhere around 8 to 9 pages) after printing a report is there any way to execute the same. The word file has the details like agreement , etc so each and every time when i print that particular report , i want to print the contents also which is there in word file. If possible please tell me the steps to do. Thanks in Advance.
    V.Sat

    Possibilities are a bit limited. You can embed a word file as an OLE object in Reports.
    However, OLE can only display one page. So, you have to split your original documents in several one page documents. Put each page in a separate OLE field.
    You can also put the OLE pages (again, single pages only) in a BLOB in the database. In a query you select the pages from the BLOB.
    You have to store the pages through Forms, though. You cannot simply upload them to the table through pl/sql.

  • Urgent:Retrieving Word Docs in Reports

    I have saved Word documents in an Oracle 7.3 database using OLE
    thru Forms. I want to retrieve the docs in the reports
    automatically as the particular report runs..How can i retrieve
    these docs in from the developer reports...
    null

    what you can do is you run the live previewer, and then you
    create a field by using the field icon, and then you set the
    property for this field.
    a) source: the OLE field from the database, of course you got
    to select when you create the report but you can choose not to
    display when the report builder ask you to field the text part.
    I assume you are using the display style of letter format.
    b) File format: OLE 2
    c)data type: long raw.
    Adil Sameer (guest) wrote:
    : I have saved Word documents in an Oracle 7.3 database using
    OLE
    : thru Forms. I want to retrieve the docs in the reports
    : automatically as the particular report runs..How can i
    retrieve
    : these docs in from the developer reports...
    null

  • Integrating True DBGrid 6.0 with Forte using OLEAutomation

    I'm attempting to manipulate an Appex TrueDBGrid object using Forte TOOL
    code. So far I've made it through the following steps:
    Used olegen to create a PEX file for the TrueDBGrid60 ocx file (tdbg6.ocx).
    Imported this pex file into my workspace.
    Created a display project with TrueDBGrid60, Framework, DisplayProject and
    OLE as supplier plans
    Added a window class
    On Window, added an OLE Field with mapped type ITrueDBGridCtrl.
    I attempted to interpret the following VB code for adding a column:
    ' Create a new Column 0
    Dim C As TrueDBGrid60.Column
    Set C = TDBGrid1.Columns.Add(0)
    ' Initialize the new Column 0
    With C
    .Visible = True ' Make it visible
    .DataField = "LAST" ' Set the column's database field
    .Caption = "Last Name" ' Set the column's caption
    End With
    ' Make Column 0 as wide as Column 1
    C.Width = TDBGrid1.Columns(1).Width
    I can get this code to work in VBA, but I have difficulty when converting in
    to Forte Tool code.
    I added the following code to the Window class init method:
    super.Init();
    dbgrid = new();
    dbgrid.objectReference; -- not sure what to set this to?
    col : TrueDBGrid60.Column;
    cols : TrueDBGrid60.Columns = new();
    cols.add(0); -- this line causes run time error because object reference is
    not set.
    //dbgrid.columns = cols;
    //dbgrid.classicAdd(cols); these lines don't work
    col.visible = true;
    col.caption = 'Column 1';
    col.width = 1.5;
    This is as far as I've gone.
    Has any one used the Appex TrueDBGrid within a Forte Window?
    If yes, Is there any documentation on this subject that clarify the
    necessary processes?
    Thanks
    Brian
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi Mastek,
    You should be able to accomodate your needs with respect to integration of your AD accounts with SAP ECC ABAP. This can be done via LDAP connector configuration. The below has info on how to perfrom the configuration at a high level. You will have to integrate, and map certain user data. You may also want to do some LDAP Connector research:
    [http://help.sap.com/saphelp_nw70/helpdata/en/10/1a063a15c611d4b61f0000e835363f/content.htm]
    On the Java stack - you can also confugure UME to integrate/authenticate with AD:
    [http://help.sap.com/saphelp_nw70ehp2/helpdata/en/12/7678123c96814bada2c8632d825443/content.htm]
    Hope this helps!

  • Load dynamically image from path

    Hi,
    I want load image from path with CR4E. I have a report with a field that contain the path of image and a empty PictureObject.
    I wanna put the image from the path in the picture image.
    That work when i have a section that is unique :
    I can obtain the path with this code
                        IField field = clientDoc.getDataDefinition().getResultFields()
                                  .findField(fieldObject.getDataSourceName(), FieldDisplayNameType.formulaName, java.util.Locale.getDefault());
                        RowsetMetaData rowSetMetaData = new RowsetMetaData();
                        rowSetMetaData.setDataFields(clientDoc.getDataDefinition().getResultFields());
                        RowsetCursor resultCursor = clientDoc.getRowsetController().createCursor(null, rowSetMetaData);
                        Value values = clientDoc.getRowsetController().browseFieldValues(field, -1);
    And i can view the image with this code
                        clientDoc.getReportDefController().getReportObjectController().remove(picture);
                        PictureObject boPictureObject = clientDoc.getReportDefController().getReportObjectController().importPicture(path, theSection, picture.getLeft(), picture.getTop());
                        boPictureObject.setWidth(picture.getWidth());          
                        boPictureObject.setWidth(picture.getHeight());
    But when the section is not unique, it is always the same image in all section.
    How then I to make? A resolution has t-il there ? (with crystal report 8 there was ISectionEvent for this)
    Thanks for your help!
    Edited by: hermannpencole on Mar 24, 2011 5:35 PM

    Hi fUjI_FX,
    <br/>
    This is a solution for report with a field that contain the path of image and a empty PictureObject. the filed for the path is under picture Object, then image hide this field. (in this example the field for the path get the path from database with field PATH or MARKET_PATH you can change it).
    - at first open the doc
    <pre>
          * Load.
          * @throws ReportSDKException the report sdk exception
          * @throws IOException Signals that an I/O exception has occurred.
         private void load() throws ReportSDKException, IOException {
              clientDoc = new ReportClientDocument();
              clientDoc.open(new File(report.getPath()).getAbsolutePath(), OpenReportOptions._openAsReadOnly);
              //..here change datasource if necessary
              clientDoc.getDatabaseController().logon(username, password);
    </pre>
    - After  assign parameters if necessary with with CRJavaHelper.addDiscreteParameterValue. If you want communicate with the user you must develop your own Dialog Box (i have it if you want).
    <br/><br/>
    - And finally search on the reportDoc if you have Field with image (field named PATH and MARKED PATH in this sample) and replace it with picture image : sample code
    <pre>
          * Process report.
          * @param reportClientDocument the report client document
          * @throws IOException Signals that an I/O exception has occurred.
         private void processReport(IReportClientDocument reportClientDocument) throws IOException {
              try {
                   if (reportClientDocument == null) {
                        return;
                   // Get the area collection of the report
                   Areas theAreaCollection =  reportClientDocument.getReportDefController().getReportDefinition().getAreas();
                   if (theAreaCollection == null) {
                        return;
                   // Iterates through the areas
                   int lNumberOfAreas = theAreaCollection.size();
                   for (int lArea = 0; lArea < lNumberOfAreas; lArea++) {
                        IArea anArea = theAreaCollection.getArea(lArea);
                        if (anArea != null) {
                             Sections theSectionCollection = anArea.getSections();
                             if (theSectionCollection != null) {
                                  // Iterates through the sections
                                  long lNumberOfSections = theSectionCollection.size();
                                  for (int lSection = 0; lSection < lNumberOfSections; lSection++) {
                                       ISection aSection = theSectionCollection.getSection(lSection);
                                       processSection(aSection);
              } catch (ReportSDKException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
          * Process section.
          * @param theSection the the section
          * @throws ReportSDKException the report sdk exception
          * @throws IOException Signals that an I/O exception has occurred.
         private void processSection(ISection theSection) throws ReportSDKException, IOException {
              if (theSection == null) {
                   return;
              //System.out.printf("----> ProcessSection2 %s\n", theSection.getName());
              ReportObjects theReportObjectCollection = theSection.getReportObjects();
              if (theReportObjectCollection == null) {
                   return;
              // Iterate through the section items
              int lNumberOfReportObjects = theReportObjectCollection.size();
              Values values = null;
              PictureObject picture = null;
              String formulaName = null;
              for (int lReportObject = 0; lReportObject < lNumberOfReportObjects; lReportObject++) {
                   IReportObject aReportObject = theReportObjectCollection.getReportObject(lReportObject);
                   if (isNotifiable(aReportObject)) {
                        FieldObject fieldObject = (FieldObject) aReportObject;
                        IField field = clientDoc.getDataDefinition().getResultFields()
                                  .findField(fieldObject.getDataSourceName(), FieldDisplayNameType.formulaName, java.util.Locale.getDefault());
                        RowsetMetaData rowSetMetaData = new RowsetMetaData();
                        rowSetMetaData.setDataFields(clientDoc.getDataDefinition().getResultFields());
                        RowsetCursor resultCursor = clientDoc.getRowsetController().createCursor(null, rowSetMetaData);
                        formulaName = field.getFormulaForm();
                        values = clientDoc.getRowsetController().browseFieldValues(field, -1);
                   if (aReportObject.getKind() != null && aReportObject.getKind().equals(ReportObjectKind.picture)) {
                        picture = (PictureObject) aReportObject;
              if (picture != null && formulaName != null) {
                   //Create blank image
                   int resolution = getResolution();
                   int width = (picture.getWidth() * resolution) / 1440;
                   int height = (picture.getHeight() * resolution) / 1440;     
                   String locationTemp = System.getProperty("java.io.tmpdir") + "imagegen.png";
                   File tempFile = new File(locationTemp);
                   tempFile.deleteOnExit();     
                   ImageUtils.createBlankImage(tempFile, width, height, resolution);
                   clientDoc.getReportDefController().getReportObjectController().remove(picture);
                   PictureObject boPictureObject = clientDoc.getReportDefController().getReportObjectController().importPicture(locationTemp, theSection, picture.getLeft(), picture.getTop());
                   boPictureObject.setWidth(picture.getWidth());               
                   boPictureObject.setWidth(picture.getHeight());     
                   if (values != null && !values.isEmpty()) {
                        //Create image in temp dir
                        for (int i=0; i < values.size(); i++) {                    
                             String locationString = (String) values.get(i).computeText().replaceAll("[\\\"\\']", "");                    
                             File fileToResize = new File(locationString);     
                             if (locationString.isEmpty()) {
                                  //Nothing blank image is already generated
                             } else if (!fileToResize.exists()) {
                                  locationTemp = System.getProperty("java.io.tmpdir") + "imagegen" + locationString.replaceAll("[:/\\\\\\. ]", "_") + ".png";
                                  tempFile = new File(locationTemp);
                                  tempFile.deleteOnExit();     
                                  ImageUtils.createImageNotFound(tempFile, width, height, resolution);
                             } else {
                                  locationTemp = System.getProperty("java.io.tmpdir") + "imagegen" + locationString.replaceAll("[:/\\\\\\. ]", "_") + ".png";
                                  tempFile = new File(locationTemp);
                                  tempFile.deleteOnExit();     
                                  ImageUtils.createResizedCopy(fileToResize, tempFile, width, height, resolution);
                        //Create dynamic picture
                        PictureObject boPictureObject2 = (PictureObject)boPictureObject.clone(true);
                        ConditionFormula c = new ConditionFormula();
                        c.setText( "\"" + System.getProperty("java.io.tmpdir") +
                                  "imagegen\" & replace(replace(replace(replace(replace(replace(replace(" + formulaName + ",\"\\\",\"_\"),\":\",\"_\"),\"\"\"\",\"\"),\" \",\"_\"),\"'\",\"\"),\"/\",\"_\"),\".\",\"_\") & \".png\"");
                        boPictureObject2.setGraphicLocationFormula(c);
                        boPictureObject2.setLeft(picture.getLeft());
                        boPictureObject2.setTop(picture.getTop());
                        boPictureObject2.setWidth(picture.getWidth());               
                        boPictureObject2.setHeight(picture.getHeight());     
                        clientDoc.getReportDefController().getReportObjectController().modify(boPictureObject, boPictureObject2);
          * Gets the resolution.
          * @return the resolution
         private int getResolution() {
         double dResolution = MIN_RESOLUTION;
              switch (printQuality) {
                   case PRINT_QUALITY_HIGH:   dResolution = MAX_RESOLUTION; break;
                   case PRINT_QUALITY_MEDIUM: dResolution = MIN_RESOLUTION + ((MAX_RESOLUTION - MIN_RESOLUTION) * .6);     break;
                   case PRINT_QUALITY_NORMAL: dResolution = MIN_RESOLUTION + ((MAX_RESOLUTION - MIN_RESOLUTION) * .3);     break;
                   case PRINT_QUALITY_DRAFT: dResolution = MIN_RESOLUTION;     break;
              return (int)dResolution;
          * Checks if is notifiable.
          * @param theObjectPtr the the object ptr
          * @return true, if is notifiable
          * @throws ReportSDKException the report sdk exception
          * @throws IOException Signals that an I/O exception has occurred.
         private boolean isNotifiable(IReportObject theObjectPtr) throws ReportSDKException, IOException {
              if (theObjectPtr == null) {
                   return false;
              //System.out.printf("----> IsNotifiable %s\n", theObjectPtr.getName());
              ReportObjectKind kind = theObjectPtr.getKind();
              if (kind.equals(ReportObjectKind.field)) {
                   // The report object is a database field, let's see if it is an olefield
                   return (isOLEField((FieldObject) theObjectPtr));
              } else if (kind.equals(ReportObjectKind.subreport)) {
                   // Don't plug imager, but examine the subreport for other image
                   ISubreportObject aSubreport = (ISubreportObject) theObjectPtr;
                   processReport(clientDoc.getSubreportController().getSubreport(aSubreport.getSubreportName()));
                   return false;
              } else {
                   // ignore all other kinds
                   return false;
          * Checks if is oLE field.
          * @param fieldObject the field object
          * @return true, if is oLE field
          * @throws ReportSDKException the report sdk exception
         private boolean isOLEField(final FieldObject fieldObject) throws ReportSDKException {
              IField field = clientDoc.getDataDefinition().getResultFields()
                        .findField(fieldObject.getDataSourceName(), FieldDisplayNameType.formulaName,
                                  java.util.Locale.getDefault());
              if (field == null) {
                   return false;
              //System.out.printf("----> IsOLEField %s\n", field.getName());
              return ((field.getName().equalsIgnoreCase(("PATH"))) || (field.getName().equalsIgnoreCase(("MARKER_PATH"))));
    </pre>
    Edited by: hermannpencole on May 25, 2011 3:50 PM

  • Report to a PDF file with Ole Obj and codebar fields

    Im writing a report with some ole objects (images) and a codebar Field. When I run the report saving the result to a PDF file the Ole objects and the codebar fields doesnt appears in it. But, when run it directly in the report builder it does appears. Some idea about it? I would apreciate it.
    Luis

    You mean a barcode? That is a font, not an OLE object. If you have the font installed on your PC, you can have barcodes in your pdf report.
    PDF also has the possibility on embedded fonts, so the font doesn't have to be on every PC. There are several threads about this. Search this forum for 'embedded font', e.g. Font embedding in reports

  • Oracle OLE DB provider truncates LONG field's data

    I am using Visual Basic 6, Oracle 8.1, and use ADO to connect to the Oracle database.
    I have a problem with OLE DB provider OraOLEDB.Oracle reading a LONG field (MEMO field in Access).
    When I tried to get the value of the LONG field, it truncates it to 100 characters.
    I do not have the problem using Microsoft Oracle OLE DB Provider MSDAORA.
    This is the Oracle table:
    CREATE TABLE tblA (
    tblA_KEY NUMBER(10) NOT NULL,
    tblA_MEMO LONG NULL
    This is the VB 6 code:
    Set rs = New ADODB.Recordset
    rs.Open ssql, adoConn, adOpenForwardOnly, adLockReadOnly
    sMemo = "" & rs.Fields("tblA_Memo") -->> sMemo contains only the first 100
    characters of tblA_Memo
    How can I fix this?
    Thank you.

    Thanks. I assume you are talking about 9.2 version of Oracle, right?
    While we are in the subject of LONG field. In Oracle 8.1, I can not do the following sql stt:
    select * from tblA where tblA_Memo like '%york%'
    It gives me the error "ORA-00932: inconsistent datatypes"
    Can I do this in Oracle 9.2 ?
    Thank you.

  • Downloading the multiple columns(Multiple fields) into excel sheet in OLE

    HI friends,
                    I am using OLE method to download 3 internal tables data into 3 worksheeets in one excel file. i am able to create 3 worksheets.but i am getting the whole data merged into one column(A column) where as i want 5 columns in one sheet if i have 5 database table fields.can anybody check my code and propose the solution for this.
      INCLUDE ole2incl.
      DATA: w_cell1 TYPE ole2_object,
            w_cell2 TYPE ole2_object.
    *--- Ole data Declarations
      DATA: h_excel TYPE ole2_object,     "Excel object
            h_mapl TYPE ole2_object,      "list of workbooks
            h_map TYPE ole2_object,       "workbook
            h_zl TYPE ole2_object,        "cell
            h_f TYPE ole2_object,         "font
            gs_interior TYPE ole2_object, "Pattern
            worksheet TYPE ole2_object,
            h_cell TYPE ole2_object,
            h_cell1 TYPE ole2_object,
            range TYPE ole2_object,
            h_sheet2 TYPE ole2_object,
            h_sheet3 TYPE ole2_object,
            gs_font TYPE ole2_object,
            flg_stop(1) TYPE c.
      DATA gv_sheet_name(20) TYPE c .
    * start Excel IF h_excel-header = space OR h_excel-handle = -1.
      CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
    *--- get list of workbooks, initially empty
      CALL METHOD OF h_excel 'Workbooks' = h_mapl.
      SET PROPERTY OF h_excel 'Visible' = 1.
      CALL METHOD OF h_mapl 'Add' = h_map.
      gv_sheet_name = 'SM37'.
      GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
      SET PROPERTY OF worksheet 'Name' = gv_sheet_name .
    *--Formatting the area of additional data 1 and doing the BOLD
      CALL METHOD OF h_excel 'Cells' = w_cell1
           EXPORTING #1 = 1
                     #2 = 1.
      CALL METHOD OF h_excel 'Cells' = w_cell2
           EXPORTING #1 = 1
                     #2 = 50.
      CALL METHOD OF h_excel 'Range' = h_cell
           EXPORTING #1 = w_cell1
                     #2 = w_cell2.
      GET PROPERTY OF h_cell 'Font' = gs_font.
      SET PROPERTY OF gs_font 'Bold' = 1 .
      DATA l_rc TYPE i.
      DATA : y_file TYPE string.
       y_file = x_file.
      CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
          data = tab_sm37[]
      CHANGING
           rc = l_rc
       EXCEPTIONS
            cntl_error = 1
            error_no_gui = 2
         not_supported_by_gui = 3
            OTHERS = 4.
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
          #1 = 1
          #2 = 1.
      CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 1.
      CALL METHOD OF h_excel 'Range' = range
           EXPORTING
                #1 = w_cell1
               #2 = w_cell2.
      CALL METHOD OF range 'Select'.
      CALL METHOD OF worksheet 'Paste'.
      gv_sheet_name = 'ST22'.
      GET PROPERTY OF h_excel 'Sheets' = h_sheet2 .
      CALL METHOD OF h_sheet2 'Add' = h_map.
      SET PROPERTY OF h_map 'Name' = gv_sheet_name .
      GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
    *--Formatting the area of additional data 1 and doing the BOLD
      CALL METHOD OF h_excel 'Cells' = w_cell1
           EXPORTING
                #1 = 1
                #2 = 1.
      CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
                 #1 = 1
                 #2 = 50.
      CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
                 #1 = w_cell1
                #2 = w_cell2.
      GET PROPERTY OF h_cell 'Font' = gs_font .
      SET PROPERTY OF gs_font 'Bold' = 1 .
      CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
          data = tab_sm37[]
      CHANGING
           rc = l_rc
       EXCEPTIONS
            cntl_error = 1
            error_no_gui = 2
         not_supported_by_gui = 3
            OTHERS = 4.
    CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
                #1 = 1
                #2 = 1.
      CALL METHOD OF h_excel 'Cells' = w_cell2
             EXPORTING
               #1 = 1
               #2 = 1.
      CALL METHOD OF h_excel 'Range' = range
             EXPORTING
                #1 = w_cell1
                #2 = w_cell2.
      CALL METHOD OF range 'Select'.
      CALL METHOD OF worksheet 'Paste'.
      gv_sheet_name = 'WE02'.
      GET PROPERTY OF h_excel 'Sheets' = h_sheet3 .
      CALL METHOD OF h_sheet3 'Add' = h_map.
      SET PROPERTY OF h_map 'Name' = gv_sheet_name .
      GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
    *--Formatting the area of additional data 1 and doing the BOLD
      CALL METHOD OF h_excel 'Cells' = w_cell1
               EXPORTING
                     #1 = 1
                     #2 = 1.
      CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
               #1 = 1.
      CALL METHOD OF h_excel 'Range' = h_cell
              EXPORTING
                  #1 = w_cell1
                 #2 = w_cell2.
      GET PROPERTY OF h_cell 'Font' = gs_font.
      SET PROPERTY OF gs_font 'Bold' = 1 .
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
          data = tab_sm37[]
      CHANGING
           rc = l_rc
       EXCEPTIONS
            cntl_error = 1
            error_no_gui = 2
         not_supported_by_gui = 3
            OTHERS = 4.
    CALL METHOD OF h_excel 'Cells' = w_cell1
              EXPORTING
                  #1 = 1
                  #2 = 1.
      CALL METHOD OF h_excel 'Cells' = w_cell2
              EXPORTING
                   #1 = 1
                   #2 = 1.
      CALL METHOD OF h_excel 'Range' = range
              EXPORTING
                   #1 = w_cell1
                   #2 = w_cell2.
      CALL METHOD OF range 'Select'.
      CALL METHOD OF worksheet 'Paste'.
    *--- disconnect from Excel
      FREE OBJECT h_zl.
      FREE OBJECT h_mapl.
      FREE OBJECT h_map.
      FREE OBJECT h_excel.
    thanks in advance.
    Edited by: MAHESH MUMAR on Feb 27, 2009 2:58 PM

    try this code
    INCLUDE ole2incl.
    DATA: w_cell1 TYPE ole2_object,
    w_cell2 TYPE ole2_object.
    DATA: h_excel TYPE ole2_object, "Excel object
          h_mapl  TYPE ole2_object, "list of workbooks
          h_map   TYPE ole2_object, "workbook
          h_zl    TYPE ole2_object, "cell
          h_f     TYPE ole2_object, "font
          gs_interior TYPE ole2_object, "Pattern
          worksheet TYPE ole2_object,
          h_cell   TYPE ole2_object,
          h_cell1   TYPE ole2_object,
          range     TYPE ole2_object,
          h_sheet2  TYPE ole2_object,
          h_sheet3  TYPE ole2_object,
          gs_font    TYPE ole2_object,
          flg_stop(1) TYPE c.
    DATA gv_sheet_name(20) TYPE c .
    * start Excel IF h_excel-header = space OR h_excel-handle = -1.
    CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
    *--- get list of workbooks, initially empty
    CALL METHOD OF h_excel 'Workbooks' = h_mapl.
    SET PROPERTY OF h_excel 'Visible' = 1.
    CALL METHOD OF h_mapl 'Add' = h_map.
    gv_sheet_name = 'SM37'.
    GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
    SET PROPERTY OF worksheet 'Name' = gv_sheet_name .
    *--Formatting the area of additional data 1 and doing the BOLD
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING #1 = 1
      #2 = 50.
    CALL METHOD OF h_excel 'Range' = h_cell
      EXPORTING #1 = w_cell1
      #2 = w_cell2.
    GET PROPERTY OF h_cell 'Font' = gs_font.
    SET PROPERTY OF gs_font 'Bold' = 1 .
    DATA l_rc TYPE i.
    DATA : y_file TYPE string.
    y_file = x_file.
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
        data                 = tab_sm37
      CHANGING
        rc                   = l_rc
      EXCEPTIONS
        cntl_error           = 1
        error_no_gui         = 2
        not_supported_by_gui = 3
        OTHERS               = 4.
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Range' = range
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    CALL METHOD OF range 'Select'.
    CALL METHOD OF worksheet 'Paste'.
    gv_sheet_name = 'ST22'.
    GET PROPERTY OF h_excel 'Sheets' = h_sheet2 .
    CALL METHOD OF h_sheet2 'Add' = h_map.
    SET PROPERTY OF h_map 'Name' = gv_sheet_name .
    GET PROPERTY OF h_excel 'ACTIVESHEET' = gv_sheet_name.
    *--Formatting the area of additional data 1 and doing the BOLD
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 50.
    CALL METHOD OF h_excel 'Range' = h_cell
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    GET PROPERTY OF h_cell 'Font' = gs_font .
    SET PROPERTY OF gs_font 'Bold' = 1 .
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
        data                 = tab_sm37[]
      CHANGING
        rc                   = l_rc
      EXCEPTIONS
        cntl_error           = 1
        error_no_gui         = 2
        not_supported_by_gui = 3
        OTHERS               = 4.
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Range' = range
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    CALL METHOD OF range 'Select'.
    CALL METHOD OF worksheet 'Paste'.
    gv_sheet_name = 'WE02'.
    GET PROPERTY OF h_excel 'Sheets' = h_sheet3 .
    CALL METHOD OF h_sheet3 'Add' = h_map.
    SET PROPERTY OF h_map 'Name' = gv_sheet_name .
    GET PROPERTY OF h_excel 'ACTIVESHEET' = gv_sheet_name.
    *--Formatting the area of additional data 1 and doing the BOLD
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1.
    CALL METHOD OF h_excel 'Range' = h_cell
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    GET PROPERTY OF h_cell 'Font' = gs_font.
    SET PROPERTY OF gs_font 'Bold' = 1 .
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
        data                 = tab_sm37[]
      CHANGING
        rc                   = l_rc
      EXCEPTIONS
        cntl_error           = 1
        error_no_gui         = 2
        not_supported_by_gui = 3
        OTHERS               = 4.
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Range' = range
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    CALL METHOD OF range 'Select'.
    CALL METHOD OF worksheet 'Paste'.
    free object h_zl.
    FREE OBJECT h_mapl.
    FREE OBJECT h_map.
    FREE OBJECT h_excel.

Maybe you are looking for