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: 
Read only

uploading xl

former_member197425
Active Participant
0 Likes
780

hi,

can anyone please tell how to upload xl data into sap database

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
755

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...

5 REPLIES 5
Read only

Former Member
0 Likes
755

Hi,

You have to Upload the data using a BDC.

Regards,

Subha.

Read only

Former Member
0 Likes
755

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

Read only

Former Member
Read only

0 Likes
755

hi,

use this function module and process the data of the internal table as per the requireent

'text_covert_xls_to_sap'

regards ,

taher

Read only

Former Member
0 Likes
756

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...