Need to update table from Maintenance view (Very Urgent !!!)
Hi Abap Guru's,
I got a requirement where in I need to create a new Zprog so that it shld give a call to view v_abc and thru this view I need to update the table abc if any duplicate entries are entered then I shld popup a message.
Cld u plz help me out how to go further with this requirement and any suggestions...
if we create a table maintenance generator for the table abc then it will check for the duplicate entries are not ? if it checks for the duplicate entries then my job is done esaily but how to assign the zt-code to the table maintenance ?
awaiting for u r answer's and realyy appreciated with lots of points.
Regards,
Ravi V Ganji
Hi,
table generator will check duplicate entries as any
other table .
table maintanance Generator is used to manually
input values using transaction sm30
follow below steps
1) go to se11 check table maintanance check box under
attributes tab
2) utilities-table maintanance Generator->
create function group and assign it under
function group input box.
also assign authorization group default &NC& .
3)
select standard recording routine radio in table
table mainitainence generator to move table
contents to quality and production by assigning
it to request.
4) select maintaience type as single step.
5) maintainence screen as system generated numbers
this dialog box appears when you click on create
button
6) save and activate table
using sm30 you can create entries manually.
also check below thread to assign transaction code to
table generator
Re: Table Maintanance Generator
create transaction use se93
select parameter transaction and give below attributes
Transaction code ZTX1
Transaction text Maintain View ZSDCZTVIEW
Transaction SM30 Screen 0
From module pool
Name of screen field Value
VIEWNAME ZSDCZTVIEW
UPDATE X
Similar Messages
-
Problem regarding updation of Z-table through maintenance view
hi ,
I m facing problem in updation of Z-table through maintenance view (SM30).
The scenario is that I have one customizing field in my Z-table which is checkbox.
Now I need to populate 2 fields in Z-table on tick of this checkbox and clicking of SAVE button.
For this I have created one module ''change_field'' in PAI.
Actually my database table is being updated but as soon as the control left my module all the updation that take place vanishes away.....
So please help me in this matter.Thanks for ur previous effort it is updating the database but its effect is not shown immediately on screen.After i referesh the transaction it is dispalying the data.
So can u please suggest me any way....
Now i have one scenario infront of me....
I need to restrict the data shown in maintenance view.
I think it would be same as pop-up window displayed when we tick on 2nd radiobutton ("ENTER CONDITIONS")
of intial screen of t-code SM30.
Please suggest what shud i do....
Thanks and reagrds,
Amit
Edited by: amit gupta on Jul 18, 2008 1:35 PM -
Update a table from a view (WITH)
Hello,
Is the below valid? Can I update table1 from table2 (view)?
Oracle is 9i
UPDATE
WITH t2 AS (
SELECT....................
SELECT t1.name n1, t2.name n2
FROM cell_info t1, t2
WHERE t1.cell = t2.cell
AND t1.name IS NULL
SET n1 = n2;
SQL Error: ORA-01732: data manipulation operation not legal on this view
01732. 00000 - "data manipulation operation not legal on this view"Hi,
there are cases where you can update an inline view :Scott@my10g SQL>create table t1 as select level id, chr(96+level) val
2 from dual
3 connect by level <= 6
4 /
Table created.
Scott@my10g SQL>create table t2 as select level id, cast(null as varchar2(30)) val
2 from dual
3 connect by level <= 6
4 /
Table created.
Scott@my10g SQL>alter table t1 add constraint t1_pk primary key (id);
Table altered.
Scott@my10g SQL>alter table t2 add constraint t2_pk primary key (id);
Table altered.
Scott@my10g SQL>select * from t1;
ID VAL
1 a
2 b
3 c
4 d
5 e
6 f
6 rows selected.
Scott@my10g SQL>select * from t2;
ID VAL
1
2
3
4
5
6
6 rows selected.
Scott@my10g SQL>update (
2 select t1.id, t1.val t1val, t2.val t2val
3 from t1
4 join t2
5 on t1.id=t2.id
6 )
7 set t2val=t1val
8 /
6 rows updated.
Scott@my10g SQL>select * from t2;
ID VAL
1 a
2 b
3 c
4 d
5 e
6 f
6 rows selected. -
How to extract data from maintenance view
Hi experts,
How can I select the data from maintenance view. As you know select query doesn't work on the maintenance view. And View name will be known at run time only.
Thanks
Yogesh Gupta> Let me tell you that I am a SAP certified ABAP consultant having experience of 4.5 years.
I suspect that we will be hearing more comments about that.
> Whatever question I asked can't be replied with the basic training (if yes please tell me even one).
Debugging a macro?
Another one => FM or BAPI to create the Activity Group in 4.0B No answer is possible? You have to be joking!
And in How to get email ID fo a SAP user you obviously didn't even try Graham's answer!
> I closed some of the answered questions since I didn't get the answers for them for a long time and SDN site doesn't allow to keep more than 10 questions open.
The "comment field" is not mandatory. You don't need to flood the forum with your questions again.
> I do respect your concerns but I have no intention to abuse this site as it has been very helpful for me.
That is the most important part. Thank you. But you seem to be unaware of the "search" functionality.
If you can imagine that you are not the first person to ask a certain question, then you can be sure that someone else already has and you can find the answers on your own. If you still have doubts, then ask a specific question providing the details.
Based on your other questions, you are on release 4.0B. Is that still correct?
Cheers and thanks for responding,
Julius
Edited by: Julius Bussche on Jan 23, 2009 12:06 AM -
Update table from SM30 with automatic Time Stamp
Hi,
I have created a table maintenance generator for updating table from SM30.
Now there are fields in my table which are CRETING TIME and CHANGING TIME. Both being TIMESTAMP field (datatype: RSDDTZNTSTMPS).
Is it possible while user updates records/create new record in the table from SM30, these time stamp field to automatically get populated.
Also is there any F4 help available for TIMESTAMP field?
ags.Hi,
You need to do two things inorder to get the desired results.
1) Go to Screen Layout of the Screen created by table maintenance generator and make the date/time columns to DISPLAY ONLY. This will ensure that user is not able to modify the values at runtime
2) Write the code in PAI of the Module pool program to populate the values at runtime using Sy-datum/sy-uzeit. (Hint : Search for INSERT/MODIFY statements which will show the location before which you need to write your logic)
Regards,
Kshitija -
Hi,
trying to update data from a view with:
- Company (table)
- Products (table)
In a form, the user wants to update
e.g: both products.product_name and Company.company_name.
Is there a way to update a view records built on 2 tables ?
Any idea will be really appreciated
ThksAn other question on INSTEAD OF Trigger:
Base Tables:
1.
SQL> desc pcs_companies;
Name Null? Type
COMPANY_ID NOT NULL NUMBER(12)
COUNTRY VARCHAR2(350)
COMPANY_NAME VARCHAR2(320)
COMPANY_PHONE VARCHAR2 (320)
COMPANY_FAX VARCHAR2(320)
COMPANY_URL VARCHAR2(150)
UPDATED_DATE DATE
2.
SQL> desc pcs_individuals;
Name Null? Type
INDIVIDUAL_ID NOT NULL NUMBER(12)
COMPANY_ID NUMBER(12)
FIRST_NAME VARCHAR2(320)
LAST_NAME VARCHAR2(320)
LOB VARCHAR2(300)
JOB_ROLE VARCHAR2(300)
TITLE VARCHAR2(300)
GENDER VARCHAR2(3)
EMAIL VARCHAR2(720)
FAX VARCHAR2(720)
PHONE_NO VARCHAR2(720)
UPDATED_DATE DATE
COUNTRY VARCHAR2(150)
ADDRESS_1 VARCHAR2(720)
ADDRESS_2 VARCHAR2(720)
ADDRESS_3 VARCHAR2(720)
CITY VARCHAR2(720)
3. pcs_individuals.COMPANY_ID = FK, ref pcs_companies.
4.
SQL> CREATE VIEW V_PCS_COMPANY_IND
AS
SELECT
i.INDIVIDUAL_ID,
c.company_id,
c.country,
c.Company_name,
c.company_phone,
i.Company_id indiv_company_id,
i.gender,
i.first_name,
i.last_name,
i.lob,
i.job_role,
i.title,
i.email_address,
i.fax,
i.phone_no ,
i.address_1,
i.address_2,
i.address_3,
i.city
FROM
pcs_individuals i,
pcs_companies c
WHERE
i.company_id = c.company_id
5.
CREATE OR REPLACE TRIGGER PCS_ADMIN.PCS_COMP_IND_UPDATE_TR
INSTEAD OF UPDATE ON PCMS_ADMIN.V_PCS_COMPANY_IND
FOR EACH ROW
begin
update PCS_COMPANIES
set
Company_name = nvl(:new.company_name,company_name),
company_phone = nvl(:new.company_phone,company_phone)
where company_id = :new.company_id;
update PCS_INDIVIDUALS
set
gender = nvl(:new.gender,gender),
first_name = nvl(:new.first_name,first_name),
last_name = nvl(:new.last_name,last_name),
lob = nvl(:new.lob,lob),
title = nvl(:new.title,title),
email_address = nvl(:new.email_address,email_address),
phone_no = nvl(:new.phone_no,phone_no),
fax = nvl(:new.fax,fax),
country = nvl(:new.country,country),
address_1 = nvl(:new.address_1,address_1),
address_2 = nvl(:new.address_2,address_2),
address_3 = nvl(:new.address_3,address_3),
city = nvl(:new.city,city)
where company_id = :new.company_id;
end PCMS_COMP_IND_UPDATE_TR;
6.
CREATE OR REPLACE TRIGGER PCS_ADMIN.NEW_COMPANY_ID_INSERT
INSTEAD OF INSERT ON PCS_ADMIN.V_PCS_COMPANY_IND
DECLARE
ID number;
BEGIN
INSERT INTO pcs_companies (org_id)
select v_pcs_comp_id_seq.nextval
into ID
from dual;
:new.company_id = ID;
INSERT INTO pcs_individuals (company_id)
select v_pcs_comp_id_seq.nextval
into ID
from dual;
:new.company_id = ID;
end;
My question
On point 6:
Assumption:
- Company_id is PK of pcs.Company and FK in pcs.individuals
- It should be feed by sequence (v_pcs_comp_id_seq)
Now how can i insert the same value for company_id (current.v_pcs_comp_id_seq) in both pcs_companies and pcs_individuals ? I've tested it in the above INSTEAD OF Trigger.It failed.
Thks for any advice,
lamine -
I have an iMac 8,1. Am needing to update firmware from 10.5.8 to at least 10.6 for new printer. Help.
I'm afraid what you've asked about is not firmware. Rather it's OS X - the operating system.
Upgrading to Snow Leopard
You can purchase Snow Leopard through the Apple Store: Mac OS X 10.6 Snow Leopard - Apple Store (U.S.). The price is $19.99 plus tax. You will be sent physical media by mail after placing your order.
After you install Snow Leopard you will have to download and install the Mac OS X 10.6.8 Update Combo v1.1 to update Snow Leopard to 10.6.8 and give you access to the App Store. Access to the App Store enables you to download Mavericks if your computer meets the requirements.
Snow Leopard General Requirements
1. Mac computer with an Intel processor
2. 1GB of memory
3. 5GB of available disk space
4. DVD drive for installation
5. Some features require a compatible Internet service provider;
fees may apply.
6. Some features require Apple’s iCloud services; fees and
terms apply.
Upgrading from Snow Leopard to Lion or Mavericks
To upgrade to Mavericks you must have Snow Leopard 10.6.8, Lion, or Mountain Lion installed. Purchase and download Mavericks (Free) from the App Store. Sign in using your Apple ID. The file is quite large, over 5 GBs, so allow some time to download. It would be preferable to use Ethernet because it is nearly four times faster than wireless.
OS X Mavericks- System Requirements
Macs that can be upgraded to OS X Mavericks
1. iMac (Mid 2007 or newer) — Model Identifier 7,1 or later
2. MacBook (Late 2008 Aluminum, or Early 2009 or newer) —
Model Identifier 5,1 or later
3. MacBook Pro (Mid/Late 2007 or newer) — Model Identifier 3,1 or later
4. MacBook Air (Late 2008 or newer) — Model Identifier 2,1 or later
5. Mac mini (Early 2009 or newer) — Model Identifier 3,1 or later
6. Mac Pro (Early 2008 or newer) — Model Identifier 3,1 or later
7. Xserve (Early 2009) — Model Identifier 3,1 or later
To find the model identifier open System Profiler in the Utilities folder. It's displayed in the panel on the right.
Are my applications compatible?
See App Compatibility Table — RoaringApps.
Upgrading to Lion
If your computer does not meet the requirements to install Mavericks, it may still meet the requirements to install Lion.
You can purchase Lion at the Online Apple Store. The cost is $19.99 (as it was before) plus tax. It's a download. You will get an email containing a redemption code that you then use at the Mac App Store to download Lion. Save a copy of that installer to your Downloads folder because the installer deletes itself at the end of the installation.
Lion System Requirements
1. Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7,
or Xeon processor
2. 2GB of memory
3. OS X v10.6.6 or later (v10.6.8 recommended)
4. 7GB of available space
5. Some features require an Apple ID; terms apply. -
Updating table from stored procedure in TimesTen
Hi experts,
I am unable to update table from procedure; here is what I did -
Created and populated table -
Command> create table test_table(key integer,value integer);
Command> insert into test_table values(1,10);
1 row inserted.
Command> insert into test_table values(2,20);
1 row inserted.
Command> insert into test_table values(3,30);
1 row inserted.
Command> select * from test_table
> ;
< 1, 10 >
< 2, 20 >
< 3, 30 >
created procedure -
Command> create or replace procedure testtable_update(key integer,value integer) as
> begin
> update test_table set test_table.value = value where test_table.key = key;
> end;
> /
Procedure created.
Executed procedure -
Command> begin
> testtable_update(3,60);
> end;
> /
PL/SQL procedure successfully completed.
Command> select * from test_table
> ;
< 1, 10 >
< 2, 20 >
< 3, 30 >
I am not seeing update, in underlying table. What could be the reason for this?
If I do following it works -
Command> update test_table set test_table.value = 60 where test_table.key = 3;
1 row updated.
Command> select * from test_table;
< 1, 10 >
< 2, 20 >
< 3, 60 >
3 rows found.
Am I missing something?
Any pointers or help will be greatly appreciated.
ThanksThe problem is that the parameter names in your procedure are the same as the column names, hence the columns are being updated with the same values. You have two options:
1. Change the names of the parameters by adding a prefix. For example:
create or replace procedure testtable_update( p_ key integer,*p_* value integer)
begin
update test_table set test_table.value = p_ value where test_table.key = p_ key;
end;
2. Qualiflying the parameters with the procedure name.
create or replace procedure testtable_update(key integer,value integer)
begin
update test_table set test_table.value = testtable_update. value where test_table.key = testtable_update. key;
end;
Simon -
need to update system from 10.4.11 to 10.5.7 to get airport express to work, is this possible?
Yes. Since you're using a MacBook, purchase Mac OS X 10.6 on DVD.
(64416) -
Need to update Ztable from final internal table
Hi,
ITAB = Final internal table has 9 fields : 1 2 3 4 5 6 7 8 9
Ztable = Ztable has 6 fields ex : 1 3 4 6 7 8
Structure of both Itab and Ztable are different.
I have data in the Final Internal table and needs to update data into a ztable.
If condition is true...
Modify ztable from itab
endif.
Any suggestions how I can update Ztable from the INternal table
Regards,
KittuHello,
First keep the loop to the final internal table then move all the records to the work area after moving to workarea then create another workarea for the Ztable then move only the field values which are there in Ztable then use modify keyword.
example
move:
y_wa_final_itab-kdauf to y_wa_zhr_item-vbeln,
y_wa_final_itab-kdpos to y_wa_zhr_item-posnr,
y_wa_final_itab-receiptno to y_wa_zhr_item-receiptno
modify zhr_item from y_wa_zhr_item -
I want o update the Table using the view of a table of different schema. A dblink is created between two schema's ?
Kindly suggest the method to implement this ?
What Form type should i use?
Its is possible to use collections?
Sanjayuser12957777 wrote:
I want o update the Table using the view of a table of different schema. A dblink is created between two schema's ?
Kindly suggest the method to implement this ?
What Form type should i use?
What do you mean by "connection"?
If you use a single database then just add schema's preffix and that's all.
under table owner:
insert into <table_name> select * from <schema>.<view>under view owner:
insert into <schema>.<table_name> select * from <view>But make sure your users get necessary grants. -
Need a Query to update table from another table.
I have two tables Table A and Table B , till now in table “A”. I have a column which consist of IDs and duplicate IDs( which are basically formed by Original Ids) , I have another table i.e. table “B” , which gives a mapping between original ids and duplicate Ids
TABLE A:
ID/DUPLICATEID NAME
1 Rahul
1_CAD Pawan
2 Nikhil
3 TOM
3_CAD Ravi
3_MQ Puneet
TABLE B:
ORIGINALID DUPLICATEID
1 1_CAD
3 3_CAD
3 3_MQ
Now I want to have another column in Table “A” , which will give me the mapping between the original Id and duplicate Id as shown in updated table “A”.
UPDATED TABLE A:
ID/DUPLICATEID NAME ORIGINAL_ID
1 Rahul
1_CAD Pawan
2 Nikhil
3 TOM
3_CAD Ravi
3_MQ Puneet
Now I want to write a Query in which I can update this column (ORIGINAL_ID) of Table “A”, from the table B(basically want to update mulitple rows using single query), because table B already has this mapping. Can any one help me in this. I am basically a Java guy , so I don’t know much about it. I hope to get a positive response from you people, Thanks in advance!Here you go...
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%">
<code>
SQL> CREATE TABLE A (ID VARCHAR2(10), NAME VARCHAR2(10), NEW_ID VARCHAR2(10));
Table created.
SQL> INSERT INTO A VALUES ('1', 'Rahul', '');
1 row created.
SQL> INSERT INTO A VALUES ('1_CAD', 'Pawan', '');
1 row created.
SQL> INSERT INTO A VALUES ('2', 'Nikhil', '');
1 row created.
SQL> INSERT INTO A VALUES ('3', 'TOM', '');
1 row created.
SQL> INSERT INTO A VALUES ('3_CAD', 'Ravi', '');
1 row created.
SQL> INSERT INTO A VALUES ('3_MQ', 'Puneet', '');
1 row created.
SQL> CREATE TABLE B (ID VARCHAR2(10), NAME VARCHAR2(10));
Table created.
SQL> INSERT INTO B VALUES ('1', '1_CAD');
1 row created.
SQL> INSERT INTO B VALUES ('3', '3_CAD');
1 row created.
SQL> INSERT INTO B VALUES ('3', '3_MQ');
1 row created.
SQL> COMMIT;
Commit complete.
SQL> UPDATE A
2 SET NEW_ID = NVL((SELECT B.ID FROM B WHERE A.ID = B.NAME),A.ID)
3 /
6 rows updated.
SQL> COMMIT;
Commit complete.
SQL> SELECT * FROM A;
ID NAME NEW_ID
1 Rahul 1
1_CAD Pawan 1
2 Nikhil 2
3 TOM 3
3_CAD Ravi 3
3_MQ Puneet 3
6 rows selected.
</code></pre>
Note: While asking question do give us DML/DDL script. It will make peoples life better.
Karthick.
http://www.karthickarp.blogspot.com/ -
Updates through a maintenance view
Hi,
I'm having difficulty with maintenance views. I thought it ws possible to construct a maintenance view consisting of two or more tables and be able to update non-key fields in any table, provided the tables were linked via FK and had suitable cardinality of C:1.
However, this seems to be what I've found: you can only update non-key fields in the primary table. Although fields in the secondary tables appear as though you can update them (via SM30), any data changes you make are erased (as you look at it!) when you hit Save - the original value returns.
Is my assessment correct? SAP Help is vague and ambiguous on the matter.
Also, maybe someone could explain the cardinality requirements. SAP Help states the FKs must have N:1 cardinality, but as far as I can see it should be C:1.
Thanks,
T.Hello Tenchy
You are talking about view clusters (SE54) where you have hierarchical linked tables that can be maintained together.
Obviously, you cannot edit key fields of the primary table. Instead you need to use execute two operations:
- DELETE entry
- CREATE new entry
It goes without saying that the same operations are propagated to the dependent entries in secondary tables.
The cardinality between primary table and secondary table should be 1:N meaning
- for each entry in the primary table you can have none or multiple entries in the secondary table
- you cannot have secondary records for which the corresponding primary record does not exist
Regards
Uwe -
Selection from maintenance view
Hi,
I have created and activated a maintenance view from tables EKPO and EKKO. I needed an outer join so I had to use maintenance view instead of datbase view. When I see the data in the view using SE11 it works fine. However, when I try to select some fields from it using code it gives me an error message.
Eg.
REPORT Z_TEST_REP.
TABLES: Z_MAINTVIEW.
SELECT * FROM Z_MAINTVIEW.
WRITE: / Z_MAINTVIEW-MYFIELD1.
ENDSELECT.
When activating, this gives me the error message: "Z_MAINTVIEW" is not defined in the ABAP Dictionary as a table, projection view or database view.
Does this mean that it is not possible to select single fields from a maintenance view using the select statement? Is there any way I can do this? Any help is appreciated. Thanks.
KhanHi Khan,
it is in the nature of EKKO (header) and EKPO (items) that you have 1 to n records (ittems) in EKPO with the same EBELN (purchase order document number). They all have different EBELP (item number values).
I just tried: You can create a database view with tables EKKO and EKPO with join condition EKKO-EBELN = EKPO-EBELN. In the view you also need EKKO-MANDT = EKPO-MANDT to make sure you stay in your client.
In the view fields, put all fields you want and/or need.
You can select from this view; works great.
Alternative: Use BAPI_PO_GETDETAIL to get all the header and item data you need. This is 100 % compliant with standard and (as I am convinced) with any programming guidelines.
- OK as I don't know the business scenario, it might be lesss than most appropriate...
Regards,
Clemens -
Getting Data from Maintenance view V001N into ABAP program
Hello Experts,
I have to fetch data from the maintenance view V001N in my ABAP program. I have used select statement in my program but I am getting a syntax error 'V001N is not defined in the ABAP Dictionary as a table, projection view or database view. '. V001N is a Maintenance view.
Can anybody help me out how to get the data from that maintenance view into the internal table of my ABAP program.
Regards.Sunil,
check these threads
https://forums.sdn.sap.com/click.jspa?searchID=18906946&messageID=6074746
https://forums.sdn.sap.com/click.jspa?searchID=18906946&messageID=6088233
so query on the tables which are used in the view
Thanks
Bala Duvvuri
Maybe you are looking for
-
Creating an ajustable 3d shape (without using any plugins, Away 3D etc).
I followed this youtube video: http://www.youtube.com/watch?feature=endscreen&NR=1&v=PfR9n0eZJvs And I created a 3D cube in flash using the 3D rotation tool and registration points. I know it isnt truely 3D it more like 2.5D. I have the finish item a
-
X11 and open source ATI drivers
Hi. Well I have a little(big) broblem. I have ATI Radeon x1600 video card, and I need open source video drivers (not fglrx). I installed it by the article at archlinux wiki: Open Source ATI Drivers The open source drivers will work to some degree on
-
Executable jar referring to external library
dear reader, I developed a swing tool which uses xml generated by xerces for socket communication contents. I'd like to the classes that I made to an executable jar. Just making executable jar file is simple. I followed the guide on the web.( thanks
-
Slow Mac Book Pro with Maverick Software
I have a Mac Book Pro Mid 2009 model. Ever since I have loaded Maverick software my computer has been very very slow. Is there anyway to speed up the processor or revert back to Mountain Lion software? This is really making me a disgruntled Mac us
-
Have any source code can produce a web traffic analysis?
I want to get the source code to produce a web traffic analysis report, for example i input a tomcat's access_log, it can analysis this log file and then output the analysis result in html file format. I have already found a source code to parsing th