‎2006 Jul 19 7:10 AM
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
‎2006 Jul 19 7:11 AM
‎2006 Jul 19 7:13 AM
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.
‎2006 Jul 19 7:13 AM
hi
u hv to define a internal table of type ALSMEX_TABLINE.
use this FM ALSM_EXCEL_TO INTERNALTABLE.
Naveen
‎2006 Jul 19 7:14 AM
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
‎2006 Jul 19 7:14 AM
hi
use the fm ALSM_EXCEL_TO_INTERNAL_TABLE.
Cheers,
Abdul Hakim
‎2006 Jul 19 7:16 AM
Hi
Use the FM ALSM_EXCEL_TO_INTERNAL_TABLE
Hope This Helps
Anirban
‎2006 Jul 19 7:18 AM
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
‎2006 Jul 19 7:19 AM
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
‎2006 Jul 19 7:20 AM
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
‎2006 Jul 19 7:21 AM
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 ...
‎2006 Jul 19 7:27 AM
Hi,
Use the FM : 'TEXT_CONVERT_XLS_TO_SAP' for upload .
use the FM : 'MS_EXCEL_OLE_STANDARD_DAT' for download.
Regards
Appana