Application Development and Automation 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: 

How to read EXCEL file in ABAP in Background

Former Member
0 Kudos
8,952

Hi,

How can I read Excel file in ABAP in backround task? It's easy in GUI session using OLE, but how can I do it in background?

BR

Maxim.

7 REPLIES 7

Former Member
0 Kudos
1,821

Check this!

Former Member
0 Kudos
1,821

SAP Upload Function modules can not work in Background ,Use Open dataset command for background pupose.

Thank you

Seshu

0 Kudos
1,821

Ok, I'll define more precisely my question:

I need read excel file and analyze it in ABAP in background. Not just upload it to internal table. I need to convert information from it and create other documents from it.

Now I have a program that runs in dialog process and it requires user control. Now I want to write a program that runs in background processing excel file content according to logic required.

BR

Maxim

Jelena_Perfiljeva
Active Contributor
0 Kudos
1,821

Maksim, please use Search before posting. This question pops up like every few months on SDN. It has already been answered, these are just 2 posts from the top of the list:

If this is not sufficient, type in 'read Excel file in background site:sap.com' in Google and read on.

0 Kudos
1,821

Thank you very much Jelena.

Your answer didn't help me. I've read the links you proposed and others as well before asking. There is no solution for my question.

Do you have other links?

Looks like that answer to my question is: It's impossible to read and analyze Excel sheet data in ABAP in background.

Maxim

0 Kudos
1,821

Ivan Femia's excellent blog is about .xlsx files (I really advise this format).

If you don't have the possibility to process .xlsx files, you have 3 possibilities to process in background native Excel files (.xls which are neither masked CSV or tab-delimited text files):

1) you can use Excel in background, if you install it on a Windows computer made server (license cost to check). To do so, you can for example (the simplest way to do it I think):

- install RFC server on Windows server (free download from SAP Marketplace)

- create a program on the RFC server (an excel file prog.xls with an Open macro is sufficient; note: the macro is executed automatically when prog.xls is opened) which will convert a given excel file into a CSV file.

- Read clues for [starting and registrating the server in that blog|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2?quicklink=index] (you'll have to setup saprfc.ini on the server, and create a TCP/IP RFC destination "as registered program id" using SM59).

- From the ABAP program, you will copy the excel file to convert at the expected location, call the program (call RFC_REMOTE_PIPE function module with RFC destination created previously to start prog.xls), and process the returned CSV file.

Otherwise, you must use an external software. For example:

2) purchase a SAP [BC-XDC|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1230a590-0201-0010-3081-f4d94be46b6f] [certified third-party software|http://www.sap.com/ecosystem/customers/directories/SearchSolution.epx] that would allow to convert native Excel 97/2003 format. Then, you can call it easily from SAP by RFC.

3) purchase any other converter software

_IvanFemia_
Active Contributor
0 Kudos
1,821

Hi,

I'm working on xlsx2abap in order to read Excel 2007 file and modify from abap.

[Generate your Professional Excel Spreadsheet from ABAP|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/20046] [original link is broken] [original link is broken] [original link is broken];

You should wait a while

Regards,

Ivan