Copying the data into internal table without internal table
Hello experts.
i have two internal tables . itab1 without headerline and itab2 with headerline. itab1 has 10 fields and itab2 has 2 fields.
BEGIN OF itab,
lifnr LIKE lfa1-lifnr,
ktokk LIKE lfa1-ktokk,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
pstlz LIKE lfa1-pstlz,
ort01 LIKE lfa1-ort01,
land1 LIKE lfa1-land1,
j_1ipanno LIKE j_1imovend-panno,
end of itab.
DATA: itab1 TYPE STANDARD TABLE OF itab.
data: begin of itab2 occurs 0,
lifnr like j_1imovend-lifnr,
j_1ipanno like j_1imovend-j_1ipanno,
end of itab2.
now i want to move the data from itab2-j_1ipanno into itab1-j_1ipanno.
Both the tables ie itab1 and itab2 has lifnr data in them .
so in itab2 j_1ipanno has pan number for the lifnr( vendors) so i need to populate this pannumbers in itab1 also by comparing
the lifnrs in two tables. where ever the lifnr of itab2 is equal to itab1-lifnr then this pannumber should be placed there.
so pls tell me how to do that. lifnr in both the tables are the same.
thanks for all the replies.
Hi Shiva,
Try this one..
data: begin of itab.
lifnr LIKE lfa1-lifnr,
ktokk LIKE lfa1-ktokk,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
pstlz LIKE lfa1-pstlz,
ort01 LIKE lfa1-ort01,
land1 LIKE lfa1-land1,
j_1ipanno LIKE j_1imovend-panno,
end of itab.
data: wa like line of itab1.
data: begin of itab occurs 0,
lifnr like j_1imovend-lifnr,
j_1ipanno like j_1imovend-j_1ipanno,
end of itab2.
data: wa1 like line of itab2.
loop at itab1 into wa.
itab2-lifnr = wa-lifnr.
itab2-j_1ipanno = wa-j_1ipanno
append itab2.
endloop.
Reward points if helpful.
Kiran Kumar.G.A
Have a Nice Day..
Similar Messages
-
How to delete the data from SAP R/3 DB table from BW
Hi,
I am facing an issue... I have populated the data into custom r/3 DB table by running a user exit.I am getting the data and loading(Full Load) it in BW ODS. But my problem is when i rerun the user exit it is giving me a short dump saying "SAPSQL_ARRAY_INSERT_DUPREC". when i delete the enteries of DB table it is working fine. But this fine in development.but i production i cannot do this.So i want to delete the DB table enteries by an ABAP program and call this ABAP program using Process chain when my ODS data LOAD is successful. How to go About this.
P.S: I want only to delete the DB table enteries not the DB table.....
Thanks and Regards
Sairam phaniSairam,
why don't you just add the code for deletion of records into that user exit, so it would first delete entries and then write new ones.
Alternatively, you could use a Process Chain to trigger an event in R/3, and by that event a scheduled job would run, deleting entries from that table.
As I don't know details of the solution you're implementing, that's all I can think of now.
Cheers,
/RB -
INSERTING DATA INTO A SQL SERVER 2005 TABLE, WHICH HAS A IDENTITY COLUMN
Hi All,
I have to insert the data into a SQL SERVER 2005 Database table.
I am able to insert the data into a normal SQL Server table.
When I am trying to insert the data into a SQL Server table, which has a identity column (i.e. auto increment column in Oracle) I am getting error saying that can't insert value explicitly when IDENTITY_INSERT is set to OFF.
Had anybody tried this??
There are some SRs on this issue, Oracle agreed that it is a bug. I am wondering if there is any workaround from any one of you (refer Insert in MS-SQL database table with IDENTITY COLUMN
Thanks
V KumarEven I had raised a SR on this in October 2008. But didn't get any solution for a long time, finally I had removed the identity column from the table. I can't to that now :).
I am using 10.1.3.3.0 and MS SQL SERVER 2005, They said it is working for MS SQL SERVER TABLE, if the identity column is not a primary key and asked me to refer to note 744735.1.
I had followed that note, but still it is not working for me.
But my requirement is it should work for a MS SQL SERVER 2005 table, which has identity column as primary key.
Thanks
V Kumar -
How to copy the Data From Oracle Table To SAP Table
Hi Friends,
We need to copy the data from Oracle Database Table to SAP Table. The data should be updated simultaneously in both tables . Should I write a program that contains the native sql statement like EXEC SQL PERFORMING WRITE,....
I appreciate any suggestions regarding this.
Regards
CSM ReddyHi,
since you posted this question in the DB2 forum I assume that you are using a DB2 database for your SAP system.
To access a table from a legacy ORACLE database you may use the DBSL multiconnect feature. I.e. you open a secondary connecction in the SAP system to your ORALE database. You can then ready the data from the ORACLE database into an ABAP internal table and insert it afterwards into the DB2 table on the main connection.
Another way to access an ORACLE table from a DB2 database is to use the DB2 federated database feature. This requires a little bit more DB2 skill. With this feature you can make the ORACLE table visible within the DB2 database. To copy data you can then simply use a "INSERT ... SELECT" statement.
Regards
Frank -
I am looking for a way to enter multiple dates into a field without the form becoming too long.
This will be used by an old school bookeeper who needs the form to fit on one page.
Any ideas?Hi,
If you don't need the field to provide a date picker, verify it's a date, or don't need to sort the dates in the table, you can just use a text area field, and have your form filler enter the dates comma separated. Otherwise you'd have to add multiple fields. However, you can lessen the space each field takes up veritically, by using the "Labels Left" option (in the toolbar).
Thanks,
Todd -
Hi,
Iam new to the xml,
can u please anyone help me how to write procedure to load the data into a table using xml as input parameter to a procedure and xml file is as shown below which is input to me.
<?xml version="1.0"?>
<DiseaseCodes>
<Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
</DiseaseCodes>.
Regards,
vikram.here is the your XML parse in 11g :
select *
from xmltable('//Entity' passing xmltype
'<?xml version="1.0"?>
<DiseaseCodes>
<Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
</DiseaseCodes>
') columns
"dcode" varchar2(4000) path '/Entity/dcode',
"ddesc" varchar2(4000) path '/Entity/ddesc',
"reauthflag" varchar2(4000) path '/Entity/reauthflag'
dcode ddesc reauthflag
0 (I87)Other disorders of veins - postphlebitic syndrome 0
0 (J04)Acute laryngitis and tracheitis 0
0 (J17*)Pneumonia in other diseases - whooping cough 0
SQL>
Using this parser you can create procedure as
SQL> create or replace procedure myXMLParse(x clob) as
2 begin
3 insert into MyXmlTable
4 select *
5 from xmltable('//Entity' passing xmltype(x) columns "dcode"
6 varchar2(4000) path '/Entity/dcode',
7 "ddesc" varchar2(4000) path '/Entity/ddesc',
8 "reauthflag" varchar2(4000) path '/Entity/reauthflag');
9 commit;
10 end;
11
12 /
Procedure created
SQL>
SQL>
SQL> exec myXMLParse('<?xml version="1.0"?><DiseaseCodes><Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity></DiseaseCodes>');
PL/SQL procedure successfully completed
SQL> select * from MYXMLTABLE;
dcode ddesc reauthflag
0 (I87)Other disorders of veins - postphlebitic syndrome 0
0 (J04)Acute laryngitis and tracheitis 0
0 (J17*)Pneumonia in other diseases - whooping cough 0
SQL>
SQL>
Ramin Hashimzade -
Insert the data into two tables at a time.
Hi ,
i have these two tables
create table [dbo].[test1](
[test1_id] [int] identity(1,1) primary key,
[test2_id] [int] not null
create table [dbo].[test2](
[test2_id] [int] identity(1,1) primary key,
[test1_id] [int] not null
alter table [dbo].[test1]
add constraint [fk_test1_test2_id] foreign key([test2_id])
references [dbo].[test2] ([test2_id])
alter table [dbo].[test2] add constraint [fk_test2_test2_id] foreign key([test1_id])
references [dbo].[test1] ([test1_id])
I want to insert the data into two tables in one insert statement. How can i do this using T-SQL ?
Thanks in advance.You can INSERT into both tables within one Transaction but not in one statement. By the way, you would need to alter your dbo.Test1 table to allow null for first INSERT test2_id column
See sample code below:
CREATE TABLE #test1(test1_ID INT IDENTITY(1,1),test2_id INT NULL)
CREATE TABLE #test2(test2_ID INT IDENTITY(1,1),test1_ID INT)
DECLARE @Test1dentity INT
DECLARE @Test2dentity INT
BEGIN TRAN
-- Insert NULL as test2_ID value is unknown
INSERT INTO #test1(test2_ID)
SELECT NULL;
-- get inserted identity value
SET @Test1dentity = SCOPE_IDENTITY();
INSERT INTO #test2(test1_ID)
SELECT @Test1dentity;
-- get inserted identity value
SET @Test2dentity = SCOPE_IDENTITY();
-- Update test1 table
UPDATE #test1
SET test2_ID = @Test2dentity
WHERE test1_ID = @Test1dentity;
COMMIT
SELECT * FROM #test1;
SELECT * FROM #test2;
-- Drop temp tables
IF OBJECT_ID('tempdb..#test1') IS NOT NULL
BEGIN
DROP TABLE #test1
END
IF OBJECT_ID('tempdb..#test2') IS NOT NULL
BEGIN
DROP TABLE #test2
END
web: www.ronnierahman.com -
Copy the data from first line while dynamically adding a new line in table
Hi,
1. There is a table
2. An add button adds a new line to the table using 'AddInstance'
3. A record is entered in the first line
4. When the add button is clicked it adds a new line and along with it copies the data entered in the first line
My question is how to copy the data from the first line and show it in the new line added. This is required so that user can use most of the common values in the first line.
Thanks,
NikhilYou can use the following Java Script in the Click event of the button.
// Get the number of rows in the table
var nrows = xfa.resolveNodes("page.table.DATA[*]").length;
// Add a new instance(row) to the table
page.table.addInstance.instanceManager(1);
xfa.form.recalculate(1);
// Copy the values from the first line to the newly created row
page.table.DATA\[ nrows \].field1.rawValue = page.table.DATA\[ 0 \].field1.rawValue;
..........field2
..........field3
Thanks,
Chandra Indukuri -
Custom PL/SQL API that inserts the data into a custom interface table.
We are developing a custom Web ADI integrator for importing suppliers into Oracle.
The Web ADI interface is a custom PL/SQL API that inserts the data into a custom interface table. We have defined the content, uploader and an importer. The importer is again a custom PL/SQL API that will process the records inserted into the custom table and updates the STATUS column of the custom interface table. We want to show the status column back on the spreadsheet.
Defined the 'Document Row' import rule and added the rows that would identify the unique record.
Errored row import rule, we are using a SELECT * from custom_table where status<>'Success' and vendor_name=$param$.vendor_name
The source of this parameter is import.vendor_name
We have also defined an Error lookup.
After the above setup is completed, we invoke the create document and click on Oracle->Upload.
The records are getting imported, but the importer program is failing with An error has occurred while running an API import. The ERRORED_ROWS step 20003:ER_500141, parameter number 1 must contain the value BIND in attribute 1.'The same issue.
Need help.
Also checked bne.log, no additional information.
<bne:document xmlns:bne="http://www.oracle.com/bne">
<bne:message bne:type="DATA" bne:text="BNE_VALID_ROW_COUNT" bne:value="11" />
<bne:message bne:type="DATA" bne:text="BNE_INVALID_ROW_COUNT" bne:value="0" />
<bne:message bne:type="ERROR" bne:text="An error has occurred while running an API import"
bne:cause="The ERRORED_ROWS step 20003:ER_500165, parameter number 1 must contain the value BIND in attribute 1."
bne:action="" bne:source="BneAPIImporter" >
<bne:context bne:collection="collection_1" />
</bne:message><bne:message bne:type="STATUS"
bne:text="No rows uploaded" bne:value="" >
<bne:context bne:collection="collection_1" /></bne:message>
<bne:message bne:type="STATUS" bne:text="0 rows were invalid" bne:value="" >
<bne:context bne:collection="collection_1" /></bne:message></bne:document> -
How can i open a DOC or TXT file and insert the data into table?
How can i open a DOC or TXT file and insert the data into table?
I have a doc file . the doc include some columns and some rows.(for example 'ID,Name,Date,...').
I'd like open DOC file and I'd like insert them into the table with same columns.
Thanks.Use the SQL*Loader utility or the UTL_FILE package.
-
see above
A couple of options:
# When pasting the data into Excel use Paste Special, and choose either Text or Unicode Text.
# Use the Dafizilla Table2Clipboard extension to copy the data - https://addons.mozilla.org/firefox/addon/dafizilla-table2clipboard -
I want to use the SQL Toolkit of NI and SQL Server as my databasis on a server. Do I need to install a client in each computer I want to handle the data into SQL tables or I need only a ODBC driver?
You only need the ODBC driver on each computer. If you are distributing the SQL Toolkit app as an executable and do not install the whole toolkit on each computer, you'll need the SQL Toolkit support files. This is about a dozen files. You can get the list at http://digital.ni.com/public.nsf/websearch/b814be005f9da9258625658700550c75?OpenDocument.
-
Can anyone confirm the date used for pushing the data into AR interface table? Is it abse don Actual ship date or scheduled ship date? We are facing a scenario where trx date is lower than the actual ship to which logically sounds incorrect.
Appreciate any quick response around this.Hi,
Transaction date will be your autoinvoice master program submission level date (If you haven't setup any logic.
Please check the program level default date, if user enter old date ststem will pick the same.
Customer is trying to set the value of the profile OM:Set receivables transaction date as current date for non-shippable lines at the responsiblity level. System does not set the transaction date to current date in ra_interface_lines_all.
CAUSE
Customer has used the functionality in R11i. But after the upgrade to R12, the system functions differently than R11i.
SOLUTION
1.Ensure that there are no scheduled workflow background process run.
2.Set the profile "OM: Set Receivables Transaction Date as Current Date for Non-Shippable Lines" at Responsibility level only as Yes.
3.Now switch the responsibility to which the profile is set.
4.Create order for Non-Shippable Lines and progress it to invoicing.
5.Ensure that the 'workflow background process' concurrent program is run in the same responsibility and this line is considered in it.
6.Now check if the 'SHIP_DATE_ACTUAL' is populated to ra_interface_lines_all -
How to maintain the data into database table
Hi,
experts,
how to maintain the data into database tableThere are several ways to maintain data in the database
1. Use table maintanance generator . You can create this using SE11 and data can be edited through SM30.
2. Loginto SE11 with the specified table and check the ATTRIBUTES tab. There you can set some parameters for maintaining the database. When you set Maintain database, you edit the data thorugh SE11 it self
3. Through Se16 as well.
4. A small abap program can do the above task as well.
Thanks,
Raj
Edited by: Rajanya Kolavennu on Feb 5, 2008 8:33 PM -
Displaying the data into the UI tables
Hello Experts,
I am new to web dynpro ABAP and I have created the tree with two UI tables(table1 and table2) by using web dynpro ABAP and want to display the data into both the UI tables at the same time just by one click on the item node of the tree.
presently I am able to display the data as follows
1. when I click on the item node the relevant data for the item appears into table1, but not into table2
2. when I select the row of table1 then the revlevant data for item appears into table2.
like this i can able to dispaly the data into both the table.
My Question.
how to display the data at the same time into both the tables table1 and table2 just by one click
on the item node.
please help
Thanks in advance
Regards,
fahad.Hi,
I am able to invoke the method before the taskflow.
But it is giving me the exception as *"UI Component is Null"* .
The value of the table which I am using to display the data is coming as Null.
Please let me know what could be the issue and how to solve this.
Maybe you are looking for
-
"Text on a path" and "paths" rasterised when printed from a PDF on an iGen
I have just obtained from the printer the first proof of my book (printed on an iGen) and I'd like to find out where one of the problems lie. I'll ask the printer his opinion before second proof, but I don't like to annoy him unnecessarily. One of th
-
Problem with Messages Version 8.0
I am running Mavericks 10.9.3 and Messages doesn't allow me to video chat with someone on a Mac. Instead, it automatically defaults to their iPhone. The "invite to video chat" is grayed out and the start new chat is also grayed out. Has everything
-
File Upload Performance using IE from Windows to Unix via HTTPS
Hi, Is there any performance issue uploading a file using IE from Windows client to UNIX server via HTTPS? Before that, we were using HTTP protocol and everything run smooth Once we change to HTTPS, we might hit the "HTTP 500 Internal server error" E
-
Remote WSUS integration with SCCM 2012
Hi, We are currently having WSUS already in place for Patching , but not used at all its just installed. can remote WSUS be integrated with SCCM 2012 server which is on different server ? what is the best practice ? is it to have WSUS on same server
-
I have two (or more sometimes), there is a field called POC_type and then the POC_name, the POC_Name is different, but the rest of the records are the same, I only want to pull back the first record so I onlist one POC_Type, Name, ... Below is the co