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

Data Uploding

Former Member
0 Likes
1,154

Hi Gyes,

i want to upload data from excell file to Sap(fb01).

what are the function module we can use uploding data.same as ho to downnlode data from sap to excel.

Thanks & Regards

Suresh

11 REPLIES 11
Read only

Former Member
0 Likes
1,088

Hi,

for upload,

WS_UPLOAD

for download,

WS_DOWNLOAD

Azaz.

Read only

Former Member
0 Likes
1,088

Hi Suresh

data itab like ALSMEX_TABLINE occurs 0 with header line.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = 'D:/Abhi.xls'

i_begin_col = 1

i_begin_row = 1

i_end_col = 11

i_end_row = 2

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.

Read only

Former Member
0 Likes
1,088

hi

u hv to define a internal table of type ALSMEX_TABLINE.

use this FM ALSM_EXCEL_TO INTERNALTABLE.

Naveen

Read only

Former Member
0 Likes
1,088

Hi,

use GUI_UPLOAD to upload the data from flatfile (PC) to Itab.

use GUI_DOWNLOAD to Download the data from ITAB to flatfile(PC).

check this also...

http://www.sapdevelopment.co.uk/file/file_updown.htm

Regards

vijay

Read only

abdul_hakim
Active Contributor
0 Likes
1,088

hi

use the fm ALSM_EXCEL_TO_INTERNAL_TABLE.

Cheers,

Abdul Hakim

Read only

former_member480923
Active Contributor
0 Likes
1,088

Hi

Use the FM ALSM_EXCEL_TO_INTERNAL_TABLE

Hope This Helps

Anirban

Read only

Former Member
0 Likes
1,088

Hi Suresh,

There are some fuction module for uploading fiels such as Ws_upload,upload and 'ALSM_EXCEL_TO_INTERNAL_TABLE'.

you can firest use download file with the path of it.

Regards

Ankur Garg.

Message was edited by: Ankur Garg

Message was edited by: Ankur Garg

Read only

Former Member
0 Likes
1,088

hi suresh,

u can use function modules,

'UPLOAD', 'WS_UPLOAD' 'DOWNLOAD' 'WS_DOWNLOAD'

'ALSM_EXCEL_TO_INTERNAL_TABLE'

HOPE IT WILL HELP U ,GIVE POINTS

CHETAN VISHNOI

Message was edited by: chetan vishnoi

Read only

Former Member
0 Likes
1,088

Hi,

Use the FM 'ALSM_EXCEL_TO_INTERNAL_TABLE

the following is the code snippet to upload the data from xls & manipulate it into a internal table.

the xls had 4 columns & 6 rows. You can change this according to your requirements.

START-OF-SELECTION.

  • construct the header data to be displayed in the ALV.

PERFORM comment_build USING gt_list_top_of_page[].

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = p_file

i_begin_col = 1

i_begin_row = 2

i_end_col = 4

i_end_row = 6

TABLES

intern = gt_intern

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

DATA : l_index LIKE sy-index,

l_res TYPE i VALUE 1,

l_value LIKE vbak-kunnr. .

CLEAR : l_value.

LOOP AT gt_intern INTO wa_intern.

IF wa_intern-col = 1.

l_index = 1.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = wa_intern-value

IMPORTING

output = l_value.

wa_temp-soldto = l_value.

ELSEIF wa_intern-col = 2.

l_index = l_index + 1.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = wa_intern-value

IMPORTING

output = l_value.

wa_temp-shipto = l_value.

ELSEIF wa_intern-col = 3.

l_index = l_index + 1.

wa_temp-matnr = wa_intern-value.

ELSEIF wa_intern-col = 4.

l_index = l_index + 1.

wa_temp-qty = wa_intern-value.

ENDIF.

l_res = l_index MOD 4.

IF l_res EQ 0 .

APPEND wa_temp TO gt_temp.

ENDIF.

ENDLOOP.

Regards,

Sharat.

ps : reward points if helpful

Read only

Former Member
0 Likes
1,088

If u want to upload from Excel sheet use " ALSM_EXCEL_TO_INTERNAL_TABLE"

Otherwise u can save it as .TXT file and upload thru GUI_UPLOAD ...

Read only

Laxmana_Appana_
Active Contributor
0 Likes
1,088

Hi,

Use the FM : 'TEXT_CONVERT_XLS_TO_SAP' for upload .

use the FM : 'MS_EXCEL_OLE_STANDARD_DAT' for download.

Regards

Appana