9

ABAP to Excel

Update: Even though I mentioned it in the end of this post, as well as on the TXT file with the original ABAP code, it is worth mentioning again that this is an original article written by Alvaro Tejada (@blag). For more information, click here to access Alvario Tejada’s blog. Also, please refer to a recent post that I’ve written called “10 SAP Blogs you must follow“, which also mentions @Blag’s blog as one of my 10 SAP favorite blogs.

If you’re an ABAP programmer, chances are that one of these days your team leader asks to you build a Report to export ERP data into an Excel sheet. The idea behind this ABAP report is simple. The user runs the report from the ERP system and is able to save it locally as an Excel worksheet, probably to send it to a Line Manager or someone from business who wants to look at figures. Of course this is just an example but it will give you the basic tools on how to work with ABAP and Excel OLE. It also gives you some pointers on how to manipulate cell colors. So, here are the steps to enable this simple example.

1. Create the Report, transaction code SE38

ABAP Report - Export to Excel

2. In the example, I named the report ZHCM_ABAP_TO_EXCEL. Click on Create

3. Next you should type in some normal report creation parameters

ABAP Report - Export to Excel

4. Hit Save, choose your development package and you’re ready to start editing your report source code

5. Copy and paste the source code available for download here

6. Hit Activate and click on F8 or the Direct Processing button

ABAP Report - Export to Excel

7. Upon executing the report, you will need to define the name and location of the result Excel file. On the example defined in a folder \test-excel\test-excel.xls. Hit Save

ABAP Report - Export to Excel

8. Back on the selection screen, confirm your entries and execute the Report

SAP Report - Export to Excel

9. The result will be something like

ABAP Report - Export to Excel

Additional links and resources

Author : Antonio Caldas

Author's Website | Articles from

Working as an Information Systems Consultant for over 10 years, I've found that working with SAP brought me added value on how to deal and manage IT and Information Systems Projects. More than a hobby, this blog is aimed to propagate SAP knowledge exchange and help other SAP technology or functional Consultants finding any piece of useful information. Please participate with your comments and opinions, it will help enrich the SAP community. Thanks!


Related Posts


User Comments


  1. Hien Ngo Minh
    August 20, 2010

    this is a very good tutorial, it helps me a lot. Thx admin

    Reply


  2. Hong Son
    October 18, 2010

    Thank You very much, I am new to ERP,these materials are very useful for me.

    Reply


  3. crepmaster
    December 5, 2010

    how can download the excel into a application server?

    Reply


  4. Tony
    February 21, 2011

    Try to use abap2xlsx SCN Community Project
    http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/20046

    Regards

    Reply


    • webmaster
      February 23, 2011

      Dear Tony,

      Thank you for your contribution.
      Regards.

      Antonio Caldas

      Reply


  5. Jenith Kumar
    March 1, 2011

    I need to set the format of the cell as TEXT, which can be found in the Number Tab of the Format Cells Window.

    How to Get these properties in the program?

    Regards,

    Jenith Kumar.

    Reply


  6. Long
    October 12, 2011

    How to export data from SAP system to excel version 2007 or newer versions?

    Thanks anh regards!
    Long.

    Reply


    • Long
      October 12, 2011

      And how to insert company logo when export to excel file from SAP?

      Thanks alot!
      Long.

      Reply


  7. Adrian Buendia
    March 29, 2012

    Thank you very much for the very very good sample.
    More power to you.

    Reply


Make Money today from FREE Business Content


Community Feeds

  • Java Online Training

    very nice post thanks for sharing this article.
    Thanks
    Training Aspirants
    http://www.trainingaspirants.com

  • informatica online training/obiee online training

    We are providing the best online training by industrial IT experts with one free demo class, real time coaching and placement assistance.

  • Sap

    TallyMarks Consulting has successfully implemented SAP BI and Business Objects in a record time of 5 months at Getz Pharma. For more details on this cost effective project by the market leader, visit: http://www.tallymarks.co/

  • Learn SAP

    Refer this blog to learn some useful tips on various SAP customizing areas.

  • Free and premium SAP Training

    SAP training for all skill levels – complete beginner to very experienced. Articles, Videos and downloadable content.

  • SAP Blog

    SAP centric blog based on practical experiences of an admin

  • SAP Jobs

    Red Commerce is a leading recruitment agency which specialises in sourcing quality staff for the SAP industry. Our site is full of useful information and we are always on hand to answer any queries you may have.

  • SAP Online Training on all Major IT Courses.

    Training Aspirants provide Online Training & Corporate Training. We make sure for a right class size in order to make Online sessions most interactive.
    Training Aspirants started with a motto to provide quality and effective online training for the students worldwide with the best instructors.

    For Details Visit: http://www.trainingaspirants.com

    Call Us: US :001-713-900-7669
    US: 001-630-974-1794
    India : 091-779-985-5779
    Mail Us: mail@trainingaspirants.com

  • Expertise technique SAP, ABAP

    Expert Technique SAP, ABAP

  • SAP Training and Certification Courses

    Be a part of SAP training and online sap certification to boost up your skills and career. SAP training helps to improve your business methodologies which are beneficial to generate business around the world. JKT SAP Academy is an authorize education partner of sap and provide sap training for sap abap, sap erp, sap basis, sap fi,sap co, sap mm, sap sd, sap pp and other functional modules.

Submit More
;;