cancel
Showing results for 
Search instead for 
Did you mean: 

Creating & Calling Subroutines

Former Member
0 Kudos

Dear Friends,

We have to upload 4 different excel sheets to one database table. I have already uploaded the fields of 1 excel sheet by writing the code for that. Plz tell me how to upload the other three excel sheets ie. how to write a code to call a subroutine.

Thanks,

nishu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nishu,

just write the code that you wrote to uplaod a file in a

FORM upload_table using filename 
                        startrow
                        endrow
                        startcol
                        endcol.
.....
*your code
ENDFORM.
 and then call it using

perform upload_table using: 'C:sample.xls' 1 100 1 2,
                            'C:sample1.xls' 1 100 1 2,
                            'C:sample2.xls' 1 100 1 2.

regards

satesh

Answers (4)

Answers (4)

former_member188685
Active Contributor
0 Kudos

Hi,

you can select the multiple files in one shot to an internal table and loop the internal table and call the fm GUI_UPLOAD and fill the file data to itab.

check this thread there is a sample code.

Regards

vijay

Former Member
0 Kudos

hi

good

what process you are following to upload the data.Use LSMW you can do it very easily.

thanks

mrutyun

Former Member
0 Kudos

Nishu,

I am not sure why you need a subroutine for uploadinf 4 files. Use the method FILE_OPEN_DIALOG of the class CL_GUI_FRONTEND_SERVICES, which can return you multiple files on one shot.

So, just take that table, loop at it and process all the fields in one shot.

As such, for processing multiple files, you will have to execute the entire program, right?

Regards,

Ravi

Note : Please mark the helpful answers

former_member181962
Active Contributor
0 Kudos

Perform sub_routine1 using v_file.

Form sub_routine1 using p_file like v_file.

Endform.

If you are use a GUI_UPLOAD Function module, then call that function module in that perform and send the file names in the v_file.

Regards,

Ravi