Home > Ask the SAP software/management Experts > Application development Questions & Answers > How can I get an ABAP program displaying Excel data to wrap text?
Ask The SAP Expert: Questions & Answers
EMAIL THIS

How can I get an ABAP program displaying Excel data to wrap text?

Matthew Billingham EXPERT RESPONSE FROM: Matthew Billingham

Pose a Question
Other SAP Categories
Meet all SAP Experts
Become an Expert for this site


SAP news, tips and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


>
QUESTION POSED ON: 26 May 2009
I am developing an SAP ABAP program (using an SAP R/3 4.7 system), in which I want to display details from a database table in Mircrosoft Excel.

Looking at the various demo programs that SAP has provided, I found one that seems to meet my needs. This program (saprdemo_tables_in_excel) allows you to load data from internal tables into a worksheet (shown in-place in the program's screen) and also allows the program to extract the data from the worksheet so that the internal tables can be updated. This program makes use of Desktop Office Integration and is quite easy to follow and understand.

I've created my own program based on the SAP program and have been able to develop it so that it meets my needs. However, there is one requirement (probably the main requirement) that I've found I can't satisfy.

I need some of the cells to have the "Wrap Text" option enabled but cannot see how to do that. None of the methods from the I_OI_SPREADSHEET interface allow me to change this. There are methods that allow me to change the font size and color and background color, as well as properties such as Bold, Italic and Justified, but nothing that relates to the Wrap Text option.

I've been able to find information that seems to indicate that the Wrap Text property can be set if the program was written around OLE2 objects such as with the following code:

CREATE OBJECT o_wks 'Excel.Application' NO FLUSH. GET PROPERTY OF o_wks 'Range' = o_rng1 NO FLUSH exporting #1 = 'D:D'. SET PROPERTY OF o_rng1 'WrapText' = '1'.

However, since I am using the I_OI_SPREADSHEET interface, I'm struggling to see how I can make use of this approach. Is there some way that I can set the Wrap Text property of a cell in my program given that it is based around the saprdemo_tables_in_excel program?



Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
Application development
How to implement SAP BADIs
How to correct an SAP ABAP dump with an oversize condition
Creating a function group for an SAP ABAP table maintenance generator
How to read an SAP transaction in an ABAP code
How to create Include programs in the ABAP editor
Defining a structure in a report
Deleting entries from a dynamic table
Is there a 'load of program' option in report generation?
Validating table fields
The difference between field groups and internal tables

SAP Web applications
SAP talent management FAQ: Fresh answers to frequently asked questions
How to do additional dialog processing after SAP COMMIT WORK statement
SAP TechEd Demo Jam 2009: Winners use beer keg in demo
SAP CTO expects today's SAP applications to be running in 2020
SAP TechEd 09 keynoters: Managing change today like trying to board a speeding train
An ABAP user wants to learn XI
SAP exec discusses Imagineering, the future of development
The stars of TechEd: SAP application demos
Validating table fields
The difference between field groups and internal tables

SAP ABAP
SAP talent management FAQ: Fresh answers to frequently asked questions
How to do additional dialog processing after SAP COMMIT WORK statement
SAP TechEd Demo Jam 2009: Winners use beer keg in demo
How to implement SAP BADIs
Tips on SAP ABAP
Using subclasses to develop applications that run on different releases of SAP
How to find a piece of SAP ABAP code without debugging
Configuring SAP EDI for sales orders
How to correct an SAP ABAP dump with an oversize condition
How to read an SAP transaction in an ABAP code
SAP ABAP Research

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Application Link Enabling  (SearchSAP.com)
R/2  (SearchSAP.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


Rather than create a new Excel workbook directly, have this read in a template workbook, with an embedded macro to set the Wrap Text property. Add your data to this template and run the macro. Then use Save As to make your new document. I've often used this technique for problematic OLE programming -- it's a lot easier to write a macro.




Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



SAP White Paper Topics
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
SearchSAP.com is a search service provided by TechTarget and is completely
independent of and not affiliated with SAP AG.
  TechTarget - The IT Media ROI Experts