Update custom table from qa_Results table
Dear Experts,
The question is related with Oracle quality collection plan. Here is the question.
After entering the result in collection plan we all know that result is store in qa_Results_V view and also in respective view for the collection plan.
In the same way , the same result I want to store in one custom table. Is it possible?
Thanks,
Atul Ramteke
<u>Syntax:</u>
EXPORT param_1 TO MEMORY ID 'EXIT_PCCD'.
IMPORT param_1 FROM MEMORY ID 'EXIT_PCCD'.
FREE MEMORY ID 'EXIT_PCCD'.
Please look into the F1-help on Export/Import statements for more details.
Message was edited by: Sam
Similar Messages
-
Is it possible to update internal table from database table
Hello All:
I know how to update database table from internal table in one shot (batch) but is the reverse possible? Can I update some fields in an internal table from a database table in one shot (without looping) because my internal table is huge? Could you please provide me any ideas how to acheive something like this? Thanks in advance and answers will be rewarded.
thanks.
MithunHello my friend,
You can do it MAYBE , i think you can reverse the update doing a ROLLBACK, but only after you update....not after the program finishes..
To update some fields at once use:
UPDATE DBTABLE FROM TABLE IT_TABLE
Hope this helps!!
Gabriel -
Updating database table from internal table
I am updating the database table from internal table for this is have used the following syntax
Update kna1 from table itab.
And it is giving error message as the work are itab is not long enough.
Please help me.Hi,
Refer this code
*& Form SUB_READ_UPDATE_BSEG
text
FORM sub_read_update_bseg.
IF NOT it_final[] IS INITIAL.
LOOP AT it_final INTO wa_final.
UPDATE bseg SET zuonr = wa_final-ccnum
WHERE bukrs EQ wa_final-bukrs
AND belnr EQ wa_final-vbeln
AND rfzei EQ wa_final-rfzei
AND saknr NE ' '.
ENDLOOP.
*--Message data updated successfully
MESSAGE i888 WITH text-002.
LEAVE LIST-PROCESSING.
ELSE.
*--Message No data found
MESSAGE i888 WITH text-003.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. " SUB_READ_UPDATE_BSEG
Regards,
PRashant -
Can not insert or update [TABLE] from internal table in method
I've faced a problem with OO abap. I've tried to insert into [ TABLE ] from internal table, but i've got error msg after i compiled.
"An explicit work area is necessary in the OO context. Use "INSERT wa INTO [TABLE] itab""
After i changed to loop in work area and INSERT INTO [TABLE] VALUES gw_data., everything is fine, can compile and run.
This is error code.
METHOD set_data_to_table.
REFRESH gi_data.
CLEAR gi_data.
IF gi_file[] IS NOT INITIAL.
* Set data for modify table
LOOP AT gi_file INTO gw_file.
MOVE-CORRESPONDING gw_file TO gw_data.
me->conversion_input( EXPORTING im_vendor = gw_data-vendor
CHANGING ch_vendor = gw_data-vendor ).
APPEND gw_data TO gi_data.
ENDLOOP.
INSERT [TABLE] FROM TABLE gi_data.
* LOOP AT gi_data INTO gw_data.
* INSERT INTO [TABLE] VALUES gw_data.
* IF sy-subrc = 0.
* COMMIT WORK.
* ELSE.
* ROLLBACK WORK.
* ENDIF.
* ENDLOOP.
ELSE.
MESSAGE 'No data found' TYPE 'I'.
ENDIF.
ENDMETHOD. "set_data_to_tableHi Matthew,
I think there is no difference in database insert between OO and non-OO.
The correct syntax according to ECC600 online documentation is
[Inserting Several Lines|http://help.sap.com/saphelp_erp2005vp/helpdata/en/fc/eb3a6d358411d1829f0000e829fbfe/content.htm]
To insert several lines into a database table, use the following:
INSERT target FROM TABLE itab \[ACCEPTING DUPLICATE KEYS].
This writes all lines of the internal table itabto the database table in one single operation. If one or more lines cannot be inserted because the database already contains a line with the same primary key, a runtime error occurs. You can prevent the runtime error occurring by using the addition ACCEPTING DUPLICATE KEYS.
Whenever you want to insert more than one line into a database table, it is more efficient to work with an internal table than to insert the lines one by one.
I think the syntax
INSERT my_dbtable FROM TABLE gi_data.
should work, your suggestion may lead to syntax error.
Regards,
Clemens -
Modify database table from internal table
Hi All,
I need to update database table from internal table which is having around 30000 records.
I am using MODIFY tabname FROM TABLE int_tabname...
Using this statement, I can modify the databse records very well. But user has some additional requirement.
He wants that the table should be modified from the internal table and after modification we should have the erroneous records to be displayed if any.
e.g. if 1500 records out of 30000 are erroneous then only 28500 records should be updated and 1500 records should be displayed as erroneous records so that the user can correct them and use them again for executing the program.
Is there any FM which imports the database table name and internal table, modifies the database and exports an internal tanle with erroneous records?
Any help will be appriciated,
Regards,
NehaHi
modifying datbase table useing internal table
<b>advises</b> before updating this datbase table plz lock that table to avoid incosistency
write the logic for modifying
Modify the database table as per new dunning procedure
MODIFY fkkvkp FROM TABLE lt_fkkvkp .
and finally unlock the table
<b>example</b>
*To lock table for further operations
constants: lc_tabname TYPE rstable-tabname VALUE 'FKKVKP' . "FKKVKP
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = lc_tabname
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc EQ 0.
To fetch all the contract accounts for customers of the segment
Households/SME.
PERFORM fetch_contract_accounts using lc_tabname .
ENDIF. " IF sy-subrc EQ 0.
*wrote the logic
Modify the database table as per new dunning procedure from internal table
MODIFY fkkvkp FROM TABLE lt_fkkvkp .
*unlock the tbale
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
TABNAME = uc_tabname .
<b>Reward if usefull</b> -
I can't create table from another table?
Hi everyone!
I have a problem that I don't known the reason why?
I'm using Oracle version 8i and I want to create a table from another table, such as:
CREATE TABLE a_backup as SELECT * FROM a => It's OK, table a_backup is created.
But there is only a table that I can't created like that, such as:
CREATE TABLE b_backup AS SELECT * FROM b;
When I run over command, SQL Plus is not responding... and clients are can't access to DB or Executing forever
This is the first time I met this problem.
Can Anyone help me to resolved it?
Thanks in advance!xi`tin wrote:
Hi everyone!
I have a problem that I don't known the reason why?
I'm using Oracle version 8i and I want to create a table from another table, such as:You realize, of course, that 8i is completely out of support .... Is your OS and hardware just as old as your rdbms software, or is it only the rdbms that your company refuses to upgrade?
CREATE TABLE a_backup as SELECT * FROM a => It's OK, table a_backup is created.
But there is only a table that I can't created like that, such as:
CREATE TABLE b_backup AS SELECT * FROM b;
When I run over command, SQL Plus is not responding... and clients are can't access to DB or Executing forever
This is the first time I met this problem.
Can Anyone help me to resolved it?
Thanks in advance! -
Fill database table from internal table
I made one table ZDISP_CHDOC_CC and want to fill that table from internal table.and i got runtime error. that duplicate entry
and two entry are like 10 200000 likhp 10
10 200000 likp 10
DESCRIBE TABLE IT_CHDOC .
LOOP AT IT_CHDOC.
INSERT ZDISP_CHDOC_CC FROM IT_CHDOC.
endloop.
IF SY-SUBRC = 0.
COMMIT WORK.
ELSE.
and when i used following then only one entry is insreted.
DESCRIBE TABLE IT_CHDOC .
LOOP AT IT_CHDOC.
INSERT ZDISP_CHDOC_CC FROM IT_CHDOC.
IF SY-SUBRC = 0.
COMMIT WORK.
endloop.
ELSE.Hi,
Replace your current code
DESCRIBE TABLE IT_CHDOC .
LOOP AT IT_CHDOC.
INSERT ZDISP_CHDOC_CC FROM IT_CHDOC.
endloop.
IF SY-SUBRC = 0.
COMMIT WORK.
ELSE.
WITH THE ONE GIVEN BELOW
DESCRIBE TABLE IT_CHDOC .
INSERT ZDISP_CHDOC_CC FROM TABLE IT_CHDOC ACCEPTING DUPLICATE KEYS.
IF SY-SUBRC = 0.
COMMIT WORK.
ELSE.
Regards,
Siddarth -
Create table from another table including constraints
Hi,
Is there a way to create a table from another table including constraints.
CREATE TABLE COPY_EMP
as
SELECT *
FROM EMP
WHERE 1 =2 ;
This creates the table, but the constraints are not copied over.
I was reading about DBMS_REDEFINITION - can that be used for this scenario ?
Thanks!
Anand>
I tried that, but the constraint names are posing a problem. And unfortunately our constraints are not named in a standard, so am finding it difficult to replace them.
Was just wondering if there were any simpler approach to this.
>
No - there isn't.
You will have to use new names for the constraints. That usually means extracting the DDL and manually changing the constraint names. -
Create a new table from another table that exists ussing a stored procedure
Hi,
I want to know if is posibble to create a new table from another table that exists ussing a stored procedure. This new table is created from other table that exists in the DB.
(in the next code the table tbl1 exist into the schema of the DB, but temp_tbl1 does not exist, it must be created by the procedure)
create or replace procedute temp is
temp_tbl1 tbl1%TYPE; //the temp_tbl1 will have the same type of tbl1
begin
create table temp_tbl1 as (select * from tbl1);
end temp;
thanks very muchcat wrote:
Hello,
I think my problem is not about this grant, because if I execute this as an "anonymous procedure":
DECLARE
BEGIN
EXECUTE IMMEDIATE 'CREATE TABLE Abonus (id NUMBER, amt NUMBER)';
END;
It runs ok
But if I do:
CREATE OR REPLACE procedure temp as
BEGIN
EXECUTE IMMEDIATE 'CREATE TABLE Abonus (id NUMBER, amt NUMBER)';
END;
I have the error
ORA-01031: Insufficient privileges
ORA-06512: at "temp", line 3Anonymous blocks are treated as "Invoker's Rights" from a privilege perspective whereas stored programs by default are treated as "Definer's Rights". Therefore using anonymous blocks is not a valid test to check this.
The simplest form of checking this issue is by executing
SET ROLE NONE;and then to run your statement/code block in question interactively. Using this approach you get in your session the effective rights of a "Definer's Rights" stored program, i.e. only privileges that you got granted directly to your user.
You can revert to the default setting by issuing
SET ROLE ALL;For more information regarding this topic, read e.g. the documentation:
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/subprograms.htm#LNPLS00809
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
Create a table from another table
I have Windows XP with 10g 10.2.0.1.0
I need to create a table from another table to re-arrange the table column order and add the following statement at the end of creation.
PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
TABLESPACE "TAB_DATA"
Below iis my SQL statement, but it doesn't work. Please help.
create table my_table as (select t1, t5, t2, t3, t4 from orig_table
PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
TABLESPACE "TAB_DATA"
*);*Kee Kee wrote:
I have Windows XP with 10g 10.2.0.1.0
I need to create a table from another table to re-arrange the table column order Why? Column order has no meaning. The individual SELECT statement specifies the column order that particular statement wants, which may be different from the needs of some other SELECT statement.
and add the following statement at the end of creation.
PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
TABLESPACE "TAB_DATA"
Below iis my SQL statement, but it doesn't work. Please help.
create table my_table as (select t1, t5, t2, t3, t4 from orig_table
PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
TABLESPACE "TAB_DATA" -
Insert Multiple rows into the table from that table data
Hi All,
I have a requirement like to insert mulitple rows into the table from that table data only(I need to replicate the data).
In this table primary key is composite primary key with all foreign keys.primary key also including the Date foreign key.I need to change that date at the of insertion.
INSERT
INTO myschema.Fact_page_performance
time_sk ,
batch_id ,
delta_msec ,
delta_user_msec,
error_code_sk ,
content_errs ,
element_count ,
page_bytes ,
Available ,
date_sk
VALUES
(SELECT time_sk ,
batch_id ,
delta_msec ,
delta_user_msec,
error_code_sk ,
content_errs ,
element_count ,
page_bytes ,
Available
FROM myschema.FACT_PAGE_PERFORMANCE_BACKUP
WHERE date_sk=20090509,20090510
But it is giving the error like missing Expression.
Could anyone please help to me.
Thanks and Regards
Swetha.You can have either VALUES or SELECT not both
INSERT
INTO myschema.Fact_page_performance
time_sk ,
batch_id ,
delta_msec ,
delta_user_msec,
error_code_sk ,
content_errs ,
element_count ,
page_bytes ,
Available ,
date_sk
SELECT time_sk ,
batch_id ,
delta_msec ,
delta_user_msec,
error_code_sk ,
content_errs ,
element_count ,
page_bytes ,
Available
FROM myschema.FACT_PAGE_PERFORMANCE_BACKUP
WHERE date_sk=20090509,20090510; -
Procedure to insert in table from other table returning multiple records
Hi Everybody,
I am new to oracle. So need your advice guys. I have to insert values to one table from another table. Please let me know , how i can do this.
E.g:
INSERT INTO TABLEA(`Name`,`ID`,`another_field`) VALUES ('Somevalue',(SELECT DISTINCT id FROM TABLEB WHERE tb.cat = '5' AND ID NOT IN (select id from TABLEC)), 'somevalue')
Above thing is not working for me.
I have to insert ID IN TABLE A by getting value from this query:
SELECT DISTINCT id FROM TABLEB WHERE tb.cat = '5' AND ID NOT IN (select id from TABLEC)
This query is returning multiple IDs, so how can i insert all in TABLEA by creating some sp.
Please help me out of this. I will be very thankful to you all guys. I will really appreciate your suggestions and comments.
Regards
DevWhy cant you just do this,
INSERT INTO TABLEA (NAME, ID, another_field)
SELECT DISTINCT 'Somevalue',
ID,
'somevalue'
FROM TABLEB
WHERE tb.cat = '5'
AND ID NOT IN (SELECT ID FROM TABLEC)G. -
How to update one table from another table?
Hi,
Please go through the case I am mentioning below and if possible try to provide with a solution.
I am working on a report to generate cash flow forecast, where in one of the fields is "Payroll", in which its being mentioned as:
In the selection screen: I am entering Project ID, profit Center and Period(in MM/YYYY format).
Selection of all entries in table COSP for selected cost elements above, value type 1, version , all periods and for all selected WBS elements and all objects underneath.
From this, update table COFP with information from COSP with value type 62 and same period.
For updation of various fields the following information is being given.
How should we update COFP?
New entries per OBJNR/PERIO and HKONT are required via using the information from COSP:
COFP-MANDT = SY-MANDT
COFP-KOKRS = if COSP-OBJNR begins with PR
Check table PRPS with COSP-OBJNR = PRPS-OBJNR and enter PRPS-PKOKR
If COSP-OBJNR begins with NV
Check table AFVC with COSP-OBJNR = AFVC-OBJNR,
go to Table AFKO with AFVC-AUFPL,
go to table AUFK with AFKO-AUFNR and enter AUFK-KOKRS
If COSP-OBJNR begins with OR
Check table AUFK with COSP-OBJNR = AUFK-OBJNR
and enter AUFK-KOKRS
COFP-BELNR = Check table NRIV, CLIENT = SY-MANDT, OBJECT = RK_BELEG,
SUBOBJECT = COFP-KOKRS, NRRANGENR = 05,
Add 1 to NRLEVEL and begin with 500000000
Use same BELNR for one update-run
COFP-BUZEI = 1 + and 1 in next entry but same update-run
COFP-TWAER = COSP-TWAER
COFP-ZHLDT = always last day of month in field COFP-PERIO
COFP-GJAHR = COSP-GJAHR
COFP-PERIO = if entry in field WKG001 à PERIO = 001
If entry in field WKG006 à PERIO = 006
COFP-WRTTP = 62
COFP-VRGNG = FIPL
COFP-POSIT = Check table SKB1 where SAKNR = COSP-KSTAR and use SKB1-FIPOS
for going to table FMCI-FIPOS and enter FMCI-POSIT
COFP-OBJNR = COSP-OBJNR
COFP-HKONT = COSP-KSTAR
COFP-WKGBTR = WKGXXX
COFP-WKGBTRO = -
COFP-WTGBTR = WTGXXX
COFP-WTGBTRO = -
COFP-WOGBTR = WTGXXX
COFP-WOGBTRO = -
COFP-BUKRS1 = -
COFP-GJAHR1 = -
COFP-BELNR1 = -
COFP-BUZEI1 = -
COFP-BUKRS2 = -
COFP-GJAHR2 = -
COFP-BELNR2 = -
COFP-BUZEI2 = -
COFP-EBELN = -
COFP-EBELP = -
COFP-ZEKKN = -
COFP-ETENRM = -
COFP-STUNR = -
COFP-LIFNR = -
COFP-KUNNR = -
COFP-GSBER = -
COFP-BUKRS = (nearly same as COFP-KOKRS!)
if COSP-OBJNR begins with PR
Check table PRPS with COSP-OBJNR = PRPS-OBJNR and enter PRPS-PBUKR
If COSP-OBJNR begins with NV
Check table AFVC with COSP-OBJNR = AFVC-OBJNR,
go to Table AFKO with AFVC-AUFPL,
go to table AUFK with AFKO-AUFNR and enter AUFK-BUKRS
If COSP-OBJNR begins with OR
Check table AUFK with COSP-OBJNR = AUFK-OBJNR
and enter AUFK-BUKRS
COFP-EINDT = -
COFP-SGTXT = -
COFP-GEBER = -
COFP-KURSF = -
COFP-KUFIX = -
COFP-GBETR = -
COFP-KURSR = -
COFP-KURSFIKRS = -
COFP-KZKRS = -
COFP-UMBKZ = -
COFP-KBLNR = -
COFP-KBLPOS = -
COFP-HI FIVOR = -
COFP-LO FIVOR = -
COFP-HI ACCOUNT = -
COFP-LO ACCOUNT = -
COFP-HI LIFNR = -
COFP-LO LIFNR = -
COFP-HI KUNNR = -
COFP-LO KUNNR = -
COFP-XDELETE = -
COFP-HI XOPVW = -
COFP-LO XOPVW = -
COFP-ZAEHK = -
COFP-CHAINBELNR = -
COFP-MWSKZ = -
COFP-LEDNR = -
COFP-BELTP = 1
COFP-VERSN = 0
COFP-OWAER = COSP-TWAER
COFP-CPUDT = SY-DATUM
COFP-CPUTM = SY-TIME
after doing updation, its again saying Selection of all entries in table COFP with value type 51 to 62, selected year, selected cost elements above and for all selected WBS elements and all objects underneath. Summarisation by period.
Now, can someone help me as how to proceed with the entire thing? An elaborate and illustrative answer would be highly appreciable.
If you require any other information....then get back to me ..asap.
Its bit urgent.
Thanks & Regards,
RaviHi
update <table> from <i_tab>
for different conditions.
loop at i_cosp.
if cosp-mandt eq sy-mandt and cosp-objnr eq 'PR'.
Read table i_PRPS with key i_PRPS-OBJNR = i_COSP-OBJNR.
if sy-subrc eq 0.
update PRPS set PKOKR = ? where objnr = i_prpr-objnr.
endif.
endif.
similarly for all the conditions
Regards
Message was edited by: Harikishore Sreenivasulu -
Need to update custom fields in MSEG table using "BAPI_GOODSMVT_CREATE"
Hi All,
There is a requirement to update custom fields in table MSEG which are part of append structure. There is a option to update the custom fields using the one of the tables parameters "EXTENSIONIN". Anyone please advice how can I update the custom field thru EXTENSIONIN.
Thanks in advance.
cheers,
Vijaysee the help
http://help.sap.com/saphelp_nw04/helpdata/en/c3/4099948b8911d396b70004ac96334b/frameset.htm
Regards
Kiran Sure -
To Update Custom field in mch1 table through MIGO Tcode
Dear champs,
I have added one custom field in mch1 table ( date ).
Now , In MIGO Tcode when i am doing posting, MCH1 table is also updated.
I want to know how to update my custom field in mch1 table at the time of posting.
Please tell me where to write logic to update mch1 table.
Regards,
Satyen TrivediHi Satyen,
what data has to be update in MCH1 table new field, for this did you added any screen or you want to implement your own custom logic.
1) if you implemented the screen , then you have to write logic there itself.
2) If you want to update through custom logic , then you takeup with the Enhancements or BADI.
Regards,
Krishna
Maybe you are looking for
-
What is difference between adobe photoshop and photoshop extended cs5
what is difference between adobe photoshop and photoshop extended cs5
-
Add apps to Open With in context menu
is it possible for example to add Preview to "Open With.." menu when I right click on Folder? because it's anoying to choose Preview every time when I click Other to achieve that Preview will create thumbnails of all pictures in that folder
-
About sequences substituting primary key values
I've created trigger: TRIGGER EMPLOYEES_TRG BEFORE INSERT ON EMPLOYESS FOR EACH ROW BEGIN SELECT employees_seq.nextval INTO :new.nr FROM dual; END; following statement works just fine in SQL Worksheet: insert into employees(Name, Surname) values ('M'
-
Powerbook with a intel chip.
Hi guys, Would it be possible to put a intel chip in my powerbook so it more or less works like a Macbook pro?? Or is that out of the question? I don't know a lot about computers so sorry =)) if this is a stupid question.. But I would still be gratef
-
Don't know how to close it, delete it, or stop it's activity. Can someone please help??