How to insert data from itab to another itab ?
Hi.
Now, I have one PR which generates a lot of PO.
Each PR number has one or more PO number.
ITAB_EBAN has field BANFN, EBELN.
ITAB_EKPO had fields EBELN, EBELP, BANFN.
How do i insert the ekpo-ebelp into the itab_eban from itab_ekpo for each eban-banfn? One line of eban-banfn record maybe have a lot of ekpo-ebeln and ekpo-ebelp. So what should i do in order to make sure the record is displayed correctly? By duplicate the row of data inside itab_eban, so that each eban-banfn can have many ekpo-ebeln or ekpo-ebelp?
Thanks in advance.
Hi ,
Do the following...............
ITAB_EBAN has field BANFN, EBELN.
ITAB_EKPO had fields EBELN, EBELP, BANFN.
loop at ITAB_EKPO.
ITAB_EBAN-BANFN = ITAB_EKPO-BANFN .
ITAB_EBAN-EBELN = ITAB_EKPO-EBELN .
Append ITAB_EBAN.
endloop.
delete duplicates
Sort ITAB_EBAN by banfn descending ebeln descending.
Delete adjacent duplicates from itab_eban comparing banfn ebeln.
We will now have unique values for banfn/ebeln in itab_eban
Regards
Byju
Similar Messages
-
*Urgent*How to insert data from MS SQL to the table that create at the adobe form?
Hi,
I'm using Adobe life cycle designer 8 to do my interactive form. I would like to ask how to insert data from MS SQL to the table that i have created in my adobe interactive form?
I really need the information ASAP as i need to hand in my project by next week... i really appreciate any one who reply this post.
ThanksTou need to do a couple of things
1. On the Essbase server, set up an odbc system connection to your MySQL database
2. In the load rule , go to the file menu and select open SQL data source and in the data source put in your SQL statement . A couple of hints. Where it says Select, don't put in the word select and where it say from don't put in from. The system adds them for you. The easiest way ti enter a SQL statement is to do it all in the select area So if your SQL would normanlly say select * from mytable just enter the code as * from mytable in the select area
The click ol/retrieve and enter in your connection info. Itshould bring data back into the load rule. Save the load rule and use it -
How to insert data from access to sql server ?
How to insert data from access to sql server ?
Please help me
thanksphamtrungkien wrote:
How to insert data from access to sql server by JAVA?The first four words of my last post:
masijade wrote:
JDBC with two connectionsGet a resultset from the jdbc-odbc bridge access connection, cycle through it and add batch insert commands to the jdbc connection to sql server. Give it a try and if the code has an error, then post your code ans ask a question.
The real question, though, is why you think it absolutely necessary to use Java for this. -
How to insert data from *.dmp file to oracle 11g using Oracle SQL Develope
hi
i backup my database using PL/SQL developer and made *.dmp file
how to insert data from *.dmp file to oracle 11g using Oracle SQL Developer 2.1.1.64
and how to make *.dmp file from sql*plus ?
thanks in advancePl/Sql developer has a config window, there you choose the exec to do the import/export.
Find it and his home version, it may be exp or expdp, the home version is the version of the client where the exp executable is.
Then use the same version of imp or impdp to execute the import, you do not need to use Oracle SQL Developer 2.1.1.64. If you want to use it, you must have the same version in the oracle home that exp/imp of sql developer use. -
How to insert data from JTable to mysql Table....
hello everybody
i need help about how to insert data from JTable to mysql table... i know about how to create Table model...facing problem about how to insert data from JTable to mysql table....any helping link or code ... ill be thankfulll....for giving me solution...table1.getValueAt(table1.getSelectedRow(),0)you are getting the value of a selected row... or if you want you can just use a loop..
for(.....){
table1.getValueAt(x,y);
}I think you know INSERT STATEMENT.. here on it just string concat
sample e.g. (This not insert)
"delete from accrule " +
"where ruleid= " + tblRA.getValueAt(tblRA.getSelectedRow(),0)+
" and accountname='"+tblRA.getValueAt(tblRA.getSelectedRow(),1)+"'" -
How to insert data from different internal table into a data base table
hi all,
I want to insert a particular field in an internal table to a field in a data base table.Note that the fields in the internal table and database table are not of the same name since i need to insert data from different internal tables.can some one tell me how to do this?
in short i want to do something like the foll:
INSERT INTO ZMIS_CODES-CODE VALUE '1'.
*INSERT INTO ZMIS_CODES-COL1 VALUE DATA_MTD-AUFNR .(zmis_codes is the db table and data_mtd is the int.table)REPORT ZINSERT.
tables kna1.
data: itab LIKE KNA1.
data lv_kUNAG LIKE KNA1-KUNNR.
lv_kuNAG = '0000010223'.
ITAB-kuNNR = lv_kuNAG.
ITAB-name1 = 'XYZ'.
INSERT INTO KNA1 VALUES ITAB.
IF SY-SUBRC = 0.
WRITE:/ 'SUCCESS'.
ELSE.
WRITE:/ 'FAILED'.
ENDIF.
Here lv_kunag is ref to kna1 kunnr passed in different name
In internal table .
Try and let me know if this logic dint work. -
How to insert date from preparedstatement
hi,
I have a problem here trying to insert date into my table. but the problem is the date is supposed to be grabbed from the user input which is in textfield. However, I did a short cut and made the list of data into and array of String. so when i tried to insert the data into the table it gives me this error:
ORA-01861: literal does not match format string
so, I would like to ask if there is a solution to insert date into the table with the use of prepared statement..
for (int i=0; i<str_val.length; i++){
ps.setString(i+1, str_val);
ps.executeUpdate();
con.commit();
this is how i insert data using prepared statement. but the date is causing problem. Helps please....
Thanks in advanceI have a problem here trying to insert date into my
table. but the problem is the date is supposed to be
grabbed from the user input which is in textfield.So you have a string which is supposed to contain a date (or timestamp.)
Presumably you verified it.
You have two choices...
1. Create your SQL for your prepared statement using the oracle function todate(). You will need to use the exact format string, as defined by the function, that corresponds to the text field you have.
2. Use SimpleDateFormat to parse the string into a date. Use another SimpleDateFormat to parse the date into the format expected by oracle. -
How to download data from itab to Excel sheet..
Hi sap Experts,
I develop one report to download data from itab to excel sheet.I done it perfectly.
My doubt is in the excel sheet i need to put headings. and also at last i need to display total no.of Records.
Please help me how to do this.
Thanks in Advance....
Thanks and Regards
Siri.......................u can either use GUI_DOWNLOAD or the method below...just give a try
DATA:WK_string TYPE STRING.
DATA:Wk_EXT(4) TYPE C value '.xls'.
DATA:WK_path TYPE STRING.
DATA:wk_file_name type string.
data:wk_records type sy-tfill.
wk_file_name = 'Downloaded'.
describe table itab lines wk_records.
LOOP AT ITAB.
at first.
**Provide path
concatenate 'C:\' wk_file_name Wk_EXT into wk_path.
open dataset WK_path for output in text mode encoding default.
if sy-subrc 0.
write:'ERROR while opening dataset !!!!!!'.
EXIT.
endif.
CONDENSE wk_path.
**Heading Part
concatenate 'Part No' 'Description'
into wk_string separated by cl_abap_char_utilities=>horizontal_tab.
endat.
**Data ITAB
CONCATENATE ITAB-MATNR itab-maktx into wk_string
separated by cl_abap_char_utilities=>horizontal_tab.
transfer wk_string to WK_path.
at last.
clear wk_string.
Concatenate 'Records Passed:' wk_string into wk_string.
transfer wk_string to WK_path.
close dataset WK_path.
endat.
endloop. -
How to Insert data from notepad to Table
Hi,
I have one table with nodata.i need to insert data into table.but i have records in one notepad.if i enter manually
like using insert statement it will take more time.
Any one know insert data from notepad to table or i need sql script that will use for all the records.Here im using sqldeveloper.Hi dude,
We can use below 2 types.
1) Sql loader
2) utl file
SQL*Loader utility?
One can load data into an Oracle database by using the sqlldr (sqlload on some platforms) utility. Invoke the utility without arguments to get a list of available parameters. Look at the following example:
sqlldr username@server/password control=loader.ctl
sqlldr username/password@server control=loader.ctlThis sample control file (loader.ctl) will load an external data file containing delimited data:
load data
infile 'c:\data\mydata.csv'
into table emp
fields terminated by "," optionally enclosed by '"'
( empno, empname, sal, deptno )
{code}
The mydata.csv file may look like this:
{code}
10001,"Scott Tiger", 1000, 40
10002,"Frank Naude", 500, 20
{code}
Optionally, you can work with tabulation delimited files by using one of the following syntaxes:
{code}
fields terminated by "\t"
fields terminated by X'09'
{code}
Additionally, if your file was in Unicode, you could make the following addition.
{code}
load data
CHARACTERSET UTF16
infile 'c:\data\mydata.csv'
into table emp
fields terminated by "," optionally enclosed by '"'
( empno, empname, sal, deptno )Another Sample control file with in-line data formatted as fix length records. The trick is to specify "*" as the name of the data file, and use BEGINDATA to start the data section in the control file:
load data
infile *
replace
into table departments
( dept position (02:05) char(4),
deptname position (08:27) char(20)
begindata
COSC COMPUTER SCIENCE
ENGL ENGLISH LITERATURE
MATH MATHEMATICS
POLY POLITICAL SCIENCEPlease refer the below link.. it will useful for you.
http://psoug.org/reference/sqlloader.html
http://docs.oracle.com/cd/B10500_01/server.920/a96652/ch05.htm
Regards,
N.Senthil. -
How to Insert data from Table A to Table B
Hi,
I have to insert data from Table A into Table B.
Table A is having 100 records and table B is having 10000 records.
Condition is if data in Table A is not in table B then I have to insert into Table B or else I have to skip that.
Can anyone help me with sample code.
Thanks in advance and points are awarded for usefull answers.
Thanks,
Kumar.Hello Kumar
Assuming that tables A and B have the same structure you can use the same logic as change documents are prepared. Assuming both of your itabs are of structure struc_a. Then define the following type:
TYPES: BEGIN OF ty_s_itab_di.
INCLUDE TYPE struc_a.
TYPES: CHIND TYPE bu_chind.
TYPES: END OF ty_s_itab_di.
TYPES: ty_t_itab_di TYPE STANDARD TABLE OF ty_s_itab_di
WITH DEFAULT KEY.
DATA: gt_itab_old TYPE ty_t_itab_di,
gt_itab_new TYPE ty_t_itab_di.
Fill itabs gt_Itab_old with the corresponding data of itab1 and gt_itab_new with the corresponding data of itab2.
Very important: sort you itabs either by all key fields or by all fields.
Call function <b>CHANGEDOCUMENT_PREPARE_TABLES</b> with the following parameters:
- CHECK_INDICATOR = ' '
- TABLE_NEW = gt_Itab_new
- TABLE_OLD = gt_itab_old
The function module will remove identical lines from both itabs. New entries in gt_itab_New will have CHIND = 'I' and deleted entries in gt_itab_old will have CHIND = 'D'. Modified entries are indicated by CHIND = 'U'.
Read the documentation of the function module and play around with it. You will see that this a quite easy yet powerful approach for comparing itabs.
Regards
Uwe -
How to insert Data from a function on server A into a table on Server B.
Hi,
I have a function which is like this
DECLARE @oldmax bigint, @newmax bigint
SELECT @oldmax = max(exportTimestamp) FROM EXPORT_TIMESTAMPS
IF @oldmax IS NULL
SET @oldmax = 0
SELECT * FROM ServerA.TableA.fnExportTrafficTS(@oldmax) ORDER BY storeID, TrafDate
SELECT @newmax = max(timestamp) FROM TRAFFIC t
IF @newmax > @oldmax
INSERT INTO EXPORT_TIMESTAMPS
VALUES(@newmax, GETDATE())
And now i need to insert the data coming out of this function into ServerB Table B
And the column names and everything coming out of the function is the same columns in Table B.So, no need to worry there.
I have never worked with inserting data from function through linked server.
Can someone please help me with this?
Thanks,
SujithWell, first of all, your table structure doesn't match the structure of returned table by your table-valued function.
This is what table valued function returns:
[storeID] varchar(32) default('noRefID'),
[TrafDate] [datetime] default(NULL),
[QtyTraffic] [float] default(0)
And this is what your table structure is:
[tUTL_JobLogging_Key] [int] NOT NULL,
[StoreId] [varchar](10) NULL,
[TrafDate] [datetime] NULL,
[Visits] [numeric](8, 2) NULL
Apart from different size for the StoreID and using float vs. numeric and different name for the last column, there is one extra column in your table.
So, this is the first problem you need to correct.
Also, please post how exactly you're calling your procedure? E.g. the procedure has 2 parameters, but the values of them are not used as you're calculating them in the code. So, I assume they should not be parameters for the procedure.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles -
How to insert data from site into DB?
Hi
Does anyone know how to insert data into a database from a
website?
I have created a Registration form for users to register to
my web site. With this I would like the data they have entered to
be stored in a MySQL database. I have created the a form and used
the record insertion form wizard.
When they have registered, I need to be able to check their
username every time they log in.
If anyone could help, it would be greatly appreciated,
thanks Lou.LoobieLouLou wrote:
> When I inserted a form, I enetered a name and the method
was POST, but it also needed an action.
> How do I write in java script that it needs to be
inserted into the database?
You can't do it with JavaScript. You need to use a
server-side language
like ASP, ASP.NET, ColdFusion, or PHP. Dreamweaver automates
a lot of
the process for you, but you need to choose your server model
first.
It sounds as though you are completely new to this. First ask
your
hosting company whether it supports a server-side language,
and if so,
which one. Then open Dreamweaver help (F1) and read the
section titled
"Preparing to Build Dynamic Sites".
Working with server-side languages and databases isn't
difficult, but
it's not something you can pick up in five minutes or be
shown how to do
in a couple of forum posts.
If you can't make up your mind which server-side language to
use,
ASP.NET is the most difficult of the four I mentioned. ASP is
popular,
but is no longer actively developed, so will eventually die
out
(although it will take many years to do so). ColdFusion and
PHP are
relatively easy to learn. I prefer PHP, but all of them do
basically the
same thing. However, you must choose one; they cannot be
mixed.
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
How to insert data from one server to another server?
Dear frnds
i have written the script in server ABC and the database XYZ, so i want to insert the data into the second server Customserver
hw should i insert the data .
Iam already tried for this creating the Linked server and exueting the script and inserting the data into that table but it will working on the current query editor only but
it should not been updated on the Target server database table.
below is the script pls help me out for this...
-- Creating the Linked server instance
sp_addlinkedserver 'sp_helpserver','','SQLNCLI',Null,Null,'Server=ABC001',Null
exec SP_addlinkedsrvlogin 'sp_helpserver','false',Null,'nshy22','#abx123'
--Insert data into the do.children
Truncate table dbo.children
Insert into dbo.Site_Table
select distinct Name, Code,State,
from dbo.children
--Insert data into the master
Truncate table Master
insert into Master
Select Code,Name,country from dbo.masterHello,
The SQL Server forums are over here:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/home
Karl
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
My Blog: Unlock PowerShell
My Book:
Windows PowerShell 2.0 Bible
My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}}) -
How to insert data from APEX form into two tables
Hi,
I'm running APEX 4.1 with Oracle XE 11g, having two tables CERTIFICATES and USER_FILES. Some of the (useless) fields are cut to reduce information:
CREATE TABLE CERTIFICATES
CERT_ID NUMBER NOT NULL ,
CERT_OWNER NUMBER NOT NULL ,
CERT_VENDOR NUMBER NOT NULL ,
CERT_NAME VARCHAR2 (128) ,
CERT_FILE NUMBER NOT NULL ,
) TABLESPACE CP_DATA
LOGGING;
ALTER TABLE CERTIFICATES
ADD CONSTRAINT CERTIFICATES_PK PRIMARY KEY ( CERT_ID ) ;
CREATE TABLE USER_FILES
FILE_ID NUMBER NOT NULL ,
FILENAME VARCHAR2 (128) ,
BLOB_CONTENT BLOB ,
MIMETYPE VARCHAR2 (32) ,
LAST_UPDATE_DATE DATE
) TABLESPACE CP_FILES
LOGGING
LOB ( BLOB_CONTENT ) STORE AS SECUREFILE
TABLESPACE CP_FILES
STORAGE (
PCTINCREASE 0
MINEXTENTS 1
MAXEXTENTS UNLIMITED
FREELISTS 1
BUFFER_POOL DEFAULT
RETENTION
ENABLE STORAGE IN ROW
NOCACHE
ALTER TABLE USER_FILES
ADD CONSTRAINT CERT_FILES_PK PRIMARY KEY ( FILE_ID ) ;
ALTER TABLE CERTIFICATES
ADD CONSTRAINT CERTIFICATES_USER_FILES_FK FOREIGN KEY
CERT_FILE
REFERENCES USER_FILES
FILE_ID
NOT DEFERRABLE
What I'm trying to do is to allow users to fill out all the certificate data and upload a file in an APEX form. Once submitted the file should be uploaded in the USER_FILES table and all the fields along with CERT_ID, which is the foreign key pointing to the file in the USER_FILES table to be populated to the CERTIFICATES table. APEX wizard forms are based on one table and I'm unable to build form on both tables.
That's why I've created a view (V_CERT_FILES) on both tables and using INSTEAD OF trigger to insert/update both tables. I've done this before and updating this kind of views works perfect. Here is where the problem comes, if I'm updating the view all the data is updated correctly, but if I'm inserting into the view all the fields are populated at CERTIFICATES table, but for USER_FILES only the fields FILE_ID and LAST_UPDATE_DATE are populated. The rest three regarding the LOB are missing: BLOB_CONTENT, FILENAME, MIMETYPE. There are no errors when running this from APEX, but If I try to insert into the view from SQLDeveloper, I got this error:
ORA-22816: unsupported feature with RETURNING clause
ORA-06512: at line 1
As far as I know RETURNING clause in not supported in INSTEAD of triggers, although I didn't have any RETURNING clauses in my trigger (body is below).
Now the interesting stuff, after long tracing I found why this is happening:
First, insert is executed and the BLOB along with all its properties are uploaded to wwv_flow_file_objects$.
Then the following insert is executed to populate all the fields except the BLOB and it's properties, rowid is RETURNED, but as we know RETURNING clause is not supported in INSTEAD OF triggers, that's why I got error:
PARSE ERROR #1918608720:len=266 dep=3 uid=48 oct=2 lid=48 tim=1324569863593494 err=22816
INSERT INTO "SVE". "V_CERT_FILES" ( "CERT_ID", "CERT_OWNER", "CERT_VENDOR", "CERT_NAME", "BLOB_CONTENT") VALUES (:B1 ,:B2 ,:B3 ,:B4, ,EMPTY_BLOB()) RETURNING ROWID INTO :O0
CLOSE #1918608720:c=0,e=11,dep=3,type=0,tim=1324569863593909
EXEC #1820672032:c=3000,e=3168,p=0,cr=2,cu=4,mis=0,r=0,dep=2,og=1,plh=0,tim=1324569863593969
ERROR #43:err=22816 tim=1324569863593993
CLOSE #1820672032:c=0,e=43,dep=2,type=1,tim=1324569863594167
Next my trigger gets in action, sequences are generated, CERTIFICATES table is populated and then USER_FILES, but only the FILE_ID and LAST_UPDATE_DATE.
Finally update is fired against my view (V_CERT_FILES), reading data from wwv_flow_files it populates BLOB_CONTENT, MIMETYPE and FILENAME fields at the specific rowid in V_CERT_FILES, the one returned from the insert at the beginning. Last, file is deleted from wwv_flow_files.
I'm using sequences for the primary keys, this is only the body of the INSTEAD OF trigger:
select user_files_seq.nextval into l_file_id from dual;
select certificates_seq.nextval into l_cert_id from dual;
insert into user_files (file_id, filename, blob_content, mimetype, last_update_date) values (l_file_id, :n.filename, :n.blob_content, :n.mimetype, sysdate);
insert into certificates (cert_id, cert_owner, cert_vendor, cert_name, cert_file) values (l_cert_id, :n.cert_owner, :n.cert_vendor, :n.cert_name, l_file_id);
I'm surprised that I wasn't able to find a valuable source of information regarding this problem, only MOS note about running SQLoader against view with CLOB column and INSTEAD OF trigger. The solution would be to ran it against base table, MOS ID 795956.1.
Maybe I'm missing something and that's why I decided to share my problem here. So my question is how do you create this kind of architecture, insert into two tables with a relation between them in APEX ? I read a lot in the Internet, some advices were for creating custom form with APEX API, create a custom ARP, create two ARP or create a PL/SQL procedure for handing the DML?
Thanks in advance.
Regards,
SveThank you however I was wondering if there was an example available which uses EJB and persistence.
-
How to insert data from file into long raw field using utl_file?
I try to insert binary data from a file (under AIX 4.3.3) into a LONG
RAW field (Oracle 8.1.6).
First, I retrieve the data from the file like this:
DECLARE
FileHandle = UTL_FILE.FILE_TYPE;
myVariable LONG RAW;
FileHandle := UTL_FILE.FOPEN ;('prj/oracle/admin/MARTIJN/udump',
'MyFile.ATT', 'R');
UTL_FILE.GET_LINE (FileHandle, myVariable);
UTL_FILE.FCLOSE(FileHandle);
INSERT INTO myTable(DUMMYFIELD) VALUES(myVariable);
Where DUMMYFIELD of table myTable is of type LONG RAW.
The GET_LINE statement crashes on Oracle Error ORA-6502: Numeric of
Value error: hex to raw conversion error.
What do I do wrong?
Do I use the right method to retrieve information from a file and put
it into a long raw field, should I try it another way?
Any help greatly appreciated,
Martijn RutteZarina,
To clarify your problem, you have a script node contaning your Matlab code. Are you then using the standard LV functions to load in your data from a file and pass it into the script node?
Regards
Tristan
Maybe you are looking for
-
Error Updating ITunes onto lap top. No access
-
Company Code and Vendor Account
Hi all, i have a simple question. we defined Vendor numbers as followed: external starting with 1 internal with 3. i.e. below: At time we have one vendor 107701 and a customer attached to it 100653 in 9100 company code. This vendor was an external. A
-
I have recently purchased an ethernet usb adapter for the MBA and after a month it is not working. Says cable unplugged. Now I have tried it with 2 other connections on other computers that are working and still no response. Many reviews or fixes onl
-
Selection option for MaterialGroup
hi all, As per the requirement we need to plan data MaterialGroup wise,Year wise Sales Quantity. When we execute our layout all the MaterialGroup are visible year wise with Sales Quantity. Now our problem is that the user may not plan on all the Mate
-
Problem with Safari Invading my dashboard
Hello everyone I am having an issue with Dashboard which may be caused by Safari One or two seconds after I open Dashboard, a safari window from Facebook's Frontierville pops open and navigates me away from Dashboard into my main screen. Effectively