SAP r/3 insert or update
Hi,
We have a scenario, in which we need to insert or update the data in the SAP r/3 based on the availability of the primary field in the SAP r/3.
For ex, if i have the employee details in SAP r/3 where in for a particular existing employee the salary details might be updated based upon the salary hike or if he is a new employee the details have to be inserted.
For this we have the primary field as the emp no.
How to proceed with this scenario.
Regards,
Kishore
Hi,
U can do with the server proxy create an proxy. Inside the method write ur code in ABAP
1) First check the employee no which u got from file with the employee no which is maintained in the abap table if it exits then update the information if it is not then insert the data in table.
refer the server proxy scenario for ur reference.
first:
ABAP Proxy configuration:
/people/vijaya.kumari2/blog/2006/01/26/how-do-you-activate-abap-proxies
second:
Server Proxy -
/people/siva.maranani/blog/2005/04/03/abap-server-proxies
File to Inbound Proxy:
/people/prateek.shah/blog/2005/06/14/file-to-r3-via-abap-proxy
Debugging Inbound Proxy:
/people/stefan.grube/blog/2006/07/28/xi-debug-your-inbound-abap-proxy-implementation
chirag
Similar Messages
-
Insert or Update data in SAP with Business Objects?
Hi all,
I am new to Business Objects world with my little expertise in Crystal Reports and Xclesius.
Could you please clarify me that is there any solution or technology or Product of Business Objects which not only make impressive dashboards and analyze the data but also can communicate with back end SAP R/3 to save or update data.
We are actually analyzing our Client requirements in which there is a need of Dashboards as well as some custom configurations that needs to be saved somewhere in the SAP system in order to make decisions in future.
Our back end system is SAP BW. One possibility is to use Adobe Flex as a base architecture with BSP and BW but we are more concerned with what BOBJ provides.
Looking forward for your suggestions.
Kind Regards
Umer FarooqGR81 wrote:
I would like to know how I can insert or update data in a Google Spreadsheet from an Oracle Database please?
Thanks,you can't since Oracle knows nothing about spreadsheets; Google or otherwise. -
In jdbc adapter what is the difference between insert and update insert
in jdbc adapter what is the difference between insert and update insert
Edited by: katru vijay on Mar 22, 2010 7:43 AMPlease refer to this Link [Document Formats for the Receiver JDBC Adapter|http://help.sap.com/saphelp_nw04/Helpdata/EN/22/b4d13b633f7748b4d34f3191529946/frameset.htm]
Hope this helps.
Regards,
Chandravadan -
Inserting and Updating records in ORACLE using WebDynpro Java
Hi All
I got connected to oracle backend (using my previous thread), but now i want to insert and update the records
i have created views for insert and update,
Thanks in advance
SushmaHi shusma..
chk this link..
<b><u>Creating Connection</u></b>
package com.sap.xirig;
import javax.naming.*;
import javax.sql.*;
import java.sql.*;
public class DBLookup {
String Conn_Status = "Not Connected";
String Language_Desc = "Empty";
String Language_Cd = "Empty";
Connection conn;
Context ctx;
DataSource ds;
//Constructor for the DBLookup object
public DBLookup {
try {
ctx = new InitialContext();
if (ctx == null) {
throw new Exception("Boom - No Context");
// If JDBC 2.0 connection is used please create the DataSource object as below
// ds = (DataSource) ctx.lookup("jdbc/ORACLEDATASOURCE");
// If JDBC 1.0 connection is used please create the DataSource object as below
// ds = (DataSource) ctx.lookup("jdbc/notx/ORACLEDATASOURCE");
if (ds == null) {
throw new Exception("Boom - No dataSource");
catch (Exception e) {
e.printStackTrace();
public String getLanguageDesc(String v_str) {
Statement stmt = null;
ResultSet rst = null;
try {
if (ds != null) {
conn = ds.getConnection();
Conn_Status = "Could not get connection to
datasource";
if (conn != null) {
Conn_Status = "Got Connection " +
conn.toString();
stmt = conn.createStatement();
rst = stmt.executeQuery("SELECT
LANGUAGE_DESC FROM LANGUAGETRANSLATION WHERE LANGUAGE_CD='" + v_str +
if (rst.next()) {
Language_Desc = rst.getString(1);
conn.close();
catch (Exception e) {
e.printStackTrace();
finally {
if (rst != null) {
try {
rst.close();
catch (Exception e) {
e.printStackTrace();
if (stmt != null) {
try {
stmt.close();
catch (Exception e) {
e.printStackTrace();
if (conn != null) {
try {
conn.close();
catch (Exception e) {
e.printStackTrace();
return Language_Desc;
http://e-docs.bea.com/wls/docs81/oracle/API_joci.html
Hope this will help u..
URs GS -
Connecting to datasource and retrieve, insert and update data in SQL Server
hi,
i am trying to retrieve, insert and update data from SQL Server 2000 and display in JSPDynPage and is for Portal Application. I have already created datasource in visual composer. Is there any sample codes for mi to use it as reference???
Thanks
Regards,
shixuanHi,
See this link
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a09424
Regards,
Senthil kumar K. -
Connecting to datasource and retrieve, insert and update data
hi,
i am doing a JSP page that need to retrieve data and display on textView, insert data and update data. I have already create a datasource in Visual Composer. Does anyone have a sample codes for mi to use it as reference. So that i can connect to the datasource tat i created in Visual composer and retrieve, insert and update data. thanz
Regards,
shixuanHi,
After creating a data source in Visual composer .
you have to create a BI system that Visual Composer can use in
the SAP NetWeaver Portal.
refer this pdf file for further Info
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a09424
Regards,
Beevin -
"reproc: Insert and Update failed on" replicated table
Hello, I've published a new publication item on an Oracle Lite Server (9i and mobile server 5.0.2.10).
After inserting records on the server replicated table (Table1), when I try to sync some devices, I have the following error message on the client PDA "reproc Insert and Update failed on " Table1.
If I empty the server table's records, then the client PDA syncs OK.
Can someone refresh me with the cause of this error ?
Thank's in advance.
Regards,
OlivierHi,
This is my actual requirement.
During the updates i.e update process and delete process, if the filed status is changed to 'O', '0' or ' ' in SAP, then those records in Oracle should be deleted.
if the field status is changed to other than 'O', '0', or ' ' SAP, then those records needs to be updated with the remaining information
How do XI Know that these fields are changed in the SAP table to perform delete ,is some notification required when there is change in SAP Table through proxy ? -
Can we use both INSERT and UPDATE at the same time in JDBC Receiver
Hi All,
I would like to know is it possible to use both INSERT and UPDATE at the same time in one interface because I have a requirement in which I have to perform both the task.
user send the file which contains both new and old record and I need to save those in MS SQL database.
If the record exist then use UPDATE otherwise use INSERT.
I looked on sdn but didn't find any blog which perform both the things at the same time.
Interface Requirement
FILE -
> PI -
> JDBC(INSERT & UPDATE)
I am thinking to use JDBC Lookup but not sure if it good to use for bulk record.
Can somebody please suggest me something or send me the link of any blog or anything to solve this problem.
Thanks,Hi ,
If I have understood properly the scenario properly,you are not performing insert and update together. As you posted
"If the record exist then use UPDATE otherwise use INSERT."
Thus you are performing either an insert or an update which depends on outcome of a search if the records already exist in database or not. Obviously to search the tables you need " select * from ... where ...." query. If your query returns some results you proceed with update since this means there are some old records already in database. If your query returns no rows you proceed with "insert into tablename....." since there are no old records present in database.
Now perhaps the best method to do the searching, taking a decision to insert or update, and finally insert or update operation is to be done by a stored procedure in MS SQL database. A stored procedure is a subroutine available to applications accessing a relational database system. Here the application is PI server. If you need further help on how to write and call stored procedure in MS SQL you can look into these links
http://www.daniweb.com/web-development/databases/ms-sql/threads/146829
http://www.sqlteam.com/article/stored-procedures-parameters-inserts-and-updates
[ This part you can ignore, Since its not sure that you will face this situation
Still you might face some problems while your scenario runs. Lets consider this scenario, after the stored procedure searches the database it found no rows. Thus you proceed with an insert operation. If your database table is being accessed by multiple applications (or users) other than yours then it is very well possible that after the search operation completed with a null result, an insert/update operation has been performed by some other application with the same primary key. Now when you are trying to insert another row with same primary key you get an error message like "duplicate entry not possible for same primary key value". Thus you need to be careful in this respect. MS SQL has a feature called "exclusive locks ". Look into these links for more details on the subject
http://msdn.microsoft.com/en-us/library/aa213039(v=sql.80).aspx
http://www.mssqlcity.com/Articles/Adm/SQL70Locks.htm
http://www.faqs.org/docs/ppbook/r27479.htm
http://msdn.microsoft.com/en-US/library/ms187373.aspx
http://msdn.microsoft.com/en-US/library/ms173763.aspx
http://msdn.microsoft.com/en-us/library/e7z8d5hf(v=vs.80).aspx
http://mssqlserver.wordpress.com/2006/11/08/locks-in-sql/
http://www.mollerus.net/tom/blog/2008/03/using_mssqls_nolock_for_faster_queries.html
There must be other methods to avoid this problem. But the point is you need to be sure that all access to database for insert/update operations are isolated.
regards
Anupam -
How can I use multiple row insert or update into DB in JSP?
Hi all,
pls help for my question.
"How can I use multiple rows insert or update into DB in JSP?"
I mean I will insert or update the multiple records like grid component. All the data I enter will go into the DB.
With thanks,That isn't true. Different SQL databases have
different capabilities and use different syntax, That's true - every database has its own quirks and extensions. No disagreement there. But they all follow ANSI SQL for CRUD operations. Since the OP said they wanted to do INSERTs and UPDATEs in batches, I assumed that ANSI SQL was sufficient.
I'd argue that it's best to use ANSI SQL as much as possible, especially if you want your JDBC code to be portable between databases.
and there are also a lot of different ways of talking to
SQL databases that are possible in JSP, from using
plain old java.sql.* in scriptlets to using the
jstlsql taglib. I've done maintenance on both, and
they are as different as night and day.Right, because you don't maintain JSP and Java classes the same way. No news there. Both java.sql and JSTL sql taglib are both based on SQL and JDBC. Same difference, except that one uses tags and the other doesn't. Both are Java JDBC code in the end.
Well, sure. As long as you only want to update rows
with the same value in column 2. I had the impression
he wanted to update a whole table. If he only meant
update all rows with the same value in a given column
with the same value, that's trivial. All updates do
that. But as far as I know there's know way to update
more than one row where the values are different.I used this as an example to demonstrate that it's possible to UPDATE more than one row at a time. If I have 1,000 rows, and each one is a separate UPDATE statement that's unique from all the others, I guess I'd have to write 1,000 UPDATE statements. It's possible to have them all either succeed or fail as a single unit of work. I'm pointing out transaction, because they weren't coming up in the discussion.
Unless you're using MySQL, for instance. I only have
experience with MySQL and M$ SQL Server, so I don't
know what PostgreSQL, Oracle, Sybase, DB2 and all the
rest are capable of, but I know for sure that MySQL
can insert multiple rows while SQL Server can't (or at
least I've never seen the syntax for doing it if it
does).Right, but this syntax seems to be specific to MySQL The moment you use it, you're locked into MySQL. There are other ways to accomplish the same thing with ANSI SQL.
Don't assume that all SQL databases are the same.
They're not, and it can really screw you up badly if
you assume you can deploy a project you've developed
with one database in an environment where you have to
use a different one. Even different versions of the
same database can have huge differences. I recommend
you get a copy of the O'Reilly book, SQL in a
Nutshell. It covers the most common DBMSes and does a
good job of pointing out the differences.Yes, I understand that.
It's funny that you're telling me not to assume that all SQL databases are the same. You're the one who's proposing that the OP use a MySQL-specific extension.
I haven't looked at the MySQL docs to find out how the syntax you're suggesting works. What if one value set INSERT succeeds and the next one fails? Does MySQL roll back the successful INSERT? Is the unit of work under the JDBC driver's control with autoCommit?
The OP is free to follow your suggestion. I'm pointing out that there are transactions for units of work and ANSI SQL ways to accomplish the same thing. -
How to insert or update multiple values into a records of diff fields
Hai All
I have to insert or update or multiple values into a single records of diff fields from one to another table.
Table1 has 3 fields
Barcode bardate bartime
0011 01-02-10 0815
0022 01-02-10 0820
0011 01-02-10 1130
0022 01-02-10 1145
0011 01-02-10 1230
0022 01-02-10 1235
0011 01-02-10 1645
0022 01-02-10 1650
these are the times that comes in at 0815 and goes break at 1130 and comes in at 1230 and goes home at 1645
from these table i have to insert into another table called table2
and the fields are barcode, date,timein intrin,introut,tiomout
And the output want to like this
barcode timein intrin introut timeout date
0011 0815 1130 1230 1645 01-02-10
0022 0820 1145 1235 1650 01-02-10
If any give some good answer it will be help full..
Thanks & Regards
Srikkanth.MSQL> with table1 as (
2 select '0011' Barcode,'01-02-10' bardate,'0815' bartime from dual union
3 select '0022','01-02-10','0820' from dual union
4 select '0011','01-02-10','1130' from dual union
5 select '0022','01-02-10','1145' from dual union
6 select '0011','01-02-10','1230' from dual union
7 select '0022','01-02-10','1235' from dual union
8 select '0011','01-02-10','1645' from dual union
9 select '0022','01-02-10','1650' from dual
10 )
11 select barcode, bardate,
12 max(decode(rn,1,bartime,null)) timein,
13 max(decode(rn,2,bartime,null)) intrin,
14 max(decode(rn,3,bartime,null)) introut,
15 max(decode(rn,4,bartime,null)) timeout from (
16 select barcode, bardate, bartime,
17 row_number() over (partition by barcode, bardate
18 order by bartime) rn
19 from table1)
20 group by barcode, bardate;
BARC BARDATE TIME INTR INTR TIME
0011 01-02-10 0815 1130 1230 1645
0022 01-02-10 0820 1145 1235 1650Max
http://oracleitalia.wordpress.com -
How do I insert/Delete/Update a row to the DB Table from Business Component Browser
I am using the wizard and created a project containing Business component which contain some table.
When I run the project I could see "Oracle Business Component Browser(local)" and when I select some table from "View Object Member" I get a window displaying all the field of that table and I could browse all the info.
My Problem is when I try to insert a new record/Delete the existing record or update some record it never gets reflected to the DataBase.
When I try to insert a new row I did save and there was a dialog box displayed saying "Transaction ID is 1". But finally It's not reflected in the Database.
Can some one guide me how can I do insert/delete/update operation from Oracle Component Business Browser so that the changes reflect to the Original DataBase.
Thanks in advance
JitendraJitendra,
This may be a problem of caching. If you do an update,insert, or delete, and do not receive an error, then the transaction should indeed be posted.
I assume you are hitting the Save icon after your changes if you are getting a transaction ID. Are you checking for the updates through another session (i.e. SQL*Plus), or do you then requery the View Object in the tester? Do you exit the tester and come back in and not see the changes? -
Help me in creating a Trigger for Insert and Update Options
Hi
Please help me in creating a Trigger .
My requirement is that after insert or update on a Table , i want to fire an event .
I have started this way ,but doesn't know how to fully implement this .
say i have a dept table
CREATE TRIGGER DepartmentTrigger
AFTER INSERT ON Dept
BEGIN
INSERT INTO mytable VALUES("123","Kiran");
END DepartmentTrigger;
Please tell me how can i put the Update option also .
Thanks in advance .Please tell me how can i put the Update option also .Add "Or Update". ;-)
Here are a few suggestions, but you definitely need to refer to the manual page that the previous poster suggested.
CREATE OR REPLACE TRIGGER DepartmentTrigger
AFTER INSERT Or Update ON Dept
BEGIN
INSERT INTO mytable VALUES(:new.Dept,'DEPT ADDED OR CHANGED');
END DepartmentTrigger;
The "Or Replace" means you can replace the trigger while you're developing without having to type in a drop statement every time. Just change and rerun your script, over and over until you get it right.
Adding "Or Update" or "Or Delete" makes the trigger fire for those events too. Note, you may want seperate triggers in different scripts and with different names for each event. You have to decide if your design really does the same thing whether it's an insert or an update.
:new.Dept is how you would refer to the changed vale of the Dept column (:old.Dept is the prior value). I changed the double quotes on the string in the VALUES clause to single quotes.
Andy -
How can you create a simple insert or update trigger
I am trying to create a simple insert or update trigger to timestamp an xml document when I load it into my XML DB repository but I always get an error trying to compile the trigger.
"ORA-25003: cannot change NEW values for this column type in trigger"
Here is my PL/SQL:
CREATE OR REPLACE TRIGGER "PLCSYSADM"."PLCSYSLOG_TIMESTAMP"
BEFORE
INSERT
OR UPDATE ON "PLCSYSADM"."PLCSYSLOG"
FOR EACH ROW BEGIN
:new.sys_nc_rowinfo$ := xmltype('<datestamp>' || SYSDATE || '</datestamp>');
END;
Does anyone have an example that works ?
Thanks in advance
Niels Montananahttp://developer.apple.com/referencelibrary/HardwareDrivers/idxUSB-date.html
-
How to use group function in insert or update
Hai All
How can we use group function in insert or update statement
I am generating an attendance so i have different set of timing for example
0800,1200,1230, 1700 and i need to insert into these data into table with min value to intime and max value to
outtime and othere to inertval time in or out
Pls tell me with some example
For example
For INSERT
insert into T2 (barcode,empcode,intime,attend_date)
values(r2.cardn,r2.enpno,MIN(r2.ptime),r2.pdate);
For UPDATE
update dail_att set outtime= MAX(r2.ptime) where empcode=r2.enpno and barcode=r2.cardn and
attend_date=r2.pdate;
Here instead of where i need to use having so pls tell how to use
Thanks & Regards
Srikkanth.MHai Man
R2 is not a table name its a record
Let me explain clearly
I have to generate daily attendance for lot of employees So i have two table t1 and t2
T1 consist of three column empno,date,time
T2 consist of empno,name,date,intime,outtime,intrin,introut
So now i need to give the T1 Min value Of time to T2 Intime and T1 Max value of Time to T2 Outtime fields so there so many records while i am using
max(time) it gives the max value of all so i seperated by group function so now i have an error in subquery ie it is an single row subquery so i need to use multiple row subquery how i can use multiple row subquery in update statement
Thanks In Advance
Srikkanth.M -
INSERT or UPDATE with multiple rows
Hi there!
I want to ask what I should do in the following case: I have to handle mutliple rows of data to insert OR to update into the database.
The first question is about how to decide whether I should take INSERT or UPDATE. I read here in the forum that I could take a SELECT-statement before, and, if it isn't null, I could update the resultset..if it is null I can make an INSERT-statement.
But now I a have multiple rows to update or to insert which I want to handle as a transaction (with a batch), so I don't want to check each row the way I described above. Does anyone has a hint ?
Thanks a lot in advance.This is not a problem with java but rather a problem
with databases in general. The solution generally
depends on the data that is being operated on.
If there is a primary key involved, and most records
were expected to NOT be in the database, then you
could just insert them in blocks (transaction/batch).
Each block would fail when a primary key duplicate.
Then you can process each block as individual
l statements. The ones that fail are done as
inserts.
The reverse of the above is used if you expect most
records to be in the database. Do updates and the
break out the blocks with failures to locate the
inserts.
Keep in mind that queries for keys probably will be
faster, but that requires that your keys are ordered.
If you keys are ordered then you can get a range from
the initial data. Use that to query the database for
keys between that range (only return the keys.)
Using the returned keys you can decide whether each
h record needs to be an update or insert (presort the
data into each group and batch each group for more
speed.)
If the data is really mixed and the database supports
it then you can write a stored proc (MySQL does not)
which decides whether an insert/update is needed.
Finally if you have large amounts of data, bulk
operations especially inserts are better done with
tools supplied by the database vendor. Instead of
using JDBC to do the insert/updates you write the
output to a file and pass the file to the tool. You
might use JDBC (again with the ordered key query) to
decide which operation to do. Although faster for
large sets this is problematic due to the error
handling that you have to add.
Thanks for this, jschell. I look for your answers, because they're on the money and written well. I learn a lot from them. - MOD
Maybe you are looking for
-
Actually got a display color problem with my new macbook pro - Late 2011 (OSX LION ) so i gave to authorised service center for changing the display . that time as per my instruction technition fully formatted my system . after getting my mac i upgra
-
MIDI Madness - Behringer BCF2000
I'm trying to get a new controller working in FCP 5. I have the Behringer DCF2000. I have read on the this site that several people are using this device with success. The device shows up in Audio MIDI Setup and is set to port 1. I have also set it u
-
Font bug with SMC (Management console)
I have got a bug with the font in Solaris Management Console, and only with it. With Xorg, the font are corrected displayed, but with Xsun, there are horible. I think there a problem with XSun, or with SMC, but I didn't know Xsun. Thanks.
-
Can't figure out why syntax errors are coming up
Here is a simple Binary search type program, but instead of cutting the array in half, it uses interpolation to search the array. Here is the code, but I am getting syntax errors, I will post them below the code: public class BinIntSearch { priv
-
Working with a 5.5 project and have inserted an animation (SWF). This was supplied to me by the client, and is a simulation captured in 5.5. I have the timing set to the duration of the animation, and the SWF itself is the entire slide, so there is n