2007 Nov 01 9:42 AM
hi,
can anyone please tell how to upload xl data into sap database
2007 Nov 01 9:48 AM
If you want to upload the XLS directly into SAP without first converting it to a tab-delimited format, use the following FM "ALSM_EXCEL_TO_INTERNAL_TABLE". Below is an example of the same:
DATA: IT_MAIN LIKE STANDARD TABLE OF ALSMEX_TABLINE WITH HEADER LINE.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = 'c:\test.xls'
i_begin_col = 1
i_begin_row = 1
i_end_col = 4
i_end_row = 4
tables
intern = IT_MAIN
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.
LOOP AT IT_MAIN.
WRITE:/ IT_MAIN-ROW, ' ',
IT_MAIN-COL, ' ',
IT_MAIN-VALUE, ' '.
ENDLOOP.
Now if you want to upload the same into SAP tables.. then collect the same data into another internal tablle using row and column values and use UPDATE <DBTAB> FROm table ITAB...
otherwise convert the excel file to tab delimeted file (save as) and the use GUI_UPLOAD.. and the UPDATE statement...
2007 Nov 01 9:44 AM
2007 Nov 01 9:44 AM
Use FMs
GUI_DOWNLOAD
ALSM_EXCEL_TO_INTERNAL TABLE
U will get data in internal table thru dese FMs
den u can pass these to ur database tables..
Hope this helps..reward if it does
2007 Nov 01 9:46 AM
2007 Nov 01 9:50 AM
hi,
use this function module and process the data of the internal table as per the requireent
'text_covert_xls_to_sap'
regards ,
taher
2007 Nov 01 9:48 AM
If you want to upload the XLS directly into SAP without first converting it to a tab-delimited format, use the following FM "ALSM_EXCEL_TO_INTERNAL_TABLE". Below is an example of the same:
DATA: IT_MAIN LIKE STANDARD TABLE OF ALSMEX_TABLINE WITH HEADER LINE.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = 'c:\test.xls'
i_begin_col = 1
i_begin_row = 1
i_end_col = 4
i_end_row = 4
tables
intern = IT_MAIN
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.
LOOP AT IT_MAIN.
WRITE:/ IT_MAIN-ROW, ' ',
IT_MAIN-COL, ' ',
IT_MAIN-VALUE, ' '.
ENDLOOP.
Now if you want to upload the same into SAP tables.. then collect the same data into another internal tablle using row and column values and use UPDATE <DBTAB> FROm table ITAB...
otherwise convert the excel file to tab delimeted file (save as) and the use GUI_UPLOAD.. and the UPDATE statement...
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |