How can I get an ABAP program displaying Excel data to wrap text?
Learn how to display details from a Microsoft Excel database table using the Wrap Text function when developing an SAP ABAP program.
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:
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?