Uploading multiple EXCEL Worksheets to SAP
hello everyone.
i am new to SAP, and i wanted to create a program that would read multiple excel worksheets and appened the values of the file to an internal table.
can somebody help me with this?
here's what i wanted to do exactly:
excel tab:
worksheet 1:
pernr | begda | endda |
worksheet 2:
pernr | begda | endda | address line 1 | address line 2 | phone number
worksheet 3:
pernr | begda | endda | Annual salary |
i wanted those data to be in the following internal tables:
for worksheet 1: >>>> i_pa0002.
for worksheet 2: >>>> i_pa0006.
for worksheet 3: >>>> i_pa0008.
thanks a lot for future replies.
Mark
hi,
you can use fm
ALSM_EXCEL_TO_INTERNAL_TABLE
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = 'File Path\File name.xlsx'
i_begin_col = 'A'
i_begin_row = 1
i_end_col = 'E'
i_end_row = 3
tables
intern = itab
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
if sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
thanks
Similar Messages
-
Need help in uploading an excel file into SAP
Hi All,
I got a requirement to upload an excel file to SAP.
But When i tried with the FM "ALSM_EXCEL_TO_INTERNAL_TABLE" , file not getting uploaded to internal table.
Getting expection 2, UPLOAD_OLE...
I think the problem is with the file... the following the sample text of the file...
Technical IdentNo. Line No. Text Location
BS-PZ-180 1 035-05 EXZENTER-SCHNECKENPUMPE 0026
BS-PZ-180 2 LIEFERANT : SOCSIL-INTER SA ECUBLENS 0026
BS-PZ-180 3 HERSTELLER : MONO PUMPS LIMITED MANCH 0026
BS-PZ-180 4 MODELL/TYP : SH 60 0026
But when I tried with only one Column..its getting successfully uploaded...
Pls suggest me how to upload the file? ( May be with sample code)
Also pls let me know hw to handle the file..which contains 5 differnt sheets of texts.. ( May be with sample code)
Your suggestion will be highly appreciated...
Thanks,
PriyaHi,
Use the FM: TEXT_CONVERT_XLS_TO_SAP. It will work perfectly. I used this function module and uploaded data from xls to sap. check the following code:
TYPE-POOLS: truxs.
PARAMETERS: p_file TYPE rlgrap-filename.
TYPES: BEGIN OF t_datatab,
PROP_NAME like SDOKPROP-PROP_NAME,
PROP_CHECK like SDOKPROP-PROP_CHECK,
TABNAME like SDOKPROP-TABNAME,
FIELDNAME like SDOKPROP-FIELDNAME,
DESCRIPT(30) type c,
END OF t_datatab.
DATA: it_datatab type standard table of t_datatab,
itab TYPE STANDARD TABLE OF t_datatab,
wa_itab TYPE t_datatab,
wa_datatab type t_datatab.
DATA: it_raw TYPE truxs_t_text_data.
At selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
*START-OF-SELECTION.
START-OF-SELECTION.
SELECT * FROM sdokprop INTO CORRESPONDING FIELDS OF TABLE itab
WHERE PROP_NAME LIKE 'DMS%'.
WRITE / 'Before Modification'.
LOOP AT itab INTO wa_itab.
WRITE:/1 wa_itab-PROP_NAME, 27 wa_itab-PROP_CHECK, 31 wa_itab-TABNAME, 65 wa_itab-FIELDNAME, 96 wa_itab-DESCRIPT.
CLEAR wa_itab.
ENDLOOP.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw " WORK TABLE
i_filename = p_file
TABLES
i_tab_converted_data = it_datatab[] "ACTUAL DATA
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
END-OF-SELECTION.
END-OF-SELECTION.
WRITE / 'After Modification'.
MODIFY sdokprop FROM TABLE it_datatab.
LOOP AT it_datatab INTO wa_datatab.
WRITE:/1 wa_datatab-PROP_NAME, 27 wa_datatab-PROP_CHECK, 31 wa_datatab-TABNAME, 65 wa_datatab-FIELDNAME, 96 wa_datatab-DESCRIPT.
CLEAR wa_datatab.
ENDLOOP.
IF sy-subrc = 0.
MESSAGE 'successfull' TYPE 'S'.
ELSE.
MESSAGE 'failed' TYPE 'E'.
ENDIF.
Regards,
Bhaskar -
While uploading the excel BOM to SAP in PRD getting the ABAP dump error not
Hi Experts,
While uploading the excel BOM to SAP in PRD getting the ABAP dump error not able to proceed further.
and if I visit ST22 t code it is telling that :RAISE_EXCEPTION and DYNPRO_NOT_FOUND.
PLease help.
Regards,
MohanHi,
Better ask this question in ABAP forums.
Regards,
Harsh. -
How to upload the Excel sheet into SAP
Hello Gurus,
Please let me know the steps how to upload excel sheet file in sap at one time.Suppose i have entered the employee details and their caste .This detail has been maintained in Excel.I want to know the total steps how to upload this total file into SAP System.
Regards
AM. TCode : LSMW.
2. Enter Project name, sub project name and object name.
Execute.
3. Maintain object attributes.
Execute
select Batch Input recording
goto->Recording overview
create
recording name.
enter transaction code.
start recording
do recording as per ur choice.
save + back.
enter recording name in lsmw screen.
save + back
Now there will be 14 steps.
2. MAINTAIN SOURCE STRUCTURES.
Here you have to enter the name of internal table.
display change
create
save + back
3. MAINTAIN SOURCE FIELDS.
display change
select structure
source_fields->copy fields.
a dialogue window will come .
select -> from data file
apply source fields
enter No. of fields
length of fields
attach file
save + back
4. MAINTAIN STRUCTURE RELATIONS
display change
save + back
5. MAINTAN FIELD MAPPING & CONVERSION RULE
display change
click on source field, select exact field from structue and enter
repeat these steps for all fields.
save+back
6. MAINTAIN FIXED VALUES, TRANSACTION, USER DEFINED
execute
save + back
7. SPECIFY FILES.
display change
click on legacy data
attah flat file
give description
select tabulatore
enter
save + back
8. ASSIGN FILE
execute
display change
save + back
9. IMPORT DATA.
execute
display change
save + back
10. DISPLAY IMPORTED DATA
enter ok, it willl show records only.
back
11. CONVERT DATA
execute
display change
save + back
12. DISPLAY CONVERTED DATA
execute
display change
save + back
13. CREATE BATCH INPUT SESSION
tick keep batch input folder
F8
back
14. RUN BATCH INPUT SESSION.
sm35 will come
Object name will be shown here
select object & process
inputs given by KAPIL -
Upload multiple excel files into tables using APEX
Hi folks,
I'm wondering if anyone has ever uploaded multiple .csv files simultaniously and store the data into the database using APEX XE before.
I can browse for a single file, and execute that okay and a good example of doing that can be found at http://advait.wordpress.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
This works fine when the user browses to a specific file on their network and then uploads the data from that one file.
However I need the ability to 'grab' every file in a specific directory one after the other to process rather than having to specify which one to load everytime, and wondered if anyone has come across this before.
Many thanks
Graham.Just for completeness ...
Got this to work, but it's a pl/sql issue as opposed to an APEX issue.
Anyway, if anyone needs to have the ability to read multiple files then a quick easy way to do it (as lomg as they know the file names that will be read), is to create a directory on the database which points to the actual harddrive on your PC, then create a table (called an external table) and read from that external table as if it was an actual database table ...
1 - Log on as sys and grant CREATE ANY DIRECTORY to whatever user you are logging in as (assuming you are not using sys to create apps)
2 - Create a directory e.g....CREATE OR REPLACE DIRECTORY GB_TEST AS 'c:\gbtest';
3 - Create an external table as ...
CREATE TABLE gb_test
(file_name varchar2(10),
rec_date date
rec_name VARCHAR2(20),
rec_age number,
ORGANIZATION EXTERNAL
TYPE ORACLE_LOADER
DEFAULT DIRECTORY GB_TEST
ACCESS PARAMETERS
RECORDS DELIMITED BY NEWLINE
FIELDS TERMINATED BY ','
LOCATION ('data1.csv','data2.csv','data3.csv','data4.csv')
PARALLEL 5
REJECT LIMIT 20000;
That's it then ...
select * from gb_test
where file_name = 'xxx'
will return all the data where the file_name = 'xxx'
very easy to use. -
Creating multiple Excel worksheet
Gurus,
I am downloading data into Excel from my web page by using the following:
Response.setContentType("application/vnd.ms-excel");
HtmlWriter out = aResponse.getWriter();
out.print(
I am able to view all the data in one Excel worksheet. Does anyone know of a way to create multiple worksheets?
Thanks in advance for your help.Look at POI at http://jakarta.apache.org/poi/ for an open source library to write Excel with Java.
If you just want to produce a one-off, you can save an Excel workbook as XML and look at that to see how the sheets are produced in XML.
There are also commercial products like Formula One that provide support for reading and writing directly to/from Excel from Java. -
Can anybody help how to upload an excel file into sap-crm urgent
hi guys,
i need the right function module to upload the excel file from the presentation server in to sap-crm.
1) I know we use the function module 'ALSM_EXCEL_TO_INT_TABLE' in sap-r/3 but this function module is not exist in sap-crm.
2) i tried with the function moduel 'GUI_UPLOAD' but its not uploading correctly i am gettting hases(#).
Please can any one provide the right function module to upload the excel into sap-crm with an sample code.
thanks
viswa gunthaHi Visma,
Please check this link for sample custom FM.
Re: function mudule for MS excel file to sap crm
Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful as away to say thanks. -
Need Function module to upload an excel file to SAP
Need Function module to upload more than 100 characters of excel file data into SAP internal table.
Currently i have two function module
1. ALSM_EXCEL_TO_INTERNAL_TABLE --32 characters max
2. KCD_EXCEL_OLE_TO_INT_CONVERT --50 characters max
Please let me know some pointers.
Thanks in Advance,
A.Karthikeyan.hi,
use the FM GUI_UPLOAD
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = W_FILENAME
FILETYPE = W_FILETYPE
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = 'X'
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = wp_it_upload
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17. -
ABAP Internal Tables to Multiple Excel Worksheets in One Workbook
I have an ABAP List report that shows data from two dozen internal tables. Each internal table has different fields, formats, column headers, etc.
I need to allow the user to export this data into one Excel file. The file should contain multiple worksheets (each on a separate tab), but it should only be one XLS file. Each worksheet is formatted differently.
I just coded it with the OLE Automation commands. It runs too SLOW.... way way too slow. Is there another technique to use that runs faster? Examples?
Thanks in advance!I should add...
the slow part of this process is setting the value of each cell.
SET PROPERTY OF gh_cell 'Value' = p_lv_value
I am looking into function modules XXL_SIMPLE_API and XXL_FULL_API. They appear to work faster, but they only create a single worksheet.
Maybe it would be fastest to use the XXL modules to create multiple spreadsheet files and then use the OLE commands to merge them into a single workbook file? -
Uploading multiple excel sheets
Dear All,
We are having 4 different excel sheets where data is stored regarding the quantity of laptops, desktops, printers & xerox machines. This data is to be loaded into the SAP tables with Co Code & BA Code as primary key which is there available in excel sheets.
Plz help me in code to upload all the 4 files in SAP tables based on a combination of CO Code & BA Code.
The selection screen will have 4 fields to specify the path of all the 4 excel sheets & all the fields are obligatory.
Thanks & Reg,
NishantHi Satesh,
Thanks very much for your prompt reply.
I am attaching the code herewith, please guide me where to use FORM & PERFORM to upload the other 3 excel sheets of the same format.
REport nis1234.
TABLES: bseg,
zfi_is_qty.
DATA:
t_excel LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE,
l_nodata TYPE c,
l_excelfile(128) TYPE c. " filename to be passed to excel file
DATA: BEGIN OF t_type,
bukrs LIKE bseg-bukrs,
gsber LIKE bseg-gsber,
COUNT TYPE I,
END OF t_type.
data: l_charlen1 type i,
l_charlen2 type i.
DATA: t_type2 LIKE t_type OCCURS 0 WITH HEADER LINE.
DATA: l_end_row TYPE i,
l_endrow1 TYPE i,
charlen type c.
DATA l_count TYPE I.
DATA : q_count TYPE i value 1.
PARAMETER :
p_endrow TYPE i OBLIGATORY,
p_file TYPE rlgrap-filename OBLIGATORY.
****clearing the contents of database table before uploading a new file everytime
DELETE FROM ZFI_IS_QTY.
*****selection-screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
field_name = p_file
CHANGING
file_name = p_file.
START-OF-SELECTION.
l_excelfile = p_file.
l_endrow1 = p_endrow.
p_endrow = p_endrow + 1.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = l_excelfile
i_begin_col = 5
i_begin_row = 2
i_end_col = 6
i_end_row = p_endrow
i_end_row = 4000
TABLES
intern = t_excel
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
MESSAGE i010(zn) WITH 'Error in upload Please check the upload file'.
ENDIF.
DESCRIBE TABLE T_EXCEL LINES L_ENDROW1.
L_ENDROW1 = L_ENDROW1 / 2.
DO.
LOOP AT t_excel WHERE row = q_count.
IF t_excel-col = 1.
t_type2-gsber = t_excel-value.
ELSEIF t_excel-col = 2.
t_type2-bukrs = t_excel-value.
ENDIF.
ENDLOOP.
l_charlen1 = strlen( t_type2-bukrs ).
l_charlen2 = strlen( t_type2-gsber ).
if ( t_type2-bukrs <> ' ' and t_type2-gsber <> ' ' ).
if ( l_charlen1 = 4 and l_charlen2 = 4 ).
APPEND t_type2. CLEAR t_type2.
endif.
endif.
q_count = q_count + 1.
IF q_count > l_endrow1.
EXIT.
ENDIF.
ENDDO.
SORT T_TYPE2 BY BUKRS GSBER.
*****uploading data from internal table into database table
LOOP AT T_TYPE2.
MOVE-CORRESPONDING T_TYPE2 TO T_TYPE.
L_COUNT = L_COUNT + 1.
AT END OF GSBER.
AT END OF BUKRS.
write:/ t_type-BUKRS,
t_type-GSBER,
L_COUNT.
zfi_is_qty-COMPANY_CODE = t_type-bukrs.
zfi_is_qty-BAREA = t_type-gsber.
zfi_is_qty-DT = l_count.
insert zfi_is_qty.
CLEAR L_COUNT.
ENDAT.
ENDAT.
ENDLOOP.
************to read the data from the database table.
data: itab like zfi_is_qty occurs 0 with header line.
select * from zfi_is_qty into corresponding fields of table itab.
ULINE.
loop at itab.
WRITE:/ ITAB-COMPANY_CODE,
ITAB-BAREA,
ITAB-DT.
Endloop.
Thanks in advance,
nishu -
Report to multiple Excel Worksheets
Hi,
I have a report that has data from many data groups. Is it possible for me, using XML Publisher, to convert the groups of data into different worksheets within the same excel spreadsheet.
Currently, I have all four groups of data (or sets of data) displayed one after the other in one spreadsheet using the RTF template. Our users want the data to be displayed in different worksheets within an Excel file. Is it doable?
I am using version 5.6.3 of XML Publisher and 11.5.10.2 version of Oracle Apps.
Thanks in advance.
Regards,
VenkatThis is just a thought, as I am no Excel guru. Once the data is in one worksheet, you should be able to use Excel macros to split the data up and move it around (as long as the number of rows doesn't change).
-
Accessing same data in Multiple Excel Worksheets
I am trying to create a summary page based on data that is on subsequent worksheets via the Excel template in Bi Publisher 11g.
I wanted to know if there is a way to reference a Group. So if I had a Department (G_D) and a Employees (G_E) groups in the data model and then I wanted to reference G_D on both sheet 1 and Sheet 2 in the spreadsheet how would I do it.
I created the equivalent in the XDO_METADATa Sheet:
XDO_GROUP_?G_D1? <?(.//G_D)?>
XDO_?G_DNO1? <?(.//DEPTNO)?>
and the Template viewer ran but did not print out any departments. When I remove the XDO_GROUP_?G_D1? it prints out all of the departments in one row, rather than in columns as I would like.Again, as I got no help from the forum, I resolved this by changing the data model within BI Publisher and created another query for the summary data and then referenced this on the other page.
Will leave thread open for a few days in case someone has a better way of doing it.
I wanted to reference the existing data because:
a) it is already there, why should I have to run another query
b) I am guaranteed to get the same results and won't have any rounding type issues when aggregating the individual values. -
Upload excel file in SAP BI-7.0
Hi ,
i need to upload an excel file in SAP BI 7.0 where the standard r/3 fm are not available.
Currently we uploading a file in CSV format but now we want to upload using XLS also.
ia way to upload excel file in SAP BI 7.0
Best Regards,
Sharad
Edited by: sharad narayan on Jan 7, 2011 10:58 AM
while searching the forum i found the fm MS_EXCEL_OLE_STANDARD_DAT .
but while using this FM i am getting the exception file not exist.
Kindlu suggest what to do
i even tried the FM TMP_GUI_GET_FILE_EXIST' to check the existence of the file.
even then same problem.
Please suggest
Edited by: sharad narayan on Jan 10, 2011 2:51 PMHi,
Scheduled jobs are the jobs for which we have scheduled for a time, may be daily so that each day the scheduled jobs will trigger at the time given.So that every time u need not to trigger the job manully urself as the schedule time will hit the job will trigger itself.
Released job means the job which is in between Sheduled state and active state.say For eg: 10 jobs are Scheduled in a queue Job no 1 is released from the queue that means any moment it will be in active state.So it is the state between Schedule and Active state of a job.
Thanks
Varun -
How to upload an excel template file to SAP server
Dear Experts,
I am develpoing a program to generate the Excel file with a fixed template and save it to user's local drive, the excel template is stored in SAP server. I use the function module C13Z_FILE_DOWNLOAD_BINARY to do this is. But now my problem is I do not know how to upload the excel template to our SAP server. Do any friends can kindly tell me how to upload the excel template to SAP server?? Thanks.
Best Regards
JoeHi Joe,
Please refer following sample program:
http://abapcode.blogspot.com/2007/06/sample-program-to-upload-excel-document.html
Best regards,
Prashant -
How to uplaod multiple excel sheets in a program
Hi gurus,
Can anyone suggest me
how to upload multiple excel sheets in program.( not in OOPS)
my excel sheets has 5 sheets like sheet1, sheet2, sheet3 ....like this..
Thanks & Regards
kalyan.swc_container it_event_container.
swc_create_container it_event_container.
CALL FUNCTION 'SWW_WI_CONTAINER_READ'
EXPORTING
wi_id = wd_id
TABLES
wi_container = it_event_container
EXCEPTIONS
container_does_not_exist = 1
read_failed = 2
OTHERS = 3.
if sy-subrc = 0.
READ TABLE it_event_container WITH KEY element = 'name of your workflow container element'.
IF sy-subrc = 0.
w_variable= it_event_container-value.
ENDIF.
endif.
Regards
Kedar
Maybe you are looking for
-
Hi, I have problem with pdf format in reports6i, i'm usually using pdf in my reports, but i have problem with it. When I print a reports in PDF format it's always shown my old data that i have open previously, this is cause by the cache on Browser. I
-
HT201210 Itunes not recognising Ipod?
I tried to update my ipod to the latest software and itunes did not recognise my ipod, can anyone help me on how i can restore my ipod now as this is what needs to be done? Thanks, Nicole
-
I'm constantly downloading files that should go into a specific folder but I don't have a 'Save As' option when I choose to save. As a result everything goes into the Download folder. This means I have to go to the download folder and move it. How ca
-
Need latest protocol for preparing movie for web in X
Hello. The basic problem is slow start on You Tube. My general question concerns preparing a movie for the web; not restricted to You Tube. In FCP 7, it was export using QT conversion, to Quick Time Movie using broadband Med or most recent settings,
-
I have an old WordPerfect file I converted to a rich text file. My new Macbook says it can't open it so I downloaded Abiword and it won't open it either. How can I get that file to open?