SlideShare a Scribd company logo
1 of 21
Download to read offline
Follow Me on Twitter                                                                        Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z




        ABAP OLE AUTOMATION
At the end of the document you will find instructions on how to use the BLOG ABAPLOVERS.BLOGSPOT.COM
so that you will not miss any updates. This BLOG is updated on a daily basis and all the Tutorials (Files/PDFs)
associated with the BLOG are also updated from time to time. We encourage you to share these documents with
your friends colleagues and to upload them to you favorite file sharing websites like


    ●   http://www.rapidshare.com/
    ●   http://www.esnips.com/
    ●   http://www.slideshare.net/
    ●   http://www.megaupload.com


Get started register and stay tuned to ABAP.BLOGSPOT.COM


                                       Enter Your Email Address




                                                  Subscribe


                                       Delivered By FeedBurner




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                 Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z




Transactions
           ●   OLE
           ●   SOLE
       Run Transaction OLE the following screen will be displayed.




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                      Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z


In the above transaction you can start and stop each application to check if it has been
registered.
Run transaction SOLE to get a list of all the OLE applications registered in your
system. You can maintain these applications here.




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                 Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z




The above applications are stored in the table TOLE.
The following SAP tables are associated with OLE
   ●   TOLE                         OLE Applications
   ●   OLELOAD                      OLE type Information load
   ●   SWOTOLE                      Workflow Object Types OLE Applications
   ●   SWOTTOLE                      Workflow Object Types Texts OLE Applications
   ●   TOLET                        Workflow Object Types Texts OLE Applications


The following ABAP key words control the applications:
   ●   CREATE OBJECT
   ●   SET PROPERTY
   ●   GET PROPERTY
   ●   CALL METHOD
   ●   FREE OBJECT




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                     Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z




The Desktop application serves as the OLE server to the calling ABAP program. For
example when the ABAP program makes calls to the OLE application the SAPGUI
servers as the client.
The create statement generates the object of this class. The following return code
values can be encountered.
       SY-SUBRC = 0:
Object successfully generated.
       SY-SUBRC = 1:
SAPGUI communication error.
       SY-SUBRC = 2:
SAPGUI function call error. The frontend ports of SAP’s OLE implementation modules
are implemented only under Windows and Apple Macintosh.
       SY-SUBRC = 3:
The OLE-API call resulted in an error - possibly a storage space problem.
       SY-SUBRC = 4:
The object is not registered with SAP.




Note that for each OLE object there has to be a variable holding handle data for that




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                     Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z


object. The type-pool “ole2” defines the handle variable data of the type ole2_object.
For all the OLE automation programs “OLE2INCL” include should be used.


Please find below some examples of setting the properties of fonts, cell borders and
colors.


Font Properties.

SET PROPERTY OF name_font 'Name' = 'Times New Roman' .
SET PROPERTY OF size_font 'Size' = '12' .
SET PROPERTY OF bold_font 'Bold' = '0' . "Not bold
SET PROPERTY OF Italic_font 'Italic' = '0' . "Not Italic
SET PROPERTY OF underline_font 'Underline' = '0' . "Not underlined


Paragraph Formatting
SET PROPERTY OF allignment_parformat 'Alignment' = '3' . "Justified




Similarly for EXCEL




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                               Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z




DATA: d_excel          TYPE   ole2_object ,
      d_cell1          TYPE   ole2_object ,
      d_cell2          TYPE   ole2_object ,
      d_cells          TYPE   ole2_object ,
      d_range          TYPE   ole2_object ,
      d_font           TYPE   ole2_object ,
      d_interior       TYPE   ole2_object ,
      d_columns        TYPE   ole2_object ,
      d_charts         TYPE   ole2_object ,
      d_chart          TYPE   ole2_object ,
      d_charttitle     TYPE   ole2_object ,
      d_charttitlech   TYPE   ole2_object ,
      d_chartob        TYPE   ole2_object .

Sample code

       CREATE OBJECT d_excel 'EXCEL.APPLICATION' .
       SET PROPERTY OF d_excel 'Visible' = 1 .
       GET PROPERTY OF d_excel 'Workbooks' = gs_wbooklist .

Formatting the Excel Cells

       GET PROPERTY OF d_cell1 'Font' = d_font .
       SET PROPERTY OF d_font 'Underline' = 2 .
       SET PROPERTY OF d_font 'Bold' = 1 .
       SET PROPERTY OF d_cell1 'HorizontalAlignment' = -4108 .
       GET PROPERTY OF d_cell1 'Interior' = d_interior .
       SET PROPERTY OF d_interior 'ColorIndex' = 15 . >>>>>>>>>> Check in the diagram given below
       SET PROPERTY OF d_interior 'Pattern' = -4124 .
       SET PROPERTY OF d_interior 'PatternColorIndex' = -4105 .




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                                        Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z


Color code for ABAP is shown below, please use the numeric value as given in the figure below. For example if
you want the interior color of the Excel cell to be of the color Cyan then use the code 8.




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                                       Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z


Color code for ABAP is shown below, please use the numeric value as given in the figure below.




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                       Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z


                                          Sample Code

The following program transfers values from SAP to EXCEL with formating.

REPORT ZEXOLE2.

parameters: p_file like RLGRAP-FILENAME
            default 'C:exceldataCustomerdata.xls'.

data: d_file like p_file,
      d_exsheet(10) value 'Customers',c_row type i,
      d_scnt type i,
      d_val(20),
      d_wb(2).

parameters: p_exvis as checkbox default 'X',
            p_workbk(2) type p default '01',
            p_wsheet(2) type p default '01'.




CONSTANTS: OK TYPE I       VALUE 0.
INCLUDE OLE2INCL.
DATA: EXCEL     TYPE       OLE2_OBJECT,
      WORKBOOK TYPE        OLE2_OBJECT,
      SHEET     TYPE       OLE2_OBJECT,
      CELL      TYPE       OLE2_OBJECT,
      CELL1     TYPE       OLE2_OBJECT,
      COLUMN    TYPE       OLE2_OBJECT,
      RANGE     TYPE       OLE2_OBJECT,
      BORDERS   TYPE       OLE2_OBJECT,
      BUTTON    TYPE       OLE2_OBJECT,
      INT       TYPE       OLE2_OBJECT,
      FONT      TYPE       OLE2_OBJECT,
      ROW       TYPE       OLE2_OBJECT.

data: application type ole2_object,
      book        type ole2_object,




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                      Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z


        books          type ole2_object,
        ole_book       TYPE ole2_object.




do p_workbk times.
  move p_file to d_file.
  unpack sy-index to d_wb.
  replace 'NN' with d_wb into d_file.
*
  perform create_EXCEL.

* create sheets and save
  perform sheet.

  perform save_book.
enddo.
write: ' Done'.


*---------------------------------------------------------------------*
*       FORM create_excel                                             *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
form create_excel.
  CREATE OBJECT EXCEL 'EXCEL.APPLICATION'.

    if sy-subrc ne 0.
       write: / 'No EXCEL creation possible'.
       stop.
    endif.

    set property of EXCEL 'DisplayAlerts' = 0.

    CALL METHOD OF EXCEL 'WORKBOOKS' = WORKBOOK .
*    Put Excel in background




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                      Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z


    if p_exvis eq 'X'.
      SET PROPERTY OF EXCEL 'VISIBLE' = 1.
    else.
      SET PROPERTY OF EXCEL 'VISIBLE' = 0.
    endif.

*  Create worksheet
  set property of excel 'SheetsInNewWorkbook' = 1.
  call method of workbook   'ADD'.
endform.



*---------------------------------------------------------------------*
*       FORM save_book                                                *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
form save_book.
  get property of excel 'ActiveSheet' = sheet.
  free object sheet.
  free object workbook.

    GET PROPERTY OF EXCEL 'ActiveWorkbook' = WORKBOOK.
    call method of workbook 'SAVEAS' exporting #1 = p_file #2 = 1.
    call method of workbook 'CLOSE'.
    call method of excel 'QUIT'.

  free object sheet.
  free object workbook.
  free object excel.
endform.


*---------------------------------------------------------------------*
*       FORM sheet                                                    *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                        Check Video
                             ABAPLOVERS.BLOGSPOT.COM
                               ABAP OLE AUTOMATION
                        Z


form sheet.

    do p_wsheet times.
      unpack sy-index to d_exsheet+5(2).

      if sy-index gt 1.
        CALL METHOD OF EXCEL 'WORKSHEETS' = sheet.
        call method of sheet 'ADD'.
        free object sheet.
      endif.
      d_scnt = sy-index.
      call method of excel     'WORKSHEETS' = SHEET EXPORTING #1 = d_scnt
.
      call method of sheet          'ACTIVATE'.
      SET PROPERTY OF SHEET         'NAME'        = d_exsheet.
      free object sheet.    "OK


      perform fill_sheet.
*
      CALL METHOD OF EXCEL 'Columns' = COLUMN.
      CALL METHOD OF COLUMN 'Autofit'.
      free object COLUMN.
*

      free   object button.
      free   object font.
      free   object int.
      free   object cell.
      free   object: cell1.
      free   object range.
      free   object borders.
      free   object: column, row.
    enddo.

    free   object   font.
    free   object   int.
    free   object   cell.
    free   object   cell1.




                        LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                      Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z


  free object   range.
  free object   borders.
  free object   column.
  free object   row.
  free object   sheet.
endform.


*---------------------------------------------------------------------*
*        FORM border                                                  *
*---------------------------------------------------------------------*
*        ........                                                     *
*---------------------------------------------------------------------*
* --> we                                                              *
*---------------------------------------------------------------------*
form border using we.
*left
  call method of CELL 'BORDERS' = BORDERS exporting #1 = '1'.
  set property of borders 'LineStyle' = '1'.
  set property of borders 'WEIGHT' = we.                    "4=max
  free object borders.
* right
  call method of CELL 'BORDERS' = BORDERS exporting #1 = '2'.
  set property of borders 'LineStyle' = '2'.
  set property of borders 'WEIGHT' = we.
  free object borders.
* top
  call method of CELL 'BORDERS' = BORDERS exporting #1 = '3'.
  set property of borders 'LineStyle' = '3'.
  set property of borders 'WEIGHT' = we.
  free object borders.
* bottom
  call method of CELL 'BORDERS' = BORDERS exporting #1 = '4'.
  set property of borders 'LineStyle' = '4'.
  set property of borders 'WEIGHT' = we.
*     set property of borders 'ColorIndex' = 'xlAutomatic'.
  free object borders.
endform.




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                      Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z


*---------------------------------------------------------------------*
*        FORM border2                                                 *
*---------------------------------------------------------------------*
*        ........                                                     *
*---------------------------------------------------------------------*
* --> we                                                              *
*---------------------------------------------------------------------*
form border2 using we.
*left
  call method of CELL 'BORDERS' = BORDERS exporting #1 = '1'.
  set property of borders 'LineStyle' = '5'.
  set property of borders 'WEIGHT' = we.                    "4=max
  free object borders.
* right
  call method of CELL 'BORDERS' = BORDERS exporting #1 = '2'.
  set property of borders 'LineStyle' = '6'.
  set property of borders 'WEIGHT' = we.
  free object borders.
* top
  call method of CELL 'BORDERS' = BORDERS exporting #1 = '3'.
  set property of borders 'LineStyle' = '7'.
  set property of borders 'WEIGHT' = we.
  free object borders.
* bottom
  call method of CELL 'BORDERS' = BORDERS exporting #1 = '4'.
  set property of borders 'LineStyle' = '8'.
  set property of borders 'WEIGHT' = we.
*     set property of borders 'ColorIndex' = 'xlAutomatic'.
  free object borders.
endform.

*---------------------------------------------------------------------*
*       FORM border3                                                  *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
* --> we                                                              *
*---------------------------------------------------------------------*
form border3 using we.




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                      Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z


*left
  call method of CELL 'BORDERS' = BORDERS exporting #1 = '1'.
  set property of borders 'LineStyle' = '10'.
  set property of borders 'WEIGHT' = we.                    "4=max
  free object borders.
* right
  call method of CELL 'BORDERS' = BORDERS exporting #1 = '2'.
  set property of borders 'LineStyle' = '10'.
  set property of borders 'WEIGHT' = we.
  free object borders.
* top
  call method of CELL 'BORDERS' = BORDERS exporting #1 = '3'.
  set property of borders 'LineStyle' = '11'.
  set property of borders 'WEIGHT' = we.
  free object borders.
* bottom
  call method of CELL 'BORDERS' = BORDERS exporting #1 = '4'.
  set property of borders 'LineStyle' = '12'.
  set property of borders 'WEIGHT' = we.
*     set property of borders 'ColorIndex' = 'xlAutomatic'.
  free object borders.
endform.


*---------------------------------------------------------------------*
*        FORM fill_cell                                               *
*---------------------------------------------------------------------*
*        ........                                                     *
*---------------------------------------------------------------------*
* --> color                                                           *
* --> pattern                                                         *
*---------------------------------------------------------------------*
form fill_cell using color pattern.
  call method of cell 'INTERIOR' = int.
  set property of int 'ColorIndex' = color.
  set property of int 'Pattern' = pattern.
  free object int.
endform.




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                      Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z


*---------------------------------------------------------------------*
*        FORM font                                                    *
*---------------------------------------------------------------------*
*        ........                                                     *
*---------------------------------------------------------------------*
* --> bold                                                            *
* --> size                                                            *
*---------------------------------------------------------------------*
form font using bold size.
  call method of CELL 'FONT' = font.
  set property of font 'BOLD' = bold.
  set property of font 'SIZE' = size.
  free object font.
endform.


*---------------------------------------------------------------------*
*       FORM fill_sheet                                               *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
form fill_sheet.
  CALL METHOD OF EXCEL    'RANGE' = CELL EXPORTING #1 = 'A1'.
  perform font          using 1 '10'.
  SET PROPERTY OF CELL    'VALUE' = 'Counter'.
  perform fill_cell     using '20' '1'.
  perform border        using '2'.
  free object cell.

  d_val = 'Workbook-Count'.
  move d_wb to d_val+16.
  CALL METHOD OF EXCEL    'RANGE' = CELL EXPORTING #1 = 'B1'.
  SET PROPERTY OF CELL    'VALUE' = d_val.
  perform fill_cell using '14' '1'.
  perform border using '4'.
  free object cell.

  d_val = 'Sheet-Count'.
  unpack sy-index to d_val+12.




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z


 CALL METHOD OF EXCEL    'RANGE' = CELL EXPORTING #1 = 'C1'.
 SET PROPERTY OF CELL    'VALUE' = d_val.
 perform fill_cell using '21' '1'.
 perform border using '4'.
 free object cell.

 CALL METHOD OF EXCEL         'RANGE' = CELL EXPORTING #1 = 'E3'.
 perform border             using '1'.
 free object cell.
 CALL METHOD OF EXCEL         'RANGE' = CELL EXPORTING #1 = 'E5'.
 perform border             using '2'.
 free object cell.
 CALL METHOD OF EXCEL         'RANGE' = CELL EXPORTING #1 = 'E7'.
 perform border             using '3'.
 free object cell.
 CALL METHOD OF EXCEL         'RANGE' = CELL EXPORTING #1 = 'E9'.
 perform border             using '4'.
 free object cell.
 CALL METHOD OF EXCEL         'RANGE' = CELL EXPORTING #1 = 'F3'.
 perform border2            using '1'.
 free object cell.
 CALL METHOD OF EXCEL         'RANGE' = CELL EXPORTING #1 = 'F5'.
 perform border2            using '2'.
 free object cell.
 CALL METHOD OF EXCEL         'RANGE' = CELL EXPORTING #1 = 'F7'.
 perform border2            using '3'.
 free object cell.
 CALL METHOD OF EXCEL         'RANGE' = CELL EXPORTING #1 = 'F9'.
 perform border2            using '4'.
 free object cell.
 CALL METHOD OF EXCEL         'RANGE' = CELL EXPORTING #1 = 'G3'.
 perform border3            using '1'.
 free object cell.
 CALL METHOD OF EXCEL         'RANGE' = CELL EXPORTING #1 = 'G5'.
 perform border3            using '2'.
 free object cell.
 CALL METHOD OF EXCEL         'RANGE' = CELL EXPORTING #1 = 'G7'.
 perform border3            using '3'.
 free object cell.




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                   Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z


 CALL METHOD OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'G9'.
 perform border3      using '4'.
 free object cell.

 d_val = 'ROW-Count'.

 do 19 times.
   c_row = sy-index + 1.
   unpack c_row to d_val+12(4).
   CALL METHOD OF excel 'CELLS' = CELL1 EXPORTING #1 = c_row #2 = 2.
   SET PROPERTY OF CELL1    'VALUE' = d_val.
   free object cell1.
   CALL METHOD OF excel 'CELLS' = CELL1 EXPORTING #1 = c_row #2 = 4.
   SET PROPERTY OF CELL1    'VALUE' = d_val.
   free object cell1.
 enddo.



endform.




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z




                           Other Links in ABAPLOVERS.BLOGSPOT.COM
ABAP Naming Standards
Important System Variables
ABAP Tricks and Tips
Step By Step Procedure For creating a Function Module in ABAP
Important Transaction Codes
User Exits
Recording BDC
Step By Step Procedures for Creating Tables in ABAP
SAP Sales Document Flow
List Of SAP SD Tables
Finding USER EXITS in SAP
Processing Blocks in SAP ABAP
Important Function Modules Create Text and Read Text
BAPI
Displaying Messages in ABAP
Function Module POPUP_TO_CONFIRM
OLE AUTOMATION in ABAP




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM
Follow Me on Twitter                                                        Check Video
                           ABAPLOVERS.BLOGSPOT.COM
                             ABAP OLE AUTOMATION
                       Z




Disclaimer and Liability Notice
This document may discuss sample coding or other information that does not include
ABAPLOVER.BLOGSPOT official interfaces and therefore is not supported by
ABAPLOVER.BLOGSPOT. Changes made based on this information are not supported and
can be overwritten during an upgrade.
ABAPLOVER.BLOGSPOT will not be held liable for any damages caused by using or
misusing the information, code or methods suggested in this document, and anyone using
these methods does so at his/her own risk.
ABAPLOVER.BLOGSPOT offers no guarantees and assumes no responsibility or liability of
any type with respect to the content of this technical article or code sample, including any
liability resulting from incompatibility between the content within this document and the
materials and services offered by ABAPLOVER.BLOGSPOT. You agree that you will not hold,
or seek to hold, ABAPLOVER.BLOGSPOT responsible or liable with respect to the content of
this document.




                       LOGON TO ABAPLOVERS.BLOGSPOT.COM

More Related Content

Viewers also liked

Filter for unique values or remove duplicate values excel
Filter for unique values or remove duplicate values   excelFilter for unique values or remove duplicate values   excel
Filter for unique values or remove duplicate values exceltechie_govind
 
Data sufficiency-formulae
Data sufficiency-formulaeData sufficiency-formulae
Data sufficiency-formulaetechie_govind
 
Apache Flex - Enterprise ready GUI framework
Apache Flex - Enterprise ready GUI frameworkApache Flex - Enterprise ready GUI framework
Apache Flex - Enterprise ready GUI frameworkTomislav Pokrajcic
 
Mengedit data File Ms Excel
Mengedit data File Ms ExcelMengedit data File Ms Excel
Mengedit data File Ms ExcelDina Andriyani
 
Excel advanced formulas and functions i-school tutorials
Excel  advanced formulas and functions   i-school tutorialsExcel  advanced formulas and functions   i-school tutorials
Excel advanced formulas and functions i-school tutorialstechie_govind
 
501 synonym&antonymquestions
501 synonym&antonymquestions501 synonym&antonymquestions
501 synonym&antonymquestionstechie_govind
 
Writing research proposal
Writing research proposalWriting research proposal
Writing research proposalabween1
 
Andi januriana
Andi janurianaAndi januriana
Andi janurianaAna Aziz
 

Viewers also liked (12)

Abc 19 06-07 en
Abc 19 06-07 enAbc 19 06-07 en
Abc 19 06-07 en
 
Filter for unique values or remove duplicate values excel
Filter for unique values or remove duplicate values   excelFilter for unique values or remove duplicate values   excel
Filter for unique values or remove duplicate values excel
 
Compound cook
Compound cookCompound cook
Compound cook
 
Data sufficiency-formulae
Data sufficiency-formulaeData sufficiency-formulae
Data sufficiency-formulae
 
Manyformulas
ManyformulasManyformulas
Manyformulas
 
Apache Flex - Enterprise ready GUI framework
Apache Flex - Enterprise ready GUI frameworkApache Flex - Enterprise ready GUI framework
Apache Flex - Enterprise ready GUI framework
 
Mengedit data File Ms Excel
Mengedit data File Ms ExcelMengedit data File Ms Excel
Mengedit data File Ms Excel
 
Excel advanced formulas and functions i-school tutorials
Excel  advanced formulas and functions   i-school tutorialsExcel  advanced formulas and functions   i-school tutorials
Excel advanced formulas and functions i-school tutorials
 
501 synonym&antonymquestions
501 synonym&antonymquestions501 synonym&antonymquestions
501 synonym&antonymquestions
 
Writing research proposal
Writing research proposalWriting research proposal
Writing research proposal
 
Andi januriana
Andi janurianaAndi januriana
Andi januriana
 
ABC Tehnologies
ABC TehnologiesABC Tehnologies
ABC Tehnologies
 

Similar to Abapoleautomation

Ryan Fishberg and Joan Lafferty - ItemsRenderers
Ryan Fishberg and Joan Lafferty - ItemsRenderersRyan Fishberg and Joan Lafferty - ItemsRenderers
Ryan Fishberg and Joan Lafferty - ItemsRenderers360|Conferences
 
Hello SAP Ehp7 !!
Hello SAP Ehp7 !!Hello SAP Ehp7 !!
Hello SAP Ehp7 !!SAPYard
 
Joomla Frameworks Kung Fu
Joomla Frameworks Kung FuJoomla Frameworks Kung Fu
Joomla Frameworks Kung FuOleg Nesterov
 
Flask Introduction - Python Meetup
Flask Introduction - Python MeetupFlask Introduction - Python Meetup
Flask Introduction - Python MeetupAreski Belaid
 
Integrating powl with web dynpro abap.
Integrating powl with web dynpro abap.Integrating powl with web dynpro abap.
Integrating powl with web dynpro abap.Adesh Chauhan
 
Integrating powl with web dynpro abap.
Integrating powl with web dynpro abap.Integrating powl with web dynpro abap.
Integrating powl with web dynpro abap.Adesh Chauhan
 
Aprendendo solid com exemplos
Aprendendo solid com exemplosAprendendo solid com exemplos
Aprendendo solid com exemplosvinibaggio
 
Kotlin For Beginners - CheezyCode
Kotlin For Beginners - CheezyCodeKotlin For Beginners - CheezyCode
Kotlin For Beginners - CheezyCodeCheezy Code
 
Hacking iOS Simulator: writing your own plugins for Simulator
Hacking iOS Simulator: writing your own plugins for SimulatorHacking iOS Simulator: writing your own plugins for Simulator
Hacking iOS Simulator: writing your own plugins for SimulatorAhmed Sulaiman
 
Christophe Jolif - Flex Data Visualization going one step further with IBM IL...
Christophe Jolif - Flex Data Visualization going one step further with IBM IL...Christophe Jolif - Flex Data Visualization going one step further with IBM IL...
Christophe Jolif - Flex Data Visualization going one step further with IBM IL...360|Conferences
 
The Basic Concept Of IOC
The Basic Concept Of IOCThe Basic Concept Of IOC
The Basic Concept Of IOCCarl Lu
 
Baruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion WorkshopBaruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion WorkshopBrian Sam-Bodden
 
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010singingfish
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)True-Vision
 
Inside Bokete: Web Application with Mojolicious and others
Inside Bokete:  Web Application with Mojolicious and othersInside Bokete:  Web Application with Mojolicious and others
Inside Bokete: Web Application with Mojolicious and othersYusuke Wada
 
Rails is Easy*
Rails is Easy*Rails is Easy*
Rails is Easy*bryanbibat
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainKen Collins
 

Similar to Abapoleautomation (20)

Ryan Fishberg and Joan Lafferty - ItemsRenderers
Ryan Fishberg and Joan Lafferty - ItemsRenderersRyan Fishberg and Joan Lafferty - ItemsRenderers
Ryan Fishberg and Joan Lafferty - ItemsRenderers
 
Hello SAP Ehp7 !!
Hello SAP Ehp7 !!Hello SAP Ehp7 !!
Hello SAP Ehp7 !!
 
Joomla Frameworks Kung Fu
Joomla Frameworks Kung FuJoomla Frameworks Kung Fu
Joomla Frameworks Kung Fu
 
Flask Introduction - Python Meetup
Flask Introduction - Python MeetupFlask Introduction - Python Meetup
Flask Introduction - Python Meetup
 
Integrating powl with web dynpro abap.
Integrating powl with web dynpro abap.Integrating powl with web dynpro abap.
Integrating powl with web dynpro abap.
 
Integrating powl with web dynpro abap.
Integrating powl with web dynpro abap.Integrating powl with web dynpro abap.
Integrating powl with web dynpro abap.
 
Aprendendo solid com exemplos
Aprendendo solid com exemplosAprendendo solid com exemplos
Aprendendo solid com exemplos
 
Kotlin For Beginners - CheezyCode
Kotlin For Beginners - CheezyCodeKotlin For Beginners - CheezyCode
Kotlin For Beginners - CheezyCode
 
Hacking iOS Simulator: writing your own plugins for Simulator
Hacking iOS Simulator: writing your own plugins for SimulatorHacking iOS Simulator: writing your own plugins for Simulator
Hacking iOS Simulator: writing your own plugins for Simulator
 
Sap application log
Sap application logSap application log
Sap application log
 
Christophe Jolif - Flex Data Visualization going one step further with IBM IL...
Christophe Jolif - Flex Data Visualization going one step further with IBM IL...Christophe Jolif - Flex Data Visualization going one step further with IBM IL...
Christophe Jolif - Flex Data Visualization going one step further with IBM IL...
 
The Basic Concept Of IOC
The Basic Concept Of IOCThe Basic Concept Of IOC
The Basic Concept Of IOC
 
Baruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion WorkshopBaruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion Workshop
 
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)
 
Inside Bokete: Web Application with Mojolicious and others
Inside Bokete:  Web Application with Mojolicious and othersInside Bokete:  Web Application with Mojolicious and others
Inside Bokete: Web Application with Mojolicious and others
 
Mojolicious
MojoliciousMojolicious
Mojolicious
 
Symfony 2
Symfony 2Symfony 2
Symfony 2
 
Rails is Easy*
Rails is Easy*Rails is Easy*
Rails is Easy*
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
 

Recently uploaded

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Recently uploaded (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

Abapoleautomation

  • 1. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z ABAP OLE AUTOMATION At the end of the document you will find instructions on how to use the BLOG ABAPLOVERS.BLOGSPOT.COM so that you will not miss any updates. This BLOG is updated on a daily basis and all the Tutorials (Files/PDFs) associated with the BLOG are also updated from time to time. We encourage you to share these documents with your friends colleagues and to upload them to you favorite file sharing websites like ● http://www.rapidshare.com/ ● http://www.esnips.com/ ● http://www.slideshare.net/ ● http://www.megaupload.com Get started register and stay tuned to ABAP.BLOGSPOT.COM Enter Your Email Address Subscribe Delivered By FeedBurner LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 2. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z Transactions ● OLE ● SOLE Run Transaction OLE the following screen will be displayed. LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 3. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z In the above transaction you can start and stop each application to check if it has been registered. Run transaction SOLE to get a list of all the OLE applications registered in your system. You can maintain these applications here. LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 4. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z The above applications are stored in the table TOLE. The following SAP tables are associated with OLE ● TOLE OLE Applications ● OLELOAD OLE type Information load ● SWOTOLE Workflow Object Types OLE Applications ● SWOTTOLE Workflow Object Types Texts OLE Applications ● TOLET Workflow Object Types Texts OLE Applications The following ABAP key words control the applications: ● CREATE OBJECT ● SET PROPERTY ● GET PROPERTY ● CALL METHOD ● FREE OBJECT LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 5. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z The Desktop application serves as the OLE server to the calling ABAP program. For example when the ABAP program makes calls to the OLE application the SAPGUI servers as the client. The create statement generates the object of this class. The following return code values can be encountered. SY-SUBRC = 0: Object successfully generated. SY-SUBRC = 1: SAPGUI communication error. SY-SUBRC = 2: SAPGUI function call error. The frontend ports of SAP’s OLE implementation modules are implemented only under Windows and Apple Macintosh. SY-SUBRC = 3: The OLE-API call resulted in an error - possibly a storage space problem. SY-SUBRC = 4: The object is not registered with SAP. Note that for each OLE object there has to be a variable holding handle data for that LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 6. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z object. The type-pool “ole2” defines the handle variable data of the type ole2_object. For all the OLE automation programs “OLE2INCL” include should be used. Please find below some examples of setting the properties of fonts, cell borders and colors. Font Properties. SET PROPERTY OF name_font 'Name' = 'Times New Roman' . SET PROPERTY OF size_font 'Size' = '12' . SET PROPERTY OF bold_font 'Bold' = '0' . "Not bold SET PROPERTY OF Italic_font 'Italic' = '0' . "Not Italic SET PROPERTY OF underline_font 'Underline' = '0' . "Not underlined Paragraph Formatting SET PROPERTY OF allignment_parformat 'Alignment' = '3' . "Justified Similarly for EXCEL LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 7. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z DATA: d_excel TYPE ole2_object , d_cell1 TYPE ole2_object , d_cell2 TYPE ole2_object , d_cells TYPE ole2_object , d_range TYPE ole2_object , d_font TYPE ole2_object , d_interior TYPE ole2_object , d_columns TYPE ole2_object , d_charts TYPE ole2_object , d_chart TYPE ole2_object , d_charttitle TYPE ole2_object , d_charttitlech TYPE ole2_object , d_chartob TYPE ole2_object . Sample code CREATE OBJECT d_excel 'EXCEL.APPLICATION' . SET PROPERTY OF d_excel 'Visible' = 1 . GET PROPERTY OF d_excel 'Workbooks' = gs_wbooklist . Formatting the Excel Cells GET PROPERTY OF d_cell1 'Font' = d_font . SET PROPERTY OF d_font 'Underline' = 2 . SET PROPERTY OF d_font 'Bold' = 1 . SET PROPERTY OF d_cell1 'HorizontalAlignment' = -4108 . GET PROPERTY OF d_cell1 'Interior' = d_interior . SET PROPERTY OF d_interior 'ColorIndex' = 15 . >>>>>>>>>> Check in the diagram given below SET PROPERTY OF d_interior 'Pattern' = -4124 . SET PROPERTY OF d_interior 'PatternColorIndex' = -4105 . LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 8. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z Color code for ABAP is shown below, please use the numeric value as given in the figure below. For example if you want the interior color of the Excel cell to be of the color Cyan then use the code 8. LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 9. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z Color code for ABAP is shown below, please use the numeric value as given in the figure below. LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 10. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z Sample Code The following program transfers values from SAP to EXCEL with formating. REPORT ZEXOLE2. parameters: p_file like RLGRAP-FILENAME default 'C:exceldataCustomerdata.xls'. data: d_file like p_file, d_exsheet(10) value 'Customers',c_row type i, d_scnt type i, d_val(20), d_wb(2). parameters: p_exvis as checkbox default 'X', p_workbk(2) type p default '01', p_wsheet(2) type p default '01'. CONSTANTS: OK TYPE I VALUE 0. INCLUDE OLE2INCL. DATA: EXCEL TYPE OLE2_OBJECT, WORKBOOK TYPE OLE2_OBJECT, SHEET TYPE OLE2_OBJECT, CELL TYPE OLE2_OBJECT, CELL1 TYPE OLE2_OBJECT, COLUMN TYPE OLE2_OBJECT, RANGE TYPE OLE2_OBJECT, BORDERS TYPE OLE2_OBJECT, BUTTON TYPE OLE2_OBJECT, INT TYPE OLE2_OBJECT, FONT TYPE OLE2_OBJECT, ROW TYPE OLE2_OBJECT. data: application type ole2_object, book type ole2_object, LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 11. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z books type ole2_object, ole_book TYPE ole2_object. do p_workbk times. move p_file to d_file. unpack sy-index to d_wb. replace 'NN' with d_wb into d_file. * perform create_EXCEL. * create sheets and save perform sheet. perform save_book. enddo. write: ' Done'. *---------------------------------------------------------------------* * FORM create_excel * *---------------------------------------------------------------------* * ........ * *---------------------------------------------------------------------* form create_excel. CREATE OBJECT EXCEL 'EXCEL.APPLICATION'. if sy-subrc ne 0. write: / 'No EXCEL creation possible'. stop. endif. set property of EXCEL 'DisplayAlerts' = 0. CALL METHOD OF EXCEL 'WORKBOOKS' = WORKBOOK . * Put Excel in background LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 12. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z if p_exvis eq 'X'. SET PROPERTY OF EXCEL 'VISIBLE' = 1. else. SET PROPERTY OF EXCEL 'VISIBLE' = 0. endif. * Create worksheet set property of excel 'SheetsInNewWorkbook' = 1. call method of workbook 'ADD'. endform. *---------------------------------------------------------------------* * FORM save_book * *---------------------------------------------------------------------* * ........ * *---------------------------------------------------------------------* form save_book. get property of excel 'ActiveSheet' = sheet. free object sheet. free object workbook. GET PROPERTY OF EXCEL 'ActiveWorkbook' = WORKBOOK. call method of workbook 'SAVEAS' exporting #1 = p_file #2 = 1. call method of workbook 'CLOSE'. call method of excel 'QUIT'. free object sheet. free object workbook. free object excel. endform. *---------------------------------------------------------------------* * FORM sheet * *---------------------------------------------------------------------* * ........ * *---------------------------------------------------------------------* LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 13. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z form sheet. do p_wsheet times. unpack sy-index to d_exsheet+5(2). if sy-index gt 1. CALL METHOD OF EXCEL 'WORKSHEETS' = sheet. call method of sheet 'ADD'. free object sheet. endif. d_scnt = sy-index. call method of excel 'WORKSHEETS' = SHEET EXPORTING #1 = d_scnt . call method of sheet 'ACTIVATE'. SET PROPERTY OF SHEET 'NAME' = d_exsheet. free object sheet. "OK perform fill_sheet. * CALL METHOD OF EXCEL 'Columns' = COLUMN. CALL METHOD OF COLUMN 'Autofit'. free object COLUMN. * free object button. free object font. free object int. free object cell. free object: cell1. free object range. free object borders. free object: column, row. enddo. free object font. free object int. free object cell. free object cell1. LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 14. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z free object range. free object borders. free object column. free object row. free object sheet. endform. *---------------------------------------------------------------------* * FORM border * *---------------------------------------------------------------------* * ........ * *---------------------------------------------------------------------* * --> we * *---------------------------------------------------------------------* form border using we. *left call method of CELL 'BORDERS' = BORDERS exporting #1 = '1'. set property of borders 'LineStyle' = '1'. set property of borders 'WEIGHT' = we. "4=max free object borders. * right call method of CELL 'BORDERS' = BORDERS exporting #1 = '2'. set property of borders 'LineStyle' = '2'. set property of borders 'WEIGHT' = we. free object borders. * top call method of CELL 'BORDERS' = BORDERS exporting #1 = '3'. set property of borders 'LineStyle' = '3'. set property of borders 'WEIGHT' = we. free object borders. * bottom call method of CELL 'BORDERS' = BORDERS exporting #1 = '4'. set property of borders 'LineStyle' = '4'. set property of borders 'WEIGHT' = we. * set property of borders 'ColorIndex' = 'xlAutomatic'. free object borders. endform. LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 15. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z *---------------------------------------------------------------------* * FORM border2 * *---------------------------------------------------------------------* * ........ * *---------------------------------------------------------------------* * --> we * *---------------------------------------------------------------------* form border2 using we. *left call method of CELL 'BORDERS' = BORDERS exporting #1 = '1'. set property of borders 'LineStyle' = '5'. set property of borders 'WEIGHT' = we. "4=max free object borders. * right call method of CELL 'BORDERS' = BORDERS exporting #1 = '2'. set property of borders 'LineStyle' = '6'. set property of borders 'WEIGHT' = we. free object borders. * top call method of CELL 'BORDERS' = BORDERS exporting #1 = '3'. set property of borders 'LineStyle' = '7'. set property of borders 'WEIGHT' = we. free object borders. * bottom call method of CELL 'BORDERS' = BORDERS exporting #1 = '4'. set property of borders 'LineStyle' = '8'. set property of borders 'WEIGHT' = we. * set property of borders 'ColorIndex' = 'xlAutomatic'. free object borders. endform. *---------------------------------------------------------------------* * FORM border3 * *---------------------------------------------------------------------* * ........ * *---------------------------------------------------------------------* * --> we * *---------------------------------------------------------------------* form border3 using we. LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 16. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z *left call method of CELL 'BORDERS' = BORDERS exporting #1 = '1'. set property of borders 'LineStyle' = '10'. set property of borders 'WEIGHT' = we. "4=max free object borders. * right call method of CELL 'BORDERS' = BORDERS exporting #1 = '2'. set property of borders 'LineStyle' = '10'. set property of borders 'WEIGHT' = we. free object borders. * top call method of CELL 'BORDERS' = BORDERS exporting #1 = '3'. set property of borders 'LineStyle' = '11'. set property of borders 'WEIGHT' = we. free object borders. * bottom call method of CELL 'BORDERS' = BORDERS exporting #1 = '4'. set property of borders 'LineStyle' = '12'. set property of borders 'WEIGHT' = we. * set property of borders 'ColorIndex' = 'xlAutomatic'. free object borders. endform. *---------------------------------------------------------------------* * FORM fill_cell * *---------------------------------------------------------------------* * ........ * *---------------------------------------------------------------------* * --> color * * --> pattern * *---------------------------------------------------------------------* form fill_cell using color pattern. call method of cell 'INTERIOR' = int. set property of int 'ColorIndex' = color. set property of int 'Pattern' = pattern. free object int. endform. LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 17. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z *---------------------------------------------------------------------* * FORM font * *---------------------------------------------------------------------* * ........ * *---------------------------------------------------------------------* * --> bold * * --> size * *---------------------------------------------------------------------* form font using bold size. call method of CELL 'FONT' = font. set property of font 'BOLD' = bold. set property of font 'SIZE' = size. free object font. endform. *---------------------------------------------------------------------* * FORM fill_sheet * *---------------------------------------------------------------------* * ........ * *---------------------------------------------------------------------* form fill_sheet. CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'A1'. perform font using 1 '10'. SET PROPERTY OF CELL 'VALUE' = 'Counter'. perform fill_cell using '20' '1'. perform border using '2'. free object cell. d_val = 'Workbook-Count'. move d_wb to d_val+16. CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'B1'. SET PROPERTY OF CELL 'VALUE' = d_val. perform fill_cell using '14' '1'. perform border using '4'. free object cell. d_val = 'Sheet-Count'. unpack sy-index to d_val+12. LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 18. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'C1'. SET PROPERTY OF CELL 'VALUE' = d_val. perform fill_cell using '21' '1'. perform border using '4'. free object cell. CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'E3'. perform border using '1'. free object cell. CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'E5'. perform border using '2'. free object cell. CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'E7'. perform border using '3'. free object cell. CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'E9'. perform border using '4'. free object cell. CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'F3'. perform border2 using '1'. free object cell. CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'F5'. perform border2 using '2'. free object cell. CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'F7'. perform border2 using '3'. free object cell. CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'F9'. perform border2 using '4'. free object cell. CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'G3'. perform border3 using '1'. free object cell. CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'G5'. perform border3 using '2'. free object cell. CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'G7'. perform border3 using '3'. free object cell. LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 19. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'G9'. perform border3 using '4'. free object cell. d_val = 'ROW-Count'. do 19 times. c_row = sy-index + 1. unpack c_row to d_val+12(4). CALL METHOD OF excel 'CELLS' = CELL1 EXPORTING #1 = c_row #2 = 2. SET PROPERTY OF CELL1 'VALUE' = d_val. free object cell1. CALL METHOD OF excel 'CELLS' = CELL1 EXPORTING #1 = c_row #2 = 4. SET PROPERTY OF CELL1 'VALUE' = d_val. free object cell1. enddo. endform. LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 20. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z Other Links in ABAPLOVERS.BLOGSPOT.COM ABAP Naming Standards Important System Variables ABAP Tricks and Tips Step By Step Procedure For creating a Function Module in ABAP Important Transaction Codes User Exits Recording BDC Step By Step Procedures for Creating Tables in ABAP SAP Sales Document Flow List Of SAP SD Tables Finding USER EXITS in SAP Processing Blocks in SAP ABAP Important Function Modules Create Text and Read Text BAPI Displaying Messages in ABAP Function Module POPUP_TO_CONFIRM OLE AUTOMATION in ABAP LOGON TO ABAPLOVERS.BLOGSPOT.COM
  • 21. Follow Me on Twitter Check Video ABAPLOVERS.BLOGSPOT.COM ABAP OLE AUTOMATION Z Disclaimer and Liability Notice This document may discuss sample coding or other information that does not include ABAPLOVER.BLOGSPOT official interfaces and therefore is not supported by ABAPLOVER.BLOGSPOT. Changes made based on this information are not supported and can be overwritten during an upgrade. ABAPLOVER.BLOGSPOT will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. ABAPLOVER.BLOGSPOT offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by ABAPLOVER.BLOGSPOT. You agree that you will not hold, or seek to hold, ABAPLOVER.BLOGSPOT responsible or liable with respect to the content of this document. LOGON TO ABAPLOVERS.BLOGSPOT.COM