Warning: include_once(http://erpgenie.com/_borders/topabap.htm) [function.include-once]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/templates/rhuk_solarflare_ii/index.php on line 52

Warning: include_once() [function.include]: Failed opening 'http://erpgenie.com/_borders/topabap.htm' for inclusion (include_path='.:') in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/templates/rhuk_solarflare_ii/index.php on line 52
Home arrow Sample Code arrow ABAP Reports arrow Working with Excel
Working with Excel PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Anon.   
Saturday, 20 January 2007
Interface between Microsoft Excel and ABAP/4 with up- and  downloading of data plus executing Microsoft Excel.    REPORT ZZBGS010 .
 *----------------------------------------------------------------------*
 * Example: Interface between Microsoft Excel and ABAP/4 with up- and   *
 * downloading of data plus executing Microsoft Excel.                  *
 *----------------------------------------------------------------------*
 TABLES: USR04.
 DATA: SIZE TYPE I.
 
 DATA: BEGIN OF USER OCCURS 100.
         INCLUDE STRUCTURE USR04.
 DATA: END OF USER.
 
 * ---------------------------------------------------------------------*
 * Example: Select some data into an internal table.                    *
 * ---------------------------------------------------------------------*
 
   SELECT * FROM  USR04 INTO TABLE USER .
 
 * ---------------------------------------------------------------------*
 * Example: Downloading data in Microsoft Excel Format with automatic   *
 * prompt popup dialog.                                                 *
 * ---------------------------------------------------------------------*
   CALL FUNCTION 'DOWNLOAD'
     EXPORTING
       FILENAME     = 'C:\tmp\SAPEXL1.XLS'
       FILETYPE     = 'WK1'   "ASC, WK1, DBF, DAT, bin
       MODE         = ' '     "Mode ' ' = Rewrite Mode 'A' = Appending
     TABLES
       DATA_TAB     = USER.
 
 * ---------------------------------------------------------------------*
 * Example: Downloading data in Microsoft Excel Format without automatic*
 * prompt popup.                                                        *
 * ---------------------------------------------------------------------*
   CALL FUNCTION 'WS_DOWNLOAD'
     EXPORTING
       FILENAME     = 'C:\tmp\SAPEXL2.XLS'
       FILETYPE     = 'WK1'   "ASC, WK1, DBF, DAT, bin
       MODE         = ' '     "Mode ' ' = Rewrite Mode 'A' = Appending
     TABLES
       DATA_TAB            = USER.
 
 
  CLEAR USER.      "Clear buffer
  REFRESH USER.    "Refresh, empty internal table
 
 *----------------------------------------------------------------------*
 * Example: Uploading Microsoft Excel to ABAP/4 internal table.         *
 *----------------------------------------------------------------------*
   CALL FUNCTION 'UPLOAD'
     EXPORTING
       FILENAME = 'C:\tmp\SAPEXL.prn'
       FILETYPE = 'ASC'
     IMPORTING
       FILESIZE = SIZE
     TABLES
       DATA_TAB = USER.
 
 *----------------------------------------------------------------------*
 * Example: Starting Microsoft Excel and load sheet.                    *
 *----------------------------------------------------------------------*
 CALL FUNCTION 'WS_EXECUTE'
   EXPORTING
     COMMANDLINE    = 'C:\tmp\SAPEXL1.XLS'
     PROGRAM        = 'F:\APPL\WINDOWS\EXCEL5DK\EXCEL.EXE'
     .
  *----------------------------------------------------------------------*
 * Example: Starting Microsoft Excel and load internal table as sheet   *
 *----------------------------------------------------------------------*
 CALL FUNCTION 'WS_EXCEL'
   EXPORTING
     FILENAME = 'C:\tmp\SAPEXL.XLS'
     SYNCHRON = ' '
   TABLES
     DATA     = USER.
 --------------------------------------------------------------------------------
 
< Prev   Next >

Google Search

Google Ads


Warning: include(http://erpgenie.com/_borders/bottom.htm) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/includes/footer.php on line 22

Warning: include() [function.include]: Failed opening 'http://erpgenie.com/_borders/bottom.htm' for inclusion (include_path='.:') in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/includes/footer.php on line 22