Fn module for Excel to internal table
xperts,
Required some fn modules to get data from excel / csv file to internal table.
Ragards,
Anoop Chandran
Hi Anoop,
Please check these modules,
KCD_SENDERSTRUC_LOGICAL_READ
KCD_SENDER_STRUCTURE_GET
KCD_SEND_TAB_FILL
RKC_T242S_TAB_FILL
SCAG_GET_PERIODS_TO_WORK
SCAG_GET_USAGE_DATA_INT
METAL_FILE_LOAD
Regards
R. Senthil Mareeswaran.
Similar Messages
-
Function Module for .xlsx to Internal table
Hi Gurus,
Please let me know if there is any function module for .xlsx to internal table.
Kind regards,
VarunHi,
try the below FM's
ALSM_EXCEL_TO_INTERNAL_TABLE
TEXT_CONVERT_XLS_TO_SAP
Thanks,
Vinayaka -
For uploading Excel to Internal Table??????
Hello All,
Can anybody give me the details for uploading Excel to Internal Table.
Plz give me the FMs with parameters (Eg).
I need to use this inside a BDC Program.
Urgent
Thanks in Advance,
Regards,
LIJO.Hi,
refer the below code.
DATA:xl_sheet LIKE kcde_cells OCCURS 0 WITH HEADER LINE.
DATA : scol TYPE i VALUE '1',
srow TYPE i VALUE '1',
ecol TYPE i VALUE '256',
erow TYPE i VALUE '65536'.
DATA : index TYPE i.
FIELD-SYMBOLS : <fs>.
CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
EXPORTING
filename = 'file path'
i_begin_col = scol
i_begin_row = srow
i_end_col = ecol
i_end_row = erow
TABLES
intern = xl_sheet
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
Write:/ 'Not a valid Excel file'.
ENDIF.
IF xl_sheet[] IS INITIAL.
WRITE:/ 'Error:Data not Uploadeded'.
EXIT.
ELSE.
SORT xl_sheet BY row col.
LOOP AT xl_sheet.
MOVE xl_sheet-col TO index.
ASSIGN COMPONENT index OF STRUCTURE ittab TO <fs>.
MOVE xl_sheet-value TO <fs>.
AT END OF row.
APPEND ittab.
CLEAR ittab.
ENDAT.
ENDLOOP.
ENDIF.
Note:- after reading excel sheet to our internal table, each excel cell will be stored as a reocrd into yout internal table,let us i suppose if you have 3 fields in first reocrd, it will stores 3 fields data as 3 records into your internal table, each field contains row number and column number, then you have to take care to from this information as a record.
Reward if useful.
Thanks,
Sreeram. -
Upload data from Excel to Internal table
Hi,
I am facing a peculiar problem in uploading the data in excel sheet to internal table.
The excel file contains material number and product hierarchy number. The product hierarchy number for some material is downloaded as 5.73101E17 for the value 573100910115782000. Though I expand the sheet the display is the same 5.73101E17. When i upload the sheet using the f'n module "ALSM_EXCEL_TO_INTERNAL_TABLE" the value is taken as it is (5.73101E+17) into the internal table which is wrong. I tried to change the data type to type n. Then the value is uploaded as 5731011700000000.
Please propose a solution to this without having to change the format of the column from general to "number without decimals"
Regards,
SamHI
see this example code which EXCEL TO INTERNAL TABLE AND THEN TO APPLICATION
*& Report ZSD_EXCEL_INT_APP
REPORT ZSD_EXCEL_INT_APP.
parameter: file_nm type localfile.
types : begin of it_tab1,
f1(20),
f2(40),
f3(20),
end of it_tab1.
data : it_tab type table of ALSMEX_TABLINE with header line,
file type rlgrap-filename.
data : it_tab2 type it_tab1 occurs 1,
wa_tab2 type it_tab1,
w_message(100) TYPE c.
at selection-screen on value-request for file_nm.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SYST-REPID
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
STATIC = 'X'
MASK = ' '
CHANGING
file_name = file_nm
EXCEPTIONS
MASK_TOO_LONG = 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.
start-of-selection.
refresh it_tab2[].clear wa_tab2.
file = file_nm.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = file
i_begin_col = '1'
i_begin_row = '1'
i_end_col = '10'
i_end_row = '35'
tables
intern = it_tab
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_tab.
case it_tab-col.
when '002'.
wa_tab2-f1 = it_tab-value.
when '004'.
wa_tab2-f2 = it_tab-value.
when '008'.
wa_tab2-f3 = it_tab-value.
endcase.
at end of row.
append wa_tab2 to it_tab2.
clear wa_tab2.
endat.
endloop.
data : p_file TYPE rlgrap-filename value 'TEST3.txt'.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
*--- Display error messages if any.
IF sy-subrc NE 0.
MESSAGE e001(zsd_mes).
EXIT.
ELSE.
*---Data is downloaded to the application server file path
LOOP AT it_tab2 INTO wa_tab2.
TRANSFER wa_tab2 TO p_file.
ENDLOOP.
ENDIF.
*--Close the Application server file (Mandatory).
CLOSE DATASET p_file.
loop at it_tab2 into wa_tab2.
write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.
endloop. -
Upload data from Excel to Internal table in ECC
Hello SDN,
Here I am facing a problem for uploading the data from excel sheet to internal table in ECC6.0
Main problem is we don't have any FM ALSM_EXCEL_TO_INTERNAL_TABLE.
Please provide me the solution how to upload the data from excel to internal table through class. If possible please provide me the sample code so that it will be very helpful for me.
Waitingfor your valuable response.
Thanks & Regards,
Kumar.Hi,
you can use OLE to acces (not only) excel, but this will only work in dialog processing.
regards,
Hans -
In SRM How to upload data from Excel to Internal Table
Hello Experts,
As seen the Function Module 'ALSM_EXCEL_TO_INTERNAL_TABLE' does not exists in SRM.
Is there any alternative to upload the data direct from excel to Internal table using any other FM. As seach did't get any relevant FM.
Please advice..
Thanks..did u try this
TEXT_CONVERT_XLS_TO_SAP
in this manner
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_line_header = 'X'
i_tab_raw_data = lt_raw
i_filename = p_path
TABLES
i_tab_converted_data = gt_output
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
this FM works on DOI
so
SAP document about DOI:
http://help.sap.com/saphelp_nw2004s/helpdata/EN/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
SAP Demo Program about DOI: SAPRDEMOEXCELINTEGRATION.
the fm you mentioned works on OLE
so you could refer,
SAP document about OLE:
http://help.sap.com/saphelp_46c/helpdata/EN/59/ae3c98488f11d189490000e829fbbd/frameset.htm
Also you can refer this post
Download of SRM Contracts in Excel - Unit of Measurement Missing
Let me know if this works ..
Regards
Manthan.
Edited by: Manthan_R on Feb 23, 2010 12:18 PM -
Uploading Excel to Internal Table
Hi,
Can anyone please look into the code and suggest me the changes in uploading Excel to Internal Table. Code is as below in OnInputProcessing.
DATA: event TYPE REF TO CL_HTMLB_EVENT.
event =
CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
DATA: fileUpload TYPE REF TO CL_HTMLB_FILEUPLOAD,
fcontent type xstring,
fstring type string,
len TYPE I.
fileUpload ?= CL_HTMLB_MANAGER=>GET_DATA(
request = runtime->server->request
name = 'fileUpload'
id = 'myFileUpload1').
len = fileUpload->file_length.
IF event->id = 'submitButton' AND
event->event_type = 'click'.
fileUpload ?=
CL_HTMLB_MANAGER=>GET_DATA( request = request
id = 'myFileUpload1'
name = 'fileUpload' ).
IF ( fileUpload->file_name NE '' ) AND
( fileUpload->file_length GT 0 ).
IF fileUpload->file_content_type
= 'application/vnd.ms-excel'.
DATA: content TYPE ZTABLE,
conv TYPE REF TO CL_ABAP_CONV_IN_CE,
viewoff TYPE REF TO CL_ABAP_VIEW_OFFLEN,
it_off TYPE ABAPOFFLENTAB,
wa_off TYPE ABAPOFFLEN,
dd_fields TYPE DDFIELDS,
wa_fields TYPE DFIES.
data: codepage type CPCODEPAGE.
CALL FUNCTION 'SCP_CODEPAGE_BY_EXTERNAL_NAME'
EXPORTING
external_name = 'utf-16le'
KIND = 'H'
IMPORTING
SAP_CODEPAGE = codepage.
conv = CL_ABAP_CONV_IN_CE=>CREATE( encoding = '4103'
endian = 'L'
input = fileUpload->file_content
ignore_cerr = 'X').
CALL FUNCTION 'TR_NAMETAB_GET'
EXPORTING
IV_TABNAME = 'ZTABLE'
IV_GET_LENGTHS_IN_CHARMODE = 'X'
IV_GET_TEXTS = ' '
IMPORTING
ET_DFIES = dd_fields.
LOOP AT dd_fields INTO wa_fields.
MOVE wa_fields-offset TO wa_off-ioff.
MOVE wa_fields-intlen TO wa_off-ilen.
APPEND wa_off TO it_off.
ENDLOOP.
viewoff = CL_ABAP_VIEW_OFFLEN=>CREATE( tab = it_off ).
call method conv->read( importing data = fstring ).
fcontent = conv->get_buffer( ).
call function 'HR_KR_XSTRING_TO_STRING'
exporting
from_codepage = '4103'
in_xstring = fcontent
importing
out_string = fstring.
data: input_string type string.
data: fields type string_table.
data: s_table type string_table.
split fstring at cl_abap_char_utilities=>cr_lf into table s_table.
field-symbols: <wa_table> like line of s_table.
loop at s_table assigning <wa_table>.
split <wa_table> at cl_abap_char_utilities=>HORIZONTAL_TAB into table
fields.
endloop.
endif.
endif.
endif.
thanks in advance,
anjani.Hi anjani,
it doesn't help much if you just post some code and request changes, if you don't state the kind of problem you are having ... in order to receice helpful replies, you have to give detailed information, what you want to do, what is not working as expected ... so please post more details.
Meanwhile I recommend doing a search for your excel problem in the forum and also read the excel weblogs from <a href="https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/pub/u/1918">Thomas Jung</a>.
Regards,
Max -
No storage space available for extending an internal table.
Hi All,
I am using Function Module : VC_I_GET_CONFIGURATION in FI related Sales Order Report to get
configuration data for fields Model/Engine and Line no.
when the program executed in Production environment, It is giving Runtime Error TSV_TNEW_PAGE_ALLOC_FAILED.
ShrtText : No storage space available for extending an internal table.
The termination occurred in the ABAP program "SAPLIBINF" in "SELECT_INSTANCES_01" . its all happening
in the above FM.
Is there any possibility to get configuration data (Model/Engine and Line no) with out using FM.
please advise me on how you would like to proceed related to this issue.
Thanks & Regards
Satish ReddyHi Satish,
Please go through the below links and see if you can use this to address your issue,
http://wiki.sdn.sap.com/wiki/display/ABAP/ReplacementofVC_I_GET_CONFIGURATIONforperfomance+tunning
VC_I_GET_CONFIGURATION and paging memory
Regards,
Chen
Edited by: Chen K V on May 26, 2011 2:34 PM -
BW..No more storage space available for extending an internal Table
Hi;
In function module - RSAR_TRFC_DATA_RECEIVED
During Data loading from ERP to BW client am getting an error in SM58 in ERP as ""No more storage space available for extending an internal Table "".
There is a dump in BW system TSV_TNEW_PAGE_ALLOC_FAILED
"".I checked all the parameters for roll area,paging , etc..everything is fine. Also tried with packet size smaller ..still i am getting this error ..
Thanks & regards
seethyhi thanks for the response....
Memory parameters are fine
em/initial_size_MB 2048 EM/TOTAL_SIZE_MB 21679 em/global_area_MB 256 Ztta/roll_area 6500000
ztta/roll_first 1
ztta/roll_extension 2000000000
rdisp/ROLL_MAXFS 32768
rdisp/PG_MAXFS 32768
rdisp/ROLL_SHM 16384
rdisp/PG_SHM 16384
abap/heap_area_dia 2000000000
abap/heap_area_nondia 2000000000
abap/heap_area_total 4000000000
i have checked with Less data selection. still error occurs
regards
seethy -
Uploading data from an excel to internal table.
Hi All,
I have a small problem when uploading data from an excel sheet to internal table using the function "GUI_UPLOAD".
Some garbage value is getting stored in the internal table after the upload. If i change the format of the file to ".txt" then its working fine. Pls help me out to upload the data frm Excel to Internal Table.
Thanks.
Sirisha.hi
good
pls check this code , this might help you to solve your problem
Multiple excel sheets generation in a workbook
CREATE OBJECT EXCEL 'EXCEL.SHEET'.
GET PROPERTY OF EXCEL 'Application' = APPLICATION.
SET PROPERTY OF APPLICATION 'Visible' = 1.
CALL METHOD OF APPLICATION 'Workbooks' = BOOKS.
CALL METHOD OF BOOKS 'Add' = BOOK.
CALL METHOD OF BOOK 'WORKSHEETS' = SHEET.
CALL METHOD OF SHEET 'ADD'.
Fill all the sheets with relavant data
PERFORM SHEET1 TABLES ITAB1.
PERFORM SHEET2 TABLES ITAB2.
PERFORM SHEET3 TABLES ITAB3.
PERFORM SHEET4 TABLES ITAB4.
Quit the excel after use
CALL METHOD OF EXCEL 'QUIT'.
FREE OBJECT: COLUMN,SHEET,BOOK,BOOKS,APPLICATION,EXCEL. "NO FLUSH.
CLEAR V_SHEET.
FORM FILL_CELL USING ROW COL VAL.
CALL METHOD OF SHEET 'cells' = CELL NO FLUSH
EXPORTING #1 = ROW #2 = COL.
SET PROPERTY OF CELL 'value' = VAL.
FREE OBJECT CELL NO FLUSH.
ENDFORM. " FILL_CELL
FORM SHEET1 TABLES ITAB1 STRUCTURE ITAB1.
V_SHEET = Sheet Name.
V_NO = V_NO + 1.
CALL METHOD OF BOOK 'worksheets' = SHEET NO FLUSH EXPORTING #1 = V_NO.
SET PROPERTY OF SHEET 'Name' = V_SHEET NO FLUSH.
PERFORM FILL_SHEET1 TABLES ITAB1 USING V_NO V_SHEET.
CALL METHOD OF SHEET 'Columns' = COLUMN.
FREE OBJECT SHEET.
CALL METHOD OF COLUMN 'Autofit'.
FREE OBJECT COLUMN.
ENDFORM.
Repeat above procedure for all sheets you want to add
FORM FILL_SHEET1
TABLES ITAB1 STRUCTURE ITAB1
USING V_NO V_SHEET.
ROW = 1.
PERFORM FILL_CELL USING ROW 1 'Column1 Name'.
PERFORM FILL_CELL USING ROW 2 'Column2 Name'.
PERFORM FILL_CELL USING ROW 3 'Column3 Name'.
ROW = ROW + 1.
LOOP AT ITAB1.
PERFORM FILL_CELL USING ROW 1 ITAB1-Column1.
PERFORM FILL_CELL USING ROW 2 ITAB1-Column2.
PERFORM FILL_CELL USING ROW 3 ITAB1-Column3.
ROW = ROW + 1.
ENDLOOP.
ENDFORM.
Repeat above procedure for all sheets you want to add
Try this also
TYPE-POOLS: truxs.
DATA: it_raw TYPE truxs_t_text_data.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
Upload Excel file
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw
i_filename = p_file
TABLES
i_tab_converted_data = i_XCEL[]
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.
Thanks®ds,
Sree.
Edited by: Sree on Mar 17, 2008 8:07 AM -
To upload data from excel to internal table
hi
in excel sheet it contains 4 tabs.to upload data from excel to internal table i have used this fm
text_convert_xls_to_sap .but error wil comeing.that error in tables parameter.iternal table does not contain data.ple help me.(v 6.0) ple give me one example with codingHello,
Take a look on this: [ABAP - Upload data from Excel to Sap using OO|https://wiki.sdn.sap.com/wiki/x/xOw].
Regards. -
Short dump - No more storage space available for extending an internal tabl
Hi All,
I have requirement in which my program generates a text file on my presentation server. Here my problem is, this requirement can not be executed in back ground, it should be done in foreground only. When I execute in foreground, if the data records comes to some 38 lacks then I am getting a short dump saying 'No more storage space available for extending an internal table'.
And in dump analysis under WHAT HAPPENED section it is giving as
' What happened? |
| You attempted to extend an internal table, but the required space was |
| not available.
Please suggest me, what I have to do in this case?
Thanks in advance.
Thanks,
Sudha MettuHi SuDash,
Allocation of the memory spaces will be done by BASIS people.
you can contact them..
Regards! -
Short dump -No more storage space available for extending an internal table
Hi All,
While running one program I get the short dump saying
"No more storage space available for extending an internal table "IT_862".
Error Analysis given in the dump log :
The internal table "IT_862" could not be enlarged further.
To extend the internal table, 14656 bytes of storage space was
needed, but none was available. At this point, the table "IT_862" has
8528862 entries.
Source Code Extract :
003360 loop at t_line.
003370 clear t_output.
003380
003390 * Increment Line counter
003400 add 1 to l_line_cnt.
003410
003420 t_output-object = t_stxh-tdobject.
003430 t_output-id = t_stxh-tdid.
003440 t_output-spras = t_stxh-tdspras.
003450 t_output-name = t_stxh-tdname.
003460 t_output-line = l_line_cnt.
003470 t_output-format = t_line-tdformat.
003480 t_output-text = t_line-tdline.
*> append toutput. " ERROR POINT*
Can you please suggest what can be the possible solution for the above error.
Thanks in advance.
SanjeetHi
Check out this thread:
Re: No storage space available for extending the internal table
Make sure you are not having an infinite loop.
Hope this helps
Regards,
Jayanthi.K -
Error-No more storage space available for extending an internal table.
Hi Experts,
i am facing problem in a program . its showing runtime error.
Short text
No more storage space available for extending an internal table.
its showing error at
IF sy-subrc NE 0.
REFRESH p_wip_tab.
ELSE.
i_wip_tab-pspnr = i_internal_and_external-pspnr_prps.
LOOP AT p_wip_tab.
MOVE-CORRESPONDING p_wip_tab TO i_wip_tab.
==> APPEND i_wip_tab.
ENDLOOP.
ENDIF.
DATA: l_billable_tab LIKE p_billable_tab OCCURS 0 WITH HEADER LINE,
p_wip_tab LIKE zpswip OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF i_wip_tab OCCURS 0,
pspnr LIKE prps-pspnr.
INCLUDE STRUCTURE zpswip.
DATA: pernr_name LIKE pa0002-vorna,
END OF i_wip_tab.
How i can resolve this problem if anybody knows it then please reply me as soon as possible.
ThanksHello.
Probably you fill the internal table with too much data and it cannot hold that much.
You can either redesign the program so that it processes the data in batches of, say 100000 records, or contact your BASIS team and ask for their help. They could possible assign more memory to the running applications.
Reward if helpful.
Regards,
George -
F.05 : No more storage space is available for extending an internal table
Hi,
While executing F.05(FCV), I am getting ABAP Run time Error which is as below
Short Text: No more storage space is available for extending an internal table
Pls, Give me solution and get more points. It is very urgent
Thanks in advance
Akashcall your sap basis guys
i don't need any points
Maybe you are looking for
-
865Pe Neo2-V: Froze- no display- no beep. mb or cpu problem???
motherboard: 865Pe Neo2-V cpu: intel p4 3.2ghz memory: kingston 512x2 vga: ati radeon 850xt The problem i'm having is this... Everything was working fine and all of a sudden my computer froze. So I tried ctrl+alt+del but didn't work so i pressed the
-
How can i change the color of menu shortcuts like in photoshop?
Hello! In Photoshop there's this nice feature in which you can edit every shortcut (like open file, close, palettes, etc.) of the menus (file, edit, etc.) so they have a color and they're easily recognisable. How can I do the same on other mac progra
-
HI ALL , I am trying to do multi mapping with out using BPM .I will get message from the sender and i need to send that to two different target system. I have defined the mapping in the IR . In ID i have created the configuration scenario and
-
IBooks for Mac - purchase books as gifts
I know in the past it was not possible to purchase books as gifts. I've seen in iBooks for iOS it is now possible to send a book as a gift; it is shown as an option at the bottom of the Featured screen. With iBooks for Macs running Mavericks, can you
-
HOW TO UNLOCK/RESTORE IPHONE 3
i reciently purchased a iphone 3 and it HAS A PASSWORD ON IT. HOW O I UNLOCK OR OVERRIDE PASSWORD SO THAT I CAN RESTORE PHONE?