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: 

How to Uploading Excel sheet cell by cell?

0 Kudos

Hi All,

I have a doubt I refereed so many function modules to upload excel sheet but I need an function module that can upload excel sheet cell by cell.

Is there any FM like that or do you have any idea to write a code for this scenario.

Thanks,

Revanth

18 REPLIES 18

Former Member
0 Kudos

Hi Revanth,

Can you please explain your requirement in detail.

Regards,

Ashish.

0 Kudos

Hi Ashish,

I want to upload excel sheet while uploading itself I want to do operations on it.

Ex. in 1st row I need data from 5th cell and data in other cells should be rejected. Is there any possibility of this situation.

I am new to ABAP I think you can understand me.

0 Kudos

Hi Revanth,

Why can't you handle the same after uploading complete file into internal table in the program. I suggest you to upload complete file into internal table and do required operations and validations on that table. And move required data into another internal table.

Regards,

Vijay

0 Kudos

Hi Revanth,

Its still not clear. Explain with example. Moreover, you can do operations on the data after taking the contents into internal table.

0 Kudos

Hi Revanth,

I understood your question. But I still donot know as why do you want to do operations while uploading the file itself.

You can upload the Excel file into SAP. Convert the excel data into your internal data and thereafter you can modify it or play with the data.

Regards,

Ashish.

0 Kudos

Hi Ashish,

Thanks I got it. And as I mentioned to you after uploading the data into internal table does it will be in rows and columns format or just single line format?

My requirement is after getting data into internal table as you mentioned..

In fifth row second column there will be data called WBGAMES GBP-USD  in this text I need to search for 'GBP' and if this string is present I need to go further to upload remaining data otherwise I need to cancel the uploading.

Can you please suggest me How to do this?

0 Kudos

Hi Revanth,

In table loop you can make use of SY-TABIX to identify row number and String comparison operator CS.

Regards,

Vijay

0 Kudos

Hi Vijaykrishna,

But is it ok with two internal tables with different structures bcoz it will be having currency and date data types...

Thanks

Revanth

0 Kudos

Here you will handle with work areas so, I believe that table structures will not affect this.

Regards,

Vijay

0 Kudos

Hi Revanth,

Is your issue solved? Have you tried as I mentioned?

-Vijay

0 Kudos

Yeah Thanks

0 Kudos

Fine Revanth, please close the thread.

Regards,

Vijay

VijayaKrishnaG
Active Contributor
0 Kudos

Hi Revanth,

What do you mean by "Cell by cell"? It would be better if you elaborate your query.

Regards,

Vijay

thokane
Explorer
0 Kudos

Hi,

You can use following FM for your requirement.

alsm_excel_to_internal_table.

Former Member
0 Kudos

hi Revanth,

you can try to use OLE method like below

create object xlapp 'EXCEL.APPLICATION'.

call method of xlapp 'Workbooks' = xlbook.

call method of xlbook 'Open' exporting #1 = (filen_name).

call method of xlapp 'Worksheets' = xlsheet exporting #1 = (sheet_name).

call method of xlsheet 'Activate'.

call method of xlsheet 'Cells' = scell exporting #1 = zrow

                                                                     #2 = zcolumn.

get property of scell 'Value' = val. " this is the value.

free object scell.

0 Kudos

Hi All,

I got an another doubt I have uploaded file and place it in AL11 directory by naming it as AMEX and now if I again do the same procedure with same file it should not accept it.

How can I solve it.?

0 Kudos

you can use CALL METHOD cl_gui_frontend_services=>file_exist

0 Kudos

Hi Revanth,

If you don't want to upload same file again, then create 2 folders instead on 1 in AL11 directory. Once called as upload and other as Archive. So, once the file is uploaded successfully, you can move that file to Archive folder and will be deleted from Upload folder.

Hope its clear.