Abap Gui Upload Excel File

In this Blog-post I’d like to give a few insights on how we process XLSX file by using latest ABAP, which might be quite different than in most other implementations, for example:ABAP and OLE or Excel with SAP – An Overview

As upload logic relies on the right sequence of columns in the excel sheet we gave user option to download the file template with right sequence of columns. For this functionality to work first we defined a structure in data dictionary with the correct sequence of fields. Jan 15, 2020  As upload logic relies on the right sequence of columns in the excel sheet we gave user option to download the file template with right sequence of columns. For this functionality to work first we defined a structure in data dictionary with the correct sequence of fields.

By using CL_XLSX_DOCUMENT (available from 2008), it is easy to load file, workbook, sheets, rows and columns. A good example code can be found within class CL_EHFND_XLSX(available on ABAP AS 752 SP-Level 0004, Software Component S4CORE Release 102, SP 4.).

On the other hand, you can set document format by using IF_IXML_NODE, below example code show how …

Main functionalities of this report are:

  1. Download any DDIC table’s content into xlsx file
  2. Change value in the xlsx file
  3. upload xlsx file into DDIC table
  4. check changed value in DDIC table.

And the dynamic structure is used in this report. The code style is what I would like to present also.

User Interface

Main Functionality

Download table content into local excel file (xlsx)

Select action “Export”

Input existing table , e.g. Table Name T000, File Full Path: c:demot000.xlsx Ford 4110 tractor power steering manual.

Change the value of non-key column in xlsx file.

Upload local excel file (*.xlsx) into table

Select action “Import”

Input existing table , e.g. Table Name T000, File Full Path: c:demot000.xlsx

Empty row will be skip, and table entries will be modified (Insert or Update). It is not possible to delete existing table entry.

Exception Handling

You will get exception of structure infliction if xlsx file is not for that table.

First row will be the table columns’ name

Local Class Definition

Thank you for your interest in XLSX2ABAP and ABAP2XLSX. Example code is tested on SAP_BASIS 755, S4CORE 105.

Kasam Se.Dekho Kareeb SeMile Hain Naseeb SeAayega Pal Yeh Phir KahaanAaj Achanak Tumse Mile HumYe Toh Nahi Hai BewajahPucho Zara Iss Dil SeHum Hain Mile Mushkil SeKal Phir Na Ho’n Hum Jo YahaanGazab Ka Hai Din, Socho ZaraYeh Deewanapan, Dekho ZaraTum Ho Akele Hum Bhi AkeleMaza Aa Raha HaiKasam Se Kasam SeI Feel LoveWhen I Look Into Your EyesI BelieveIf You Move Out From My SideI’ll Be Losin’ Grip On You. Phir Kyun FaaslaMain Kahaan Aur Tum KahaanGazab Ka Hai Din, Socho ZaraYeh Deewanapan, Dekho ZaraTum Bhi Akele, Hum Bhi AkeleMaza Aa Raha HaiKasam Se. Download song gazab ka hai din socho zara.