Skip to Content
0

SAP OLE to Excel - Record miss problem

Sep 22, 2017 at 04:28 AM

75

avatar image
Former Member

Hi Experts

I am using SAP OLE to transfer records from SAP to multiple sheets of Excel.

Everything is going fine, except that randomly some records get missed while transferring to MS-Excel. This is the problem. However, the same program works pretty smoothly without any hitch when using Open Source platform like WPS Office. If there was any problem with the SAP code, nothing would have got transferred.

Is there anything amiss?

Many thanks

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Raymond Giuseppi
Sep 22, 2017 at 08:18 AM
0

Did you manage the sy-subrc value in each and every call of an OLE method in your code, would be you first step to analyze the problem. Which options did you use in automation methods, some NO FLUSH or QUEUE-ONLY, did you use FM FLUSH, etc.

You should really provide more information. Alas the assertion that if it works with a product like open office then it should work with another as MS Office is often false, also often false with different versions of the same product. So the try, check, correct loops are required, and collection of error code is required in the code.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi.. your statement that "it works with a product like open office then it should work with another as MS Office is often false" was spot on. There was something missing in my code, which I resolved. Now stuck at something different though :)

0
Sandra Rossi Sep 22, 2017 at 06:30 AM
0

There was no such issue with OLE in SAP for decades, so I would first blame a bug in your program. If there would be a bug in SAP standard, then you should reproduce/identify clearly where the error is, and contact the SAP support.

Show 5 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi. Thanks for your answer. In case there is a bug indeed, how is the same program providing seemingly okay output with no records missing with WPS Office.

And the problem is appearing in random record, with no clear pattern appearing.

Edit: The value of sy-subrc is 3 in such cases where record gets missed.

Regards

Dinesh

0
Former Member
Former Member

Hi. In addition, something strange is happening, the problem shows up when I keep excel file opened while the report is running or I click somewhere on the screen. Other than that, it runs fine in excel as well.

Regards

Dinesh

0

sorry, it's impossible to answer the question "why is there sy-subrc = 3 in OLE with Excel ?" Please give more information. Differently said, if you answer my question "why does my function module Z_GET_DATA returns value 'C' ?", then you're a magician!

0
Former Member
Sandra Rossi

Hi..

My apologies for the incomplete information. I am bit closer to the solution, though. I am running the SAP OLE to excel function in background mode and it works till the save part. Probably something missing in my code.

Regards

0

SAP background job? how is it possible to make OLE work in background as the frontend cannot be connected to SAP in such a mode?

0