Requried help in uploading data from a file
Hi Friends,
I have a doubt while uploading data into SAP System. I have 8 fileds in my flat file.
And there are two processes to be run.In one process records 2,3,4 should be updated and in other process 5,6,7,8 should be updated.I am using Call Transaction for this.
Please help me on this.
Regards
ram
Hi Atish,
Thank You for reply.I am Using PA30 in HR.
Here in this i need to update an infotype in two ways Eg: PART1 & PART2.
When PART 1 is processed it should update only FIRST four fields.
And when PART2 it should update only the balance four fields.
I think that you have understood my problem.
Waiting for your suggestion.
Thanks
Ram
Similar Messages
-
hi guru,
I want to upload data from excel file for mm02.. first of all help on the matter of how to upload data from excel...
i hv used the FM ALSM_EXCEL_TO_INTERNAL_TABLE.. but its not working it uploading garbage value ... so tell me how to used it...
help me on this matter.Check below example.
parameters : p_file LIKE rlgrap-filename OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM get_file_name.
PERFORM get_file_to_excel.
*& Form get_file_name
FORM get_file_name.
DATA: lv_name LIKE sy-repid.
lv_name = sy-repid..
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = lv_name
dynpro_number = syst-dynnr
static = 'X'
CHANGING
file_name = p_file.
ENDFORM. " get_file_name
*& Form get_file_to_excel
FORM get_file_to_excel.
DATA: idata LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = '1'
i_begin_row = '2' "Do not require headings
i_end_col = '2'
i_end_row = '60000'
TABLES
intern = idata
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.
STOP.
ENDIF.
* Get first row retrieved
READ TABLE idata INDEX 1.
* Set first row retrieved to current row
DATA: gd_currentrow TYPE i.
gd_currentrow = idata-row.
LOOP AT idata.
* Reset values for next row
IF idata-row NE gd_currentrow.
APPEND f. CLEAR f.
gd_currentrow = idata-row.
ENDIF.
CASE idata-col.
WHEN '0001'.
f-belnr = idata-value.
ENDCASE.
ENDLOOP.
APPEND f. CLEAR f. -
How to upload data from flat file to datastore object in BI 7.0
Dear friends,
Please tell me
step by step process for upload data from flat file to datastore object in BI 7.0
<removed by moderator>
please help me
Thanks,
D.prabhu
Edited by: Siegfried Szameitat on Aug 17, 2011 11:40 AMCreate transformation on thr data source and keep the DSO as the target and load.
Ravi Thothadri -
Upload data from flat file to OVKK using BDC
Hi All,
I want to upload data from flat file to OVKK tcode using BDC.
OVKK is a maintaince view with a table control.
So please send me code for uploading data to OVKK through BDC.
Thanks & Regards,
Siva.BHi,
Welcome to SDN!!!!!!!!!!
Can you see this example for Table control.
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
Today this is the second post on the same issue and same Tranx.
1st try through SHDB and check the code.
Thanks.
If this helps you reward with points. -
Upload data from excel file to mii without UDS and PCo
Hi Experts,
I am trying to upload data from excel file to mii db without using UDS and PCo. Is there any other ways that we can achieve it.
I am thinking one solution , writing stored procedure. any other solutions?
Thanks in advance,
Eswar.Hi,
Thanks for reply.
I tried to create OLEDB data server which will point to my excel file in D drive.Its created successfully and i tried to query the datasource using sql query, I am not getting any modes in sql query template.
can u provide some steps..how to access this file.
Thanks, Eswar -
Upload data from excel file to Oracle table
Dear All,
I have to upload data from excel file to Oracle table without using third party tools and without converting into CSV file.
Could you tell me please how can i do this using PLSQl or SQL Loader.
Thnaks in Advance..Dear All,
I have to upload data from excel file to
Oracle table without using third party tools and
without converting into CSV file.
Could you tell me please how can i do this
using PLSQl or SQL Loader.
Thnaks in Advance..As billy mentioned using ODBC interface ,the same HS service which is a layer over using traditional ODBC to access non oracle database.Here is link you can hit and trial and come out here if you have any problem.
http://www.oracle-base.com/articles/9i/HSGenericConnectivity9i.php[pre]
Khurram -
While uploading data from local file
Hi,
While uploading data from local file having the header text into interal table using the GUI_UPLOAD function module,there is problem in upload because of header text in file, do we have any option in this FM itself to skip this header text and upload from sdecond line because as per our requirement we can't delete this header text from the file.Hi Manish,
Do you have the problem while uploading? Is it giving any error?
If not, if your uploading is successful into the internal table, then delete the first row, which is header, from the internal table using index eq 1.
Regards,
Chandra Sekhar -
Change Value While Uploading data From Excel File
Dear Expert,
Please guide me is it Possible?, if yes then How?
We have one BDC Uploader there After uploading data from Excel File, i want to check one field like this....
if it_f65data-newbs contains any Alphabet.
then user Should be able to change value on the same time while executing Program in table.
Please tell me how i can change value in running program
Regards'
Shelly MalikHi,
What you can probably do is, perform a consistency check on your data in the internal table and segregate all those rows that have inconsistent data (in your case, the field NEWBS containing albhabets) into another temporary internal table. Display the temporary internal table in an editable ALV grid saying that these data have not been inserted to the database, coz they have inconsistent data in the field NEWBS. Allow the user to edit and then save the data which will consequently refresh the internal table contents. -
Error when uploading data from Flat file
I am uplading data from Flat file.
When I am uploading it gives an error
An error occurred in record 1 during execution of conversion exit CONVERSION_EXIT_CUNIT_INPUT for field UNIT.
Can any one help.
Thanx in Advance.
Regards,
Pradeep.Hi Pradeep,
Refer this link:
CONVERSION_EXIT_CUNIT_INPUT error in flat file load
Re: Error in Flat files upload
Also try this - In the transfer structure check the checkbox fo UNIT and retry the load. Hopefully it should be fine.
Bye
Dinesh -
UPLOADING DATA FROM EXCEL FILE.
Hi All,
i have to upload the data from excel file to an internal table.I am using FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' for that. But the problem is it taking upto 50 characters only from each cell of excel sheet. in each cell i have more than 100 characters.
How to read these type of data?..
Plz help me in this regard.
thank you in advance!!!!
Regards,
RaviHi,
Check my previous post for the same question for referance
Re: Excel to itab
Guess this will help you.
Regards,
Ram. -
Upload data from excel file -URGENT
Hi All,
Advanced thanks to ur reply
How to upload data from excel sheet to itab
what are the functional modules we are using for that
Please help me
i look forward to ur reply
Regards
Raja Sekhar.THi,
TYPE-POOLS: truxs.
DATA: i_text_data TYPE truxs_t_text_data,
v_filename_string TYPE string.
DATA: BEGIN OF itab OCCURS 0,
Name(30),
Phone(15),
Fax(500).
DATA: END OF itab.
PARAMETERS: p_file LIKE rlgrap-filename.
START-OF-SELECTION.
v_filename_string = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = v_filename_string
filetype = 'ASC'
has_field_separator = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
dat_mode = ''
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = i_text_data
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
I_LINE_HEADER =
i_tab_raw_data = i_text_data
i_filename = p_file
TABLES
i_tab_converted_data = itab
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.
I think this code will help u.
With Regards,
Ranganathan -
Uploading data from excel file to a dynamically created internal table
Hi,
I have a requirement where i have to upload data from an excel file into a database table. I would be able to determine the structure of the table only at runtime based on the user input.. so i have created an internal table dynamically.
Could you please tell me if its possible to upload data from an excel file to the dynamically created internal table using any function modules?
I thought of doing this by declaring a generic internal table of one field and then uploading the *.csv file into it and then splitting it based on "," and then assigning it to the field symbol referencing the internal table.. but my file length exceeds 132 characters and i'm only able to get data of lenght 132 char's in my internal table ( generic one).
Could anyone please show me a way around this.
Thanks in advance,
HarshaSure, check this out.
report zrich_0002.
type-pools: slis.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: it_fldcat type lvc_t_fcat,
wa_it_fldcat type lvc_s_fcat.
type-pools : abap.
data: new_table type ref to data,
new_line type ref to data.
data: iflat type table of string.
data: xflat type string.
data: irec type table of string with header line.
data: tabix type sy-tabix.
data: file type string.
selection-screen begin of block b1 with frame title text .
parameters: p_file type rlgrap-filename default 'c:Test.csv'.
parameters: p_flds type i.
selection-screen end of block b1.
start-of-selection.
* Add X number of fields to the dynamic itab cataelog
do p_flds times.
clear wa_it_fldcat.
wa_it_fldcat-fieldname = sy-index.
wa_it_fldcat-datatype = 'C'.
wa_it_fldcat-inttype = 'C'.
wa_it_fldcat-intlen = 10.
append wa_it_fldcat to it_fldcat .
enddo.
* Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = it_fldcat
importing
ep_table = new_table.
assign new_table->* to <dyn_table>.
* Create dynamic work area and assign to FS
create data new_line like line of <dyn_table>.
assign new_line->* to <dyn_wa>.
file = p_file.
call method cl_gui_frontend_services=>gui_upload
exporting
filename = file
changing
data_tab = iflat
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
others = 17.
loop at iflat into xflat.
clear irec. refresh irec.
split xflat at ',' into table irec.
loop at irec.
tabix = sy-tabix.
assign component tabix of structure <dyn_wa> to <dyn_field>.
<dyn_field> = irec.
endloop.
append <dyn_wa> to <dyn_table>.
endloop.
* Write out data from table.
loop at <dyn_table> into <dyn_wa>.
do.
assign component sy-index of structure <dyn_wa> to <dyn_field>.
if sy-subrc <> 0.
exit.
endif.
if sy-index = 1.
write:/ <dyn_field>.
else.
write: <dyn_field>.
endif.
enddo.
endloop.
Regards,
Rich Heilman -
Is there a way to upload data from a flat file and check of existing records and perform updates and inserts respectively on a table using MERGE as available in Oracle 9i version.
I don't want to use SQLLOADER utility for this purpose as I will be having existing data which might give exceptions for primary key, etc.
Is it possible to do this using UTL_FILE utility and use of MERGE statement.
Any inputs will be highly appreciated.
ThanksThis is what i am doing as of today :-
This process reads the flat file and uploads and updates data into 2 different tables.
create or replace procedure EPS.GET_DATA(filelocation varchar2,filename varchar2)
IS
--declare
my_file utl_file.file_type;
-- variables used to parse the input data line ...
line char(45);
l_EPCI_CID_ID char(25);
l_cid number :=0;
l_EPCI_BILLING_ACCOUNT_ID char(15);
l_account number :=0;
l_EPCI_BILLING_COMPANY_CD char(2);
l_EPCI_SOURCE_SYSTEM_CD char(3);
-- timing variables ...
l_start_time date;
l_end_time date;
l_difference number;
l_run_id varchar2(40) := '';
counter number := 0;
mrow number :=0;
oldCustomerCid number :=0 ;
rowsFound number :=0;
rowsFoundForCustomer number :=0;
rowsFound2 number :=0;
rowsFound3 number :=0;
mUpdate number :=0;
cUpdate number :=0;
cInsert number :=0;
cSkipped number :=0 ;
mrowupd number :=0;
rowsSkipped number :=0;
begin
-- Open the input file ....
begin
dbms_output.put_line('opening file :'||filename||' from location :'||filelocation);
my_file := utl_file.fopen(filelocation,filename,'r');
exception
when utl_file.invalid_filehandle then
dbms_output.put_line('invalid_filehandle');
raise_application_error(-20100,'file error');
when no_data_found then
dbms_output.put_line('no data found exception');
raise_application_error(-20100,'file error');
when others then
null;
end;
-- Read data and insert it into the table ...
dbms_output.put_line('program started: now = '|| to_char(sysdate,'HH:MI:SS'));
l_start_time := sysdate;
begin
dbms_output.put_line('looping cursor to search existing groups');
loop
utl_file.get_line(my_file,line);
l_EPCI_CID_ID := substr(line,1,25);
l_cid := to_number(l_EPCI_CID_ID);
l_EPCI_BILLING_ACCOUNT_ID := substr(line,26,15);
l_account :=to_number(l_EPCI_BILLING_ACCOUNT_ID);
l_EPCI_BILLING_COMPANY_CD := substr(line,41,2);
l_EPCI_SOURCE_SYSTEM_CD := substr(line,43,3);
-- Populating Mad.Mad_Customer_Profile table with EPS CID, If CID exists then updating MCP_LAST_INVOICE_LOAD_DT with system date
if(oldCustomerCid <> l_cid) then
Select count(*) into rowsFoundForCustomer from MAD.MAD_CUSTOMER_PROFILE WHERE MCP_CID_ID = l_cid ;
if rowsFoundForCustomer=0 then
Insert into MAD.MAD_CUSTOMER_PROFILE values(l_cid,sysdate,sysdate,'EBILL');
cInsert := cInsert+1;
else
Update MAD.MAD_CUSTOMER_PROFILE set MCP_LAST_INVOICE_LOAD_DT=SYSDATE,
MCP_UPDATE_DATE=SYSDATE, MCP_USER_ID='EBILL' where MCP_CID_ID=l_cid;
cUpdate := cUpdate+1;
end if;
else
cSkipped := cSkipped+1;
end if ;
oldCustomerCid := l_cid;
-- Populating EPS.EPS_CBS_INVOICE_CUSTOMER table with the flat file data.
select count(*) into rowsFound
from EPS.EPS_CBS_INVOICE_CUSTOMER
WHERE EPCI_CID_ID=l_cid and
to_number(EPCI_BILLING_ACCOUNT_ID)=l_account
AND rtrim(EPCI_BILLING_COMPANY_CD)=rtrim(l_EPCI_BILLING_COMPANY_CD)
AND rtrim(EPCI_SOURCE_SYSTEM_CD)=rtrim(l_EPCI_SOURCE_SYSTEM_CD)
and rtrim(EPCI_ACTIVE_IND)='Y';
if rowsFound=0 then
Declare
Cursor c1 is
select * from EPS.EPS_CBS_INVOICE_CUSTOMER
WHERE
to_number(EPCI_BILLING_ACCOUNT_ID)=l_account
AND rtrim(EPCI_BILLING_COMPANY_CD)=rtrim(l_EPCI_BILLING_COMPANY_CD)
AND rtrim(EPCI_SOURCE_SYSTEM_CD)=rtrim(l_EPCI_SOURCE_SYSTEM_CD)
and EPCI_ACTIVE_IND='Y';
myRec eps.eps_cbs_invoice_customer%ROWTYPE ;
Begin
if not c1%isopen then
open c1 ;
end if;
loop
fetch c1 into myRec;
exit When c1%notfound;
UPDATE EPS.EPS_CBS_INVOICE_CUSTOMER
SET EPCI_ACTIVE_IND='N',EPCI_UPDATE_DT=SYSDATE,EPCI_UPDATE_USER_ID='EBILL'
WHERE
--EPCI_CID_ID=L_CID and
TO_NUMBER(EPCI_BILLING_ACCOUNT_ID)=l_account
AND rtrim(EPCI_BILLING_COMPANY_CD)=rtrim(l_EPCI_BILLING_COMPANY_CD)
AND rtrim(EPCI_SOURCE_SYSTEM_CD)=rtrim(l_EPCI_SOURCE_SYSTEM_CD);
mrowupd := mrowupd+1;
end loop;
close c1;
insert into EPS.EPS_CBS_INVOICE_CUSTOMER(EPCI_CID_ID,EPCI_BILLING_ACCOUNT_ID,
EPCI_BILLING_COMPANY_CD,EPCI_SOURCE_SYSTEM_CD,EPCI_ACTIVE_IND,EPCI_UPDATE_DT,EPCI_UPDATE_USER_ID)
Values(l_cid,l_EPCI_BILLING_ACCOUNT_ID,l_EPCI_BILLING_COMPANY_CD,l_EPCI_SOURCE_SYSTEM_CD,'Y',SYSDATE,'EBILL');
mrow := mrow+1;
end ;
Else
rowsSkipped:=rowsSkipped+1;
END IF;
end loop;
Exception
when no_data_found then
utl_file.fclose(my_file);
dbms_output.put_line('Number of lines parsed =');
when value_error then
dbms_output.put_line('value error');
raise_application_error(-20100,'file error');
when utl_file.invalid_path then
dbms_output.put_line('invalid path');
raise_application_error(-20100,'file error');
when utl_file.invalid_mode then
dbms_output.put_line('invalid_mode');
raise_application_error(-20100,'file error');
when utl_file.invalid_filehandle then
dbms_output.put_line('invalid_filehandle');
raise_application_error(-20100,'file error');
when utl_file.invalid_operation then
dbms_output.put_line('invalid_operation');
raise_application_error(-20100,'file error');
when utl_file.read_error then
dbms_output.put_line('read_error');
raise_application_error(-20100,'file error');
when utl_file.write_error then
dbms_output.put_line('write_error');
raise_application_error(-20100,'file error');
when utl_file.internal_error then
dbms_output.put_line('internal_error');
raise_application_error(-20100,'file error');
WHEN DUP_VAL_ON_INDEX THEN
dbms_output.put_line('DUPLICATE RECORD FOUND WHILE INSERTING RECORD');
when others then
dbms_output.put_line('un-handled');
raise_application_error(-20100,'file error');
null;
end;
-- Now commit and close the file ...
COMMIT;
dbms_output.put_line('program finished: now = '||
to_char(sysdate,'HH:MI:SS'));
dbms_output.put_line('Rows Inserted into EPS table :'|| mrow);
dbms_output.put_line('Rows Updates in EPS table:'|| mrowupd);
dbms_output.put_line('Rows Skipped :'|| rowsSkipped);
dbms_output.put_line('Rows Inserted into Customer table :'|| cInsert);
dbms_output.put_line('Rows Updates in Customer table:'|| cUpdate);
dbms_output.put_line('Duplicate CID''s Skipped :'|| cSkipped);
l_end_time := sysdate;
l_difference := l_end_time - l_start_time;
utl_file.fclose(my_file);
end; -
Upload data from excel file to "Fast Data Entry" in FB60
Hi,
I have a requirement from users, they want to load data of G/L accounts items in FB60 using "Fast Data Entry" from an excel file.
I did some research and found out that the framework to transfer clipboard data into an SAP table(http://www.synactive.com/examples/example0016.html) seems to be the suitable solution.
However, I still cannot make it work.
Do you have any suggestion for my case ? How can I load data from an excel file to the transaction FB60?
Thanks in advance,
HungDear Hung,
You can upload data through LSMW (Batch Input).
But you need to convert your excel sheet into CSV format or txt format.
Please take help of your ABAP team if required.
This will accommodate your requirement.
Regards
Saurabh -
Upload data from flat file into internal table
Hi friends,
I want to upload the data from a flat file into internal table , but the problem is that all the columns in that flat file are seperated by "|" character instead of tabs.
Plz help me out.........HEllo,
DO like this.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = LV_FILENAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X' " Check here
* HEADER_LENGTH = '1'
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
DATA_TAB = IT_COJRNL
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
VAsanth
Maybe you are looking for
-
How to add an additional fields in VAR Service Desk?
Dear ALL, I work in VAR company and we use SAP VAR Service Desk. Our Customer has his own HP Service Desk system. When they creates ticket in SAP VAR Service Desk they are allways creates internal Service Desk number in their HP Service Desk. Now the
-
How can I get the virtual connection from connection pool?
Hi, All, I create the connection pool to Database, then call connPool->createConnetion("scoot","tiger") , it creates a new physical connection to database, not from connection pool. I check the busy number of connection in connection pool, it always
-
Duplicate pricing condition records in Billing
Helllo evry one, I have an issue with an Invoice document, Where the pricing condition records is appearing twice both at the item level and header level. It is appearing as Condition Type Condition base value Condition value ZABC
-
Strange sounds/not starting up
I was using my computer just fine earlier tonight. The battery got low and the computer powered down. Now, I cannot get the computer to start back up. It makes sounds like something is running smoothly. I've tried starting it up several times and don
-
Faulty Installation and Unique Issues
First of all, I'll tell you I'm in the middle of Nowhere, China and no one here knows what Apple, Mac, or FireWire means in Chinese or English. It's just not known here. My MacBook suffered a loss of power today during an upgrade to Leopard that I ha