Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

OLE: export quantity with decimals according to UoM

Former Member
0 Kudos

Dear Guru,

I encounter a problem when exporting data from Itab to Excel using OLE.

In the itab, there are many Quantity fields (with UoM). When I export to Excel, I want the number of decimals of each quantity field must comply with UoM (for ex: PC with 0 decimal, Kgs with 3 decimals).

I try to write the qty to text, it's ok but I also need the exporting qty is formatted as a number in Excel so user can do a sum.

The solution for this problem seems complicated. I have to write qty to text, convert text to number...But for a large number of data, it is really slow.

Is there anybody encounter the same problem? Please advice the solution.

Thanks.

2 REPLIES 2

Former Member
0 Kudos

Try this function to export the data: XXL_SIMPLE_API

Check these example programs: XXLFTEST, XXLSTEST, XXLTTEST

Sandra_Rossi
Active Contributor
0 Kudos

> The solution for this problem seems complicated. I have to write qty to text, convert text to number...But for a large number of data, it is really slow.

You make confusion about the real problem. Converting the quantity is not time consuming (or your program is really badly programmed ).

What is time consuming is making many calls to OLE.

To avoid that issue, SAP uses the Data Provider and the Desktop Office Integration (DOI). The whole data is sent to the frontend once (more or less), and sends only a few instructions to the frontend to process this data. I don't really know the exact process, but it's really, really much faster.

DOI can be programmed directly (there are SAP demo programs which show how it works, search forum), and there is an upper abstraction if you only need to paste data, set colors, that is indicated by Pedro.