Uploading mass data to configuration table
Hi,
We need to upload more than 3000 records to config table related to travel mangement.
Is there any way to uplod data as LSMW and BDC may not work?
Any help in this regard is highly appreciated.
Thanks in advance,
Lalith
I believe you can do through BDC.
Similar Messages
-
Upload excel data into Internal table
Hi,
I'm trying to upload excel data into internal table, well the excel file layout will be different on each run of the report.
Excel file will have 60 columns and 500 record limit. I can upload the excel data using 'ALSM_EXCEL_TO_INTERNAL_TABLE' and 'KCD_EXCEL_OLE_TO_INT_CONVERT' but the output table is generates 60 lines for each record i.e.., 60 * 500 = 30,000 which could cause performance.
I try with the FM 'TEXT_CONVERT_XLS_TO_SAP', but this will only work if the file structure is static. It didn't work for dynamic file layout. Even GUI_UPLOAD doesn't work to upload excel file, it will work if I convert the file to Tab delimited file.
Please advise if you know any alternate procedure to upload excel data into internal table.
Thanks,
Kumar.Moderator message - Cross post locked
Rob -
Mass upload of data into Custom table
Hello all,
I made search in SDN and could not find the best solution to my problem and hence posting .
What is the best way for Mass upload of data into Custom database table ?
I think LSMW would not be a viable option as it would take longer time .
Locking of the table also needs to be taken care.
PLease let me know if you have a alternative to this and the best way to do this .
Comradely,
K.SibiHi Sibi,
See Lock objects are required when we enter the data through screen level, or multiple users should not enter the data at same time.
Create one Lock object in SE11, It automatically creates FM.
DEQUEUE_EYTEST2 Release lock on object EYTEST2
ENQUEUE_EYTEST2 Request lock for object EYTEST2
Call these FM in your program.
EX: Refer this links
1 http://help.sap.com/saphelp_nw70/helpdata/en/41/7af4c8a79e11d1950f0000e82de14a/content.htm
2 http://wiki.sdn.sap.com/wiki/display/Snippets/lockingandunlockingofthe+tables
Rgds
Aeda -
Problem to upload the data into internal table record length more than 6000
Hi all
I stuck with this problem from past 3 days. I have to upload the data from excel sheet. iam making it tab delimited and trying to upload from gui_upload. but in the structure of file, we have, one field of 4000 characters, and other fields of 255 characters.
how can i upload this into internal table . From excel sheet or from tab delimeted or any other format? or any special function module is there? while iam doing this its truncating the datat 255 characters and not uploading the other fields also...
can any one of you help me out. ASAP
thnks in advancefrom one of the forum iam just pasting code which it is used in lsmw, try the same logic in ur code hope it can work.
you have to create multiple lines with do...enddo loop., like this:
(assuming excel_long_text-text is 924 characters long, 7 lines X 132 char)
__GLOBAL_DATA__
data: offset type i,
text_132(132) type c.
__BEGIN_OF_RECORD__ Before Using Conversion Rules
Rule : Default Settings Modified
Code: /sapdmc/ltxtl = init_/sapdmc/ltxtl.
CLEAR offset.
DO 7 TIMES.
text_132 = excel_long_text-text+offset(132).
offset = offset + 132.
__END_OF_RECORD__ After Using Conversion Rules
Rule : Default Settings Modified
Code: transfer_record.
ENDDO.
also check this
COMMIT_TEXT
To load long text into SAP
READ_TEXT
To load long text into SAP -
Upload excel data in a table maintenance view
Hi,
I have a requirement to add a button in the application toolbar of the table maintenance screen of a custom table. This button should upload the excel sheet data into the maintenance screen online.
I have created the button in the table maintenance generator. Also, uploaded the data into the internal table from the excel sheet.
The problem is I am unable to populate the data from the internal table to the maintenance screen online.
Any pointers in this regards will be appreciated.
Thanks,
Best regards,
AjithHi,
I think you have to use BDC call transaction (SM30) and use that table control to upload the data. Try and see..
Cheers,
Phani. -
Uploading excel data to database table
Dear Experts,
I have an Excel file which was downloaded from SQL database, now I need to export this data into my 'ztable', for this first I created an internal table of ztable structure and tried to upload into this table through ''TEXT_CONVERT_XLS_TO_SAP".
But I was unable to get data into the internal table(incompatible type), so now I created an internal table of character type fileds now I able to get data to this internal table, but to put this internal table data to actual database table it gives error, here the actual problem is the fields of internal table are getting concated with blank spaces(observed through debug), I unable to condense these blanks also, (I have created an Excel of my own and put data into it and uploaded that data there is no problem working fine but this problem occurs only for the excel downloaded from SQL db)
The problem occurs for quantity and currency fields(I tried through standard FMs also to convert data types ), Could plz suggest something..........
Thank you
Regards
SrinivasHi,
To upload excel sheet into database table, define a types which is of same as table fields.
and try it with the function module TEXT_CONVERT_XLS_TO_SAP
Here is a sample code:
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR ='X'
i_tab_raw_data = fs_truxs( TYPE of truxs_t_text_data.)
i_filename = '<FILE-PATH>'
tables
i_tab_converted_data = <Internal Table>
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.
LOOP AT <internal-table> INTO field string.
INSERT <DATABASE- TABLE> FROM <field string>.
ENDLOOP.
Hope this solves the issue.
Regards,
Rajani -
To upload a data into SAP Table with the help of RFC function in BODS
Hi,
Please provide me step-by-step solution to upload data into any SAP table with the help of RFC function in Data Services.
I have created RFC function that upload data into SAP table. RFC Function contains one table that has same structure as my database table.
In the data services how can i filled the table of RFC function, i am using this function in query transform of data services but it gives me error.
I am also follow link http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsDataServicesTipsand+Tricks
but it did not help me.
Thanks,
AbhishekHi Abhishek,
Did you import the function module in the SAP datastore first? When you open the SAP datastore, the function should be listed in the 'functions' section. If not, import it. Make sure your function is remote executable.
Once the function is there, you can use it in a transformation. In 'Schema Out' right-click on 'Query' (top level) and choose 'New Function Call'. You can then select a datastore and a function in the datastore. The wizard will show you which output parameters are available. I believe you have to add at least one and can select as many as you like.
After confirming your selection the function and the output parameters appear in Schema Out. You can then right-click on the function and choose 'Modify function call'. A popup will appear where you can specify the input parameters.
I hope this helps.
Jan. -
Upload excel data into Internal table dynamically
Hi all,
I have a excel file, in this file there are fixed columns but I don't know, at run time, how many rows will come up.
Now I want to fetch the data from file to internal table, I used
GUI_UPLOAD and ALSM_EXCEL_TO_INTERNAL_TABLE.
But it is not working for me.
Please suggest how to get it.
Thanks
Sanket sethiHI,
go through this code:
Upload data from Excel to internal table.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_pfile
i_begin_col = 1
i_begin_row = 2
i_end_col = 45
i_end_row = 8
TABLES
intern = it_excel
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. " IF sy-subrc 0
*Populate data to internal tables and structructures
SORT it_excel BY row col.
LOOP AT it_excel INTO ls_excel.
CASE ls_excel-col.
WHEN 1.
ls_data-doc_type = ls_excel-value.
WHEN 2.
ls_data-rec_no = ls_excel-value.
WHEN 3.
ls_data-doc_ver = ls_excel-value.
endcase.
endloop.
Hope it will help you
Thanks and Regards
Rahul Sharma -
Bdc upload file data into internal table problem with gui_upload fm
Hello experts,
my coding is like this ..
data : begin of itab occurs 0 .
field1 like mara-matnr,
field2......
etc,
end of itab.
data: file1 type string.
parameter :file like rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
static = 'X'
mask = space
field_name = 'FILE'
CHANGING
file_name = file.
START-OF-SELECTION.
FILE1 = FILE . "HERE I AM PASSING INTO STRING
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = FILE1
FILETYPE = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = itab. " here the data is not populating from the file , it is giving the error like speified table not found.
HERE i am getting the message like "specified table name not recgonised" . the data is not populating into the itab from the file.
file structure is same as the internal table.
I stored the file as .txt( ie in notepad).
my file is like this..
10000 200 323 sunndarrr.......
i had a problem with this bdc , i am getting like "specified table name not recgonised" in the fm gui_upload while debugging.
when i am using the ws_upload it is working fine.
please guide me where i have done the mistake.
thank you so much for all the replies.Hi,
Have a look on the following code.
TABLES: kna1.
DATA: BEGIN OF itab1 OCCURS 0,
str(255),
END OF itab1.
DATA: itab2 TYPE kna1 OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'D:\ABAP EVE\ffile1.txt'
filetype = 'ASC'
TABLES
data_tab = itab1
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
no_authority = 10
OTHERS = 11.
IF sy-subrc <> 0.
WRITE:/ 'sorry'.
ELSE.
LOOP AT itab1.
SPLIT itab1-str AT ',' INTO itab2-kunnr itab2-name1.
APPEND itab2.
ENDLOOP.
IF sy-subrc = 0.
LOOP AT itab2.
WRITE:/ itab2-kunnr,itab2-name1.
INSERT INTO kna1 VALUES itab2.
ENDLOOP.
IF sy-subrc = 0.
WRITE:/ 'inserted'.
ELSE.
WRITE:/ 'not inserted'.
ENDIF.
ELSE.
WRITE:/ 'fail'.
ENDIF.
ENDIF.
Flat file:
10001,Sadney
10003,Yogesh
20005,Madan
1.U need to define internal table with one field of max size
2.upload the flat file data into that internal table
3.split that internal table data into another internal table(having fields)
<REMOVED BY MODERATOR>
thanks,
Chandu
Edited by: Alvaro Tejada Galindo on Apr 30, 2008 12:17 PM -
Upload Excel data to internal table
Hello,
Any idea how to import a HUGE Excel .xlsx file (> 150K rows) into an internal table?
I have explored the following FMs but it seems like none of them can handle more than 65K rows.
ALSM_EXCEL_TO_INTERNAL_TABLE
KCD_EXCEL_OLE_TO_INT_CONVERT
TEXT_CONVERT_XLS_TO_SAP
GUI_UPLOAD
Thanks in advance.
RegardsHi,
Try this below code
Note
you should change the program based on your number of fields of excel sheet. if you have five fields
then you can adjust structure to 5 fields
* Here based on excell sheet fileds we can create number of fields
TYPES:
BEGIN OF ty_upload,
F1 TYPE c length 15,
F2 TYPE c length 15,
F3 TYPE c length 15,
END OF ty_upload.
DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH DEFAULT KEY.
DATA wa_upload TYPE ty_upload.
DATA itab TYPE STANDARD TABLE OF alsmex_tabline WITH DEFAULT KEY.
FIELD-SYMBOLS: <wa> type alsmex_tabline.
* create variable to hold the file name of presentation server
PARAMETERS: p_file TYPE rlgrap-filename.
* At selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
START-OF-SELECTION.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
**filename = filename
filename = p_file
i_begin_col = 1
i_begin_row = 1
i_end_col = 3
i_end_row = 65535
TABLES
intern = itab.
LOOP AT itab ASSIGNING <wa>.
CASE <wa>-col.
WHEN '0001'.
wa_upload-F1 = <wa>-value.
WRITE:<wa>-value.
WHEN '0002'.
wa_upload-F2 = <wa>-value.
WRITE:<wa>-value.
WHEN '0003'.
wa_upload-F3 = <wa>-value.
WRITE:<wa>-value.
ENDCASE.
APPEND wa_upload TO it_upload.
CLEAR wa_upload.
ENDLOOP.
or
and also try the function module : TEXT_CONVERT_XLS_TO_SAP -
Uploading mass data and z-fields through CRMXIF_IBASE_SAVE
Hi,
We are using the function module CRMXIF_IBASE_SAVE to migrate legacy data.
We have enhanced the installed base and component object using EEWB.
Can some1 pls advice how can we populate these z-fields (created using EEWB) from the flat files through the FM CRMXIF_IBASE_SAVE; since we are not able to locate a particular structure for this purpose.
In case there is no structure available; what is the best way to upload these in order to maintain the performance (the time taken to upload). The number of records being uploaded is significantly large (in high lacs).
Warm regards,
DP.No response hence deleting!
-
BAPI to upload master data in multiple tables
Dear all,
Is there any BAPI to update the multiple database tables at a time? I want to update the client data into MARA, A108, KNOP and KNOH tables.
Is there any other procedure to do it? Pleae give me some suggestions to do it.
Thank You In advance..!
Regards,
PraveenFor custom defined field use EXTENSIIONIN table in Tables section of BAPI. Below is the description of that table. Check the long text (green button after short text) available to learn more about it.
Short Text
Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
Description
You use this structure to transfer the material's customer-defined fields. For information on transferring these fields, see the function module documentation.
I doubt if there is any BAPI for T023T. In that case you need to use BDC -
Load Huge data into oracle table
Hi,
I am using oracle 11g Express Edition, I have a file of .csv forma, Which has a data of size 500MB which needs to be uploaded into oracle table.
Please suggest which would be the best method to upload the data into table. Data is employee ticket history which is of huge data.
How to do the mass upload of data into oracle table need experts suggestion on this requirement.
Thanks
SudhirSudhir_Meru wrote:
Hi,
I am using oracle 11g Express Edition, I have a file of .csv forma, Which has a data of size 500MB which needs to be uploaded into oracle table.
Please suggest which would be the best method to upload the data into table. Data is employee ticket history which is of huge data.
How to do the mass upload of data into oracle table need experts suggestion on this requirement.
Thanks
SudhirOne method is to use SQL Loader (sqlldr)
Another method is to define an external table in Oracle which is allowing you to view your big file as a table in database.
You may want to have a look at this guide: Choosing the Right Export/Import Utility and this Managing External Tables.
Regards.
Al
Edited by: Alberto Faenza on Nov 6, 2012 10:24 AM -
Help for "insert data to variable tables"
hi, guys.
I want to make a tool to upload mass-data then insert the data to tables of SAP for integrative test.
for example, to input the object tablename "AAAA" from screen, the program willl find the information of this table then input the data to the "AAAA" tables.
But i have no idea how to define the internal table to suit various tables ( by define dynamic table? or any other ways) ,could you kindly give me some advice?
thanks a lot in advance.
Message was edited by:
huijuan zhaohi zhao,
welcome to sdn,
for your requirement u can use bdc to upload file to internal table then u can update these internal table fileds to sap tables.
or
use <b>gui_upload</b> function module to upload data to internal table then u can use just <b>insert</b> keyword to update sap tables.
see this sample code to update the database table <b>edpar</b>,
report zsd_edpar_update no standard page heading.
*&Purpose:
*& program will be used to update EDAPR table on a daily basis.
*& This update will be based on Customer Sold To / Ship To partner
*& functions assignment. Ship To customer(s) will be linked to
*& the appropriate Sold To customer using the ?Acct at Cust?
*& number as a reference. Then, Ship To customer(s) will be
*& set up withthe appropriate partner function with the Sold
*& To customer.it updated the DB tabel and gives the information
*& of customer level visibility t account receivable.
*define database tables...
tables: edpar,
knvv,
knvp.
*define types...
types: begin of t_tab_edpar,
mandt type mandt,
kunnr type kunnr,
parvw type parvw,
expnr type edi_expnr,
inpnr type edi_inpnr.
types: end of t_tab_edpar.
types: begin of t_tab_knvv,
kunnr type kunnr,
vkorg type vkorg,
vtweg type vtweg,
spart type spart,
eikto type eikto.
types: end of t_tab_knvv.
types: begin of t_tab_knvp,
kunnr type kunnr,
vkorg type vkorg,
vtweg type vtweg,
spart type spart,
parvw type parvw,
kunn2 type kunn2.
types: end of t_tab_knvp.
type-pools: slis.
*define data statments...
data: g_tab_edpar type standard table of t_tab_edpar,
g_wa_edpar like line of g_tab_edpar.
data: g_tab_edpar1 type standard table of t_tab_edpar,
g_wa_edpar1 like line of g_tab_edpar1.
data: g_tab_edpar2 type standard table of t_tab_edpar,
g_wa_edpar2 like line of g_tab_edpar2.
data: g_tab_knvv type standard table of t_tab_knvv,
g_wa_knvv like line of g_tab_knvv.
data: g_tab_knvp type standard table of t_tab_knvp,
g_wa_knvp like line of g_tab_knvp.
data: repid like sy-repid,
l_tab_fieldcat type slis_t_fieldcat_alv,
l_tab_fieldcat1 type slis_t_fieldcat_alv,
l_tab_fieldcat2 type slis_t_fieldcat_alv,
layout type slis_layout_alv,
events type slis_t_event,
events1 type slis_t_event,
wa_events like line of events,
l_pos type i.
*selection screen...
selection-screen begin of block b1 with frame title text-001.
select-options: s_cust for knvv-kunnr obligatory,
s_sorg for knvv-vkorg,
s_dcha for knvv-vtweg,
s_divi for knvv-spart,
s_parf for knvp-parvw.
selection-screen end of block b1.
*start-of-selection...
perform get_data.
*to update the db table edpar...
perform update_edpar.
*display alv block...
perform alv_block.
*& Form get_data
text
--> p1 text
<-- p2 text
form get_data .
select kunnr
vkorg
vtweg
spart
parvw
kunn2
from knvp
into table g_tab_knvp
where
kunnr in s_cust
and
vkorg in s_sorg
and
vtweg in s_dcha
and
spart in s_divi
and
parvw in s_parf.
loop at g_tab_knvp into g_wa_knvp.
move: g_wa_knvp-kunnr to g_wa_edpar-kunnr,
g_wa_knvp-kunn2 to g_wa_edpar-inpnr,
g_wa_knvp-parvw to g_wa_edpar-parvw.
append g_wa_edpar to g_tab_edpar.
endloop.
if not g_tab_knvp[] is initial.
select kunnr
vkorg
vtweg
spart
eikto
from knvv
into table g_tab_knvv
for all entries in g_tab_knvp
where
kunnr eq g_tab_knvp-kunnr
and
vkorg eq g_tab_knvp-vkorg
and
vtweg eq g_tab_knvp-vtweg
and
spart eq g_tab_knvp-spart.
loop at g_tab_knvp into g_wa_knvp .
sort g_tab_knvv by kunnr.
clear g_wa_knvv-eikto.
read table g_tab_knvv into g_wa_knvv with key kunnr = g_wa_knvp-kunnr.
if sy-subrc eq 0.
move: g_wa_knvv-eikto to g_wa_edpar-expnr.
modify g_tab_edpar from g_wa_edpar transporting expnr where kunnr eq g_wa_knvp-kunnr.
endif.
endloop.
endif.
sort g_tab_edpar by kunnr.
delete adjacent duplicates from g_tab_edpar comparing kunnr parvw.
endform. " get_data
*& Form update_edpar
text
--> p1 text
<-- p2 text
form update_edpar .
delete from edpar." FROM TABLE g_tab_delete.
call function 'DB_COMMIT'.
loop at g_tab_edpar into g_wa_edpar.
insert into edpar values g_wa_edpar.
if sy-subrc eq 0.
move-corresponding g_wa_edpar to g_wa_edpar1.
append g_wa_edpar1 to g_tab_edpar1.
else.
move-corresponding g_wa_edpar to g_wa_edpar2.
append g_wa_edpar2 to g_tab_edpar2.
endif.
endloop.
reward points if helpful,
regards,
seshu. -
How to convert the flat file data into sap tables . ?
how to upload flat file data into sap table . before upload mapping is also there in some filds . any one can give me some steps how to upload and mapping . ?
Hi
See the sample code
REPORT zmmupload.
Internal Table for Upload Data
DATA: i_mara like MARA occurs 0 with header line
PARAMETERS: p_file LIKE ibipparms-path. " Filename
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Upload the File into internal Table
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_mara
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Upload the Data from Internal Table
MODIFY MARA from TABLE i_MARA.
Regards
Anji.
Maybe you are looking for
-
Monitor quality for LR4?
Has anyone described the effects of monitor quality on using LR4 to edit color photos? What effect is this likely to have on quality? Thank you, Hersch Pilloff [email protected]
-
I want to know the PO's created on a particular day with time. I went on to the SE16 & entered the table MKPF @ the inital screen and in layout I gave the time of entry. When I enter the doc. No. & date the system doesn't gave me the Time of entry.
-
Specifying an element attribute containing a colon not possible
Hello everybody Might be a stupid question... I'm trying to define a datatype in XI (3.0 SP16) integration repository. This datatype has one root element and some child elements. The root element requires some attributes, one named "xmlns:xsi". Unfor
-
Splitting Dimensions on Attributes for reporting
Does anyone have experience or a good idea on how to most efficiently allow splitting a dimension on attributes for reporting custom cells. We are working in 11G. First let me explain We have a dimension Brand that has a level based hierarchy. Total
-
Minor Alret at prime infrastructure 2.0 about mismatch configuration.
Dears, kindly i have minor Alert at prime infrastructure 2.0 (Audit done at '2013-nov-28,05:00:00 CET'..config difference found between NCS and Controller), what this error and please feed me back with steps to solve this problem. Thanks,