Showing posts with label Class References. Show all posts
Showing posts with label Class References. Show all posts

Tuesday, May 10, 2016

I_OI_SPREADSHEET

This class provides document management for sheet of Excel File.

Method:
  • GET_SHEETS                        Get the names of all worksheets in Excel File
DATA: IT_SHEETS       TYPE          SOI_SHEETS_TABLE.
CALL METHOD IREF_SPREADSHEET->GET_SHEETS
   EXPORTING
     NO_FLUSH = ' '
   IMPORTING
     SHEETS   = IT_SHEETS
     ERROR    = IREF_ERROR.
  • SELECT_SHEET                   Activate a Sheet
CALL METHOD IREF_SPREADSHEET->SELECT_SHEET
     EXPORTING
       NAME  = WA_SHEETS-SHEET_NAME
     IMPORTING
       ERROR = IREF_ERROR.
   IF IREF_ERROR->HAS_FAILED = 'X'.
     CONTINUE.
   ENDIF.
  • SET_SELECTION                    Set range to read the data
CALL METHOD IREF_SPREADSHEET->SET_SELECTION
     EXPORTING
       TOP     = 4
       LEFT    = 1
       ROWS    = 2000
       COLUMNS = 8.
  • INSERT_RANGE                     Insert a New Range
CALL METHOD IREF_SPREADSHEET->INSERT_RANGE
     EXPORTING
       NAME     = 'Test'
       ROWS     = 2000
       COLUMNS  = 8
       NO_FLUSH = ''
     IMPORTING
       ERROR    = IREF_ERROR.
  • GET_RANGES_DATA              Get the data of a range in spreadsheet
DATA : L_IT_RANGE  TYPE SOI_DIMENSION_TABLE,
            L_WA_RANGE  TYPE SOI_DIMENSION_ITEM.
* create data range to selected
L_WA_RANGE-ROW     = 2.
L_WA_RANGE-COLUMN  = 1.
L_WA_RANGE-ROWS    = 2000.
L_WA_RANGE-COLUMNS = 9.
APPEND L_WA_RANGE TO L_IT_RANGE.

CALL METHOD IREF_SPREADSHEET->GET_RANGES_DATA
     EXPORTING
       RANGESDEF = L_IT_RANGE   "indicate range in which data to be read
     IMPORTING
       CONTENTS  = IT_DATA             "Internal table to contain the data
       ERROR     = IREF_ERROR
     CHANGING
       RANGES    = IT_RANGES.



I_OI_DOCUMENT_PROXY

General Document Interface

Each instance of the interface I_OI_DOCUMENT_PROXY administers and controls a document that you want to open in the office application. If you want to open several documents at once, you need an instance for each document.
You can create an instance of I_OI_DOCUMENT_PROXY using the interface I_OI_CONTAINER_CONTROL.
The interface exposes methods that you can use to control the document from your application program (for example, open, close, save).

They are divided into the methods that all OLE2 desktop applications provide, and those that can also be used through a standard interface. The following tables provide an overview of these methods:

  • Method:
    • OPEN_DOCUMENT
      • CALL METHOD IREF_DOCUMENT->OPEN_DOCUMENT
            EXPORTING
              DOCUMENT_TITLE 'Excel'
              DOCUMENT_URL   file path
              OPEN_INPLACE   'X'
            IMPORTING
              ERROR          IREF_ERROR.
    • GET_SPREADSHEET_INTERFACE         
      • Returns an Interface Reference
      • The return of interface Reference I_OI_SPREADSHEET IREF_SPREADSHEET is used to access the spreadsheet of excel file.
      • CALL METHOD IREF_DOCUMENT->GET_SPREADSHEET_INTERFACE
            EXPORTING
              NO_FLUSH        ' '
            IMPORTING
              ERROR           IREF_ERROR
              SHEET_INTERFACE IREF_SPREADSHEET.

SAP giới thiệu mã hỗ trợ AI trong ngôn ngữ ABAP riêng của mình

SAP đã ra mắt một loạt tính năng mã hỗ trợ AI trong môi trường phát triển ứng dụng dựa trên đám mây của mình, đồng thời tham gia vào danh sá...