Setup table vs Update table
Hi,
What is the difference between the setup table and update table? Kindly clarify.
I really appreciate all your help. Thanks.
Regards,
Jon.
Hi
<b>Update Tables :</b>
Update tables are the intermediate tables which store data read from document tables. The V3 runs collects deltas in form of LUWs from these update tables and populates the delta queues.
Update tables are use in V3 update scenario . It acts as staging before loading the delta queue . You can thought it as buffer , it continously refreshed , each time the v3 update takes place .Update table is used when u r loading the data through V3 update method . In this scenario it acts as a buffer between the r/3 and delta queue .. Everytime the v3 update takes place this tableis continuously refreshed ...
Document tables are the actual application tables where the data is posted when you post a document in R/3.
Examples can be MSEG, VBRK etc.
Document tables MKPF/MSEG
Update tables - VBHDR then V3 Update .
Similar Messages
-
Data from applivation table to Update table in LO?
Hi gurus
How the data is transeferred from application table to Update table/ setup table?
Is there any mechanism?
Regards
Duraihi Durai,
can through transaction OLI*BW.
OLI1BW INVCO Stat. Setup: Material Movemts
OLI2BW INVCO Stat. Setup: Stor. Loc. Stocks
OLI3BW Reorg.PURCHIS BW Extract Structures
OLI4BW Reorg. PPIS Extract Structures
OLI7BW Reorg. of VIS Extr. Struct.: Order
OLI8BW Reorg. VIS Extr. Str.: Delivery
OLI9BW Reorg. VIS Extr. Str.: Invoices
OLIABW Setup: BW agency business
OLIFBW Reorg. Rep. Manuf. Extr. Structs
OLIIBW Reorg. of PM Info System for BW
OLIQBW QM Infosystem Reorganization for BW
OLISBW Reorg. of CS Info System for BW
OLIZBW INVCO Setup: Invoice Verification
hope this helps. -
What are the Update tables?
In LO Delta scenario, Data posted parallel into document tables and update tables. What are the Document tables? What are the Update tables?
Give example for Application 11, which is document tables, and update tables?Hello Mannev,
Document tables are the actual application tables where the data is posted when you post a document in R/3.
Examples can be MSEG, VBRK etc.
Update tables are the intermediate tables which store data read from document tables. The V3 runs collects deltas in form of LUWs from these update tables and populates the delta queues.
hope this helps..
thanks, -
How to create procedure for header table and item table
Hi,
Can anyone help me to understand how to write SQLscript procedure for looping item table inside header table?
I fetch records from sales header table ( order number ) and using that order number to loop sales item table,thereafter I need to perform business logic.
Any example similar above requirement would be helpful
thanks
SouravHi Folks,
This is my use case
1) Select fact records from tables (say A,B,C,D ) with suitable Joins and certain Where conditions
SELECT ordid FROM TABLES A,B,C,D on join condition where ....
2) Using above header records , I have to select each and every item level data from different tables ( say X,Y,Z ) and perform calculation to derive new columns to update a new table ( Zreport )
UPDATE TABLE ZREPORT
SET col1 = ( Select qty FROM TABLE X WHERE ordid = A.ordid
UPDATE TABLE ZREPORT
SET col2 = ( Select price FROM TABLE y WHERE ordid = B.ordid.
and so on for other columns..
3) Zreport table will be used for reporting.
I would like to know the best way to achieve this to gain performance.
Appreciate the help!
Thanks
Sourav -
Error while updating table before branching to a report
Hi,
I have an apex form screen where on click of a button, i need to change a few flags on the screen and then display a bi publisher report.
when the user clicks the PRINT Button a javascript function is called, which will set the flags and submits the form. I have the default process row of table process to update the form fields.
in the branch i gave the BI publisher report url.
everything works fine so far.
if i click the print button again for a second time, i get a checksum ... error as shown below.
ORA-20001: Error in DML: p_rowid=982-000790, p_alt_rowid=_ID_NUMBER, p_rowid2=, p_alt_rowid2=. ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "BD63FDD3142B79017CCD2C8DA8ED8CA7" application checksum = "B2FD7581A9478214E59264F9C1CFAF96"
Error Unable to process row of table .
OK
Any idea how to fix this?
What i am trying to do is:
when the print button is clicked then i need to set the Print flag in the screen and database to true.I am using the default row update process generated by apex for a table form.
Thanks
KnutHi Scott,
example 1
I have a demo at the following url
http://apex.oracle.com/pls/otn/f?p=30091:6:1206476651563662::NO:::
1. page 6 is the report and page 7 will be the details form.
2. select a record from the report click edit and it will take you to the details screen page 7.
3. on page 7 i have 2 select boxes with YES/NO flag. Initially set them to NO.
save changes.
4. click on the print button. it will reset the select lists to YES and opens a report.
5.now go and edit anything on the screen and click apply changes.
we will get the an error.
All i am trying to do is update the flags to YES before displaying the report which works fine. but if i try to edit any data and save it throws an error.
is my table.
CREATE TABLE "DEMO_MINISTER"
( "MINISTER_ID" VARCHAR2(12),
"NAME" VARCHAR2(50),
"CERT_FLAG" VARCHAR2(1),
"LABEL_FLAG" VARCHAR2(1)
MINISTER_ID" is the primary key generated using a sequence. (i have to actually generate it with - year prefix etc hence a varchar)
example 2:
http://apex.oracle.com/pls/otn/f?p=30091:1:607292687304632:::::
i have another page page 1 with demo_customers list. here the id is a number here. on edit it displays page 5 where i tried the same print reset flag stuff here and it works.
Table Data Indexes Model Constraints Grants Statistics UI Defaults Triggers Dependencies SQL
CREATE TABLE "DEMO_CUSTOMERS"
( "CUSTOMER_ID" NUMBER NOT NULL ENABLE,
"CUST_FIRST_NAME" VARCHAR2(20) NOT NULL ENABLE,
"CUST_LAST_NAME" VARCHAR2(20) NOT NULL ENABLE,
"CUST_STREET_ADDRESS1" VARCHAR2(60),
"CUST_STREET_ADDRESS2" VARCHAR2(60),
"CUST_CITY" VARCHAR2(30),
"CUST_STATE" VARCHAR2(2),
"CUST_POSTAL_CODE" VARCHAR2(10),
"PHONE_NUMBER1" VARCHAR2(25),
"PHONE_NUMBER2" VARCHAR2(25),
"CREDIT_LIMIT" NUMBER(9,2),
"CUST_EMAIL" VARCHAR2(30),
"PRINT_FLAG" VARCHAR2(1),
"PRINT_LABEL_FLAG" VARCHAR2(1),
CONSTRAINT "DEMO_CUST_CREDIT_LIMIT_MAX" CHECK (credit_limit <= 5000) ENABLE,
CONSTRAINT "DEMO_CUSTOMERS_PK" PRIMARY KEY ("CUSTOMER_ID") ENABLE
So what should i do to get the example 1 to work.
Thanks
knut -
What are the tables will update while loading Master data ?
Hello Experts,
What are the tables will update while loading Master data ? And requesting you to provide more information about Master data loading and its related settings in the beginning of creation infoobjects.It depends upon the type of Master data u r loading....
In all the master data loadings, for every new value of master data an SID will be created in the SID table /BI*/S<INFOOBJECT NAME> irrespective of the type of master data.
But the exceptional tables that get updated depending on the type of master data are.....
If it is a time Independent master data then the /BI*/P<INFOOBJECT NAME> table gets updated with the loaded data.
If it is a time dependent master data then the /BI*/Q<INFOOBJECT NAME> table gets updated with the loaded data.
If the master data is of time Independent Navigational attributes then for every data load the SID table will get updated first and then the /BI*/X<INFOOBJECT NAME> table gets updated with the SID's created in the SID table (NOT WITH THE MASTER DATA).
If the master data is of time dependent navigational attributes then for every data load the SID table will get updated first and then the /BI*/Y<INFOOBJECT NAME> table gets updated with the SID's created in the SID table (NOT WITH THE MASTER DATA).
NOTE: As said above, For all the data in P, Q, T, X, Y tables the SID's will be created in the S table /BI*/S<INFOOBJECT NAME>
NOTE: Irrespective of the time dependency or Independency the VIEW /BI*/M<INFOOBJECT NAME> defined on the top of /BI*/P<INFOOBJECT NAME> & /BI*/Q<INFOOBJECT NAME> tables gives the view of entire master data.
NOTE: it is just a View and it is not a Table. So it will not have any physical storage of data.
All the above tables are for ATTRIBUTES
But when it comes to TEXTS, irrespective of the Time dependency or Independency, the /BI*/T<INFOOBJECT NAME> table gets updated (and of course the S table also).
Naming Convention: /BIC/*<InfoObject Name> or /BI0/*<InfoObject Name>
C = Customer Defined Characteristic
0 = Standard or SAP defined Characteristic
* = P, Q, T, X,Y, S (depending on the above said conditions)
Thanks & regards
Sasidhar -
"Error in updating Table J_1iexchdr"
Hi ,
When I am creating the excise invoice, It's terminated the program and gives the following error
"Error in updating Table J_1iexchdr"
What can be the reason?
Regards
PremHi prem
Look if these threads can help
RG23C Update Problem
Problem in SAP Script
billing document not creating
return delivery
************Reward points if usefull************** -
Error in updating table J_1PART2
Hi,
I am getting an error while saving the excise invoice as 'error in updating table J_1PART2'.
What would have gone wrong?????? please help!!!
Thanks ,
RamyaDiscussion moved from SAP ERP Sales and Distribution (SAP SD) to Internationalization and Unicode
Please use Internationalization and Unicode for you CIN related queries -
Error in updating table J_1IEXCHDR,J_1IEXCDTL in tcode J1IJ
Hi,
while cancelling excise invoice in Tcode J1IJ ,
we are getting 'error in updating table J_1IEXCHDR,J_1IEXCDTL'.
what is missing or tell the procedure to resolve the issue.
Regards,Discussion moved from SAP ERP Sales and Distribution (SAP SD) to Internationalization and Unicode
Please use Internationalization and Unicode for you CIN related queries -
Module pool - table control - update ztable
hello , i doing a module pool that will have few screens , now i have one screen with a table control that fetch the data from a ztable when screen is call the table control is showing the data and is in grey and no editable i add a pf-status for change that mode i can delete the row from the table control but i don't figure out how update to the ztable when i press save , i wan't too another button for add a new row ( and remain the already in grey ) for add new entrie in the table and update the ztable
pd: sorry for my bad english
this is my code:
TOP:
PROGRAM z_pp_lote_etiquetas MESSAGE-ID zz.
TABLES:zc2p_lote_etique,
zc2p_lider_modul.
DATA: ok_code LIKE sy-ucomm.
DATA save_ok LIKE sy-ucomm.
* internal table
DATA: it_zc2p_lote_etique LIKE STANDARD TABLE OF zc2p_lote_etique.
DATA: it_zc2p_lider_modul TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
DATA: it_zc2p_lider_modul_del TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
**************Workarea
DATA: wa_c2p_lote_etique TYPE zc2p_lote_etique.
DATA: wa_c2p_lider_modul TYPE zc2p_lider_modul.
DATA: wa_c2p_lider_modul_del TYPE zc2p_lider_modul.
DATA: sel.
DATA: MARK.
DATA: init.
DATA: col TYPE scxtab_column.
DATA: lines TYPE i.
* Variable Declaration
DATA : flg, "Flag to set the change mode
ln TYPE i. "No. of records
* Table Control Declartion.
CONTROLS: zc2p_lider_crtl TYPE TABLEVIEW USING SCREEN '101'.
**PROCESS BEFORE OUTPUT INCLUDE **
*& Include Z_PP_LOTE_ETIQUETAS_O01
*& Module set_status OUTPUT
* Setting the GUI status
MODULE status_0100 OUTPUT.
SET PF-STATUS 'Z_PP_LOT_ETIQ_MENU'.
SET TITLEBAR 'Z_PP_LOT_ETIQ'.
ENDMODULE. " set_status OUTPUT screen 100
* MODULE status_0101 OUTPUT
* Setting the GUI status
MODULE status_0101 OUTPUT.
SET PF-STATUS 'Z_PP_LOT_ETIQ_ME_101'.
SET TITLEBAR 'Z_PP_LOT_ETIQ'.
* Data retreving
if init is INITIAL.
select * from zc2p_lider_modul into CORRESPONDING FIELDS OF TABLE it_zc2p_lider_modul.
DESCRIBE TABLE it_zc2p_lider_modul LINES ln.
zc2p_lider_crtl-lines = ln + 10.
init = 'X'.
endif.
ENDMODULE. "status_0101 OUTPUT
module change_sdyn_conn output.
* you can change the content of current table control line via
* sdyn_conn
READ TABLE it_zc2p_lider_modul INTO zc2p_lider_modul INDEX zc2p_lider_crtl-current_line.
endmodule. " FILL_TABLE_CONTROL OUTPUT
MODULE set_screen_fields OUTPUT.
LOOP AT SCREEN.
IF flg IS INITIAL.
screen-input = 0.
ELSE.
screen-input = 1.
ENDIF.
*ENDIF.
* Modifying the screen after making changes
MODIFY SCREEN.
ENDLOOP.
ENDMODULE. " set_screen_fields OUTPUT
PROCESS AFTER INPUT INCLUDE.
* MODULE USER_COMMAND_0100 INPUT
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'LIDM'.
CALL SCREEN 101.
WHEN 'CANC'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. "USER_COMMAND_0100 INPUT
* MODULE USER_COMMAND_0101 INPUT
MODULE user_command_0101 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'SORT'.
DATA: fldname(100),help(100).
READ TABLE zc2p_lider_crtl-cols INTO col WITH KEY selected = 'X'.
SPLIT col-screen-name AT '-' INTO help fldname.
SORT it_zc2p_lider_modul BY (fldname).
WHEN 'CHANGE'.
* Setting the flag to make the table control in editable mode[excluding
* primary key].
flg = 'Y'.
WHEN 'BACK'.
CALL SCREEN 100.
LEAVE SCREEN.
WHEN 'CANCEL'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'SAVE'.
MODIFY zc2p_lider_modul FROM it_zc2p_lider_modul.
COMMIT WORK.
ENDCASE.
ENDMODULE. "USER_COMMAND_0101 INPUT
* MODULE read_table_control INPUT
MODULE read_table_control INPUT.
* Check input values
IF mark = 'X' AND save_ok = 'DELETE'.
DELETE TABLE it_zc2p_lider_modul FROM zc2p_lider_modul.
DESCRIBE TABLE it_zc2p_lider_modul LINES zc2p_lider_crtl-lines.
ENDIF.
ENDMODULE. " READ_TABLE_CONTROL INPUT
Screen Flow Logic 100
PROCESS BEFORE OUTPUT.
MODULE status_0100.
PROCESS AFTER INPUT.
MODULE user_command_0100.
Screen Flow Logic 101.
PROCESS BEFORE OUTPUT.
MODULE status_0101.
LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
zc2p_lider_crtl.
* Dynamic screen modifications
MODULE set_screen_fields.
MODULE change_sdyn_conn.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE user_command_0101.
LOOP AT it_zc2p_lider_modul.
MODULE read_table_control.
ENDLOOP.
i hope somebody can help for what i missing here thanks>
Sanjeev Kumar wrote:
> Hello Edgar,
>
> Problem seems to be there in the flow logic of 101
>
>
> PROCESS BEFORE OUTPUT.
> MODULE status_0101.
> LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
> zc2p_lider_crtl. " no need to have 'INTO zc2p_lider_modul' above
> * Dynamic screen modifications
> MODULE set_screen_fields.
> MODULE change_sdyn_conn.
> ENDLOOP.
> *
> PROCESS AFTER INPUT.
> MODULE user_command_0101. "this should be shifted after the following LOOP...ENDLOOP.
>
> LOOP AT it_zc2p_lider_modul. "need to have 'WITH CONTROL zc2p_lider_crtl' here
> MODULE read_table_control.
> ENDLOOP.
>
>
>
> With MODULE user_command_0101 call before the LOOP calls the MODIFY statement (under case save_ok 'SAVE') first and Z-table is updated with the old values as the changes are transferred from screen into the internal table it_zc2p_lider_modul in the LOOP...ENDLOOP later.
>
> Try these changes and I hope it will work.
>
> Thanks
> Sanjeev
i do the firts advice but the second one i get syntax error :
my code :
PROCESS AFTER INPUT.
LOOP at it_zc2p_lider_modul WITH CONTROL zc2p_lider_crtl.
MODULE read_table_control.
ENDLOOP.
MODULE user_command_0101.
error :
In the event PROCESS AFTER INPUT, no additions are allowed with "LOOP
AT". -
Associative array two variable comparison :update table error
Hi,
i am using associative array to update the version number of table
-i declare two associative array to compare the column from two table (temp,main tables)values in loop
-if id's of both variable(for temp and main table) are equal and column of either of table not matching then it should update the version no of temp table
-if id's not equal i.e record only exists temp table then update null version number annd increment it by 1
-following is the structure and procedure --it shows the matching and non matching records but for the update statement it not giving expected output i.e it updates all records irrespective of the condition provided
-i tried to put condition in update as well as in the if statement but it updates all record
....suggestion and help highly appreciate. thankx in advance !!!
/*--table structure and data--*/
CREATE TABLE "TEMP_TABLE"
( "ID" NUMBER NOT NULL ENABLE,
"COL1" VARCHAR2(20 BYTE),
"COL2" VARCHAR2(20 BYTE),
"VERSION" NUMBER
INSERT INTO TEMP_TABLE VALUES (101,'A','B',NULL);
INSERT INTO TEMP_TABLE VALUES (102,'x','y',NULL);
INSERT INTO TEMP_TABLE VALUES (103,'r','t',NULL);
CREATE TABLE "MAIN_TABLE"
( "ID" NUMBER NOT NULL ENABLE,
"COL1" VARCHAR2(20 BYTE),
"COL2" VARCHAR2(20 BYTE),
"VERSION" NUMBER
INSERT INTO MAIN_TABLE VALUES (101,'A','B',1);
/*------update version procedure----------*/
DECLARE
TYPE T_tmp_table IS TABLE OF tmp_table %ROWTYPE INDEX BY PLS_INTEGER;
TYPE T_main_table IS TABLE OF main_table%ROWTYPE INDEX BY PLS_INTEGER;
l_tmp_table T_tmp_table;
l_main_table T_main_table;
BEGIN
SELECT * BULK COLLECT INTO l_tmp_table FROM tmp_table;
SELECT * BULK COLLECT INTO l_main_table FROM main_table;
FOR i IN 1 .. l_tmp_table.count
LOOP
FOR j IN 1 .. l_main_table.count
LOOP
if(l_tmp_table(i).ID = l_main_table(j).ID AND l_tmp_table(i).VERSION IS NULL) then
---this first if loop updates temp table version irrespective of l_tmp_table.ID=l_main_table.ID orl_tmp_table. ID<>l_main_table.ID .it display proper matching and non-matching records.
dbms_output.put_line('matching ids from tmp and main are :'||l_tmp_table(i).ID||' '||l_main_table(j).ID);
UPDATE tmp_table SET VERSION = l_tmp_table(i).version +1;
--where l_tmp_table(i).ID = l_main_table(j).ID --
end if;
if (l_tmp_table(i).ID <> l_main_table(j).ID) then
dbms_output.put_line('non matching ids from tmp and main are :'||l_tmp_table(i).ID||' '||l_main_table(j).ID);
UPDATE tmp_table SET VERSION = l_tmp_table(i).version +1;
--where l_tmp_table(i).ID <> l_main_table(j).ID
end if;
END LOOP;
END LOOP;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('OTHER');
END;Hello user8937641
I think there is a problem with the logic of your SQL-Code.
But maybe in this formatted structure you can see where your problem is. -> I can not say it because I do not know what is the requirement.
I hope it helps...
/*------update version procedure----------*/
DECLARE
TYPE T_tmp_table IS TABLE OF tmp_table %ROWTYPE INDEX BY PLS_INTEGER;
TYPE T_main_table IS TABLE OF main_table%ROWTYPE INDEX BY PLS_INTEGER;
l_tmp_table T_tmp_table;
l_main_table T_main_table;
BEGIN
SELECT * BULK COLLECT INTO l_tmp_table FROM tmp_table;
SELECT * BULK COLLECT INTO l_main_table FROM main_table;
FOR i IN 1 .. l_tmp_table.count
LOOP
FOR j IN 1 .. l_main_table.count
LOOP
IF l_tmp_table(i).ID = l_main_table(j).ID
AND l_tmp_table(i).VERSION IS NULL
THEN
---this first if loop updates temp table version irrespective of l_tmp_table.ID=l_main_table.ID orl_tmp_table. ID<>l_main_table.ID .it display proper matching and non-matching records.
dbms_output.put_line('matching ids from tmp and main are :'||l_tmp_table(i).ID||' '||l_main_table(j).ID);
UPDATE tmp_table
SET version = l_tmp_table(i).version +1;
WHERE id = l_tmp_table(i).ID
END IF;
IF l_tmp_table(i).ID <> l_main_table(j).ID
THEN
dbms_output.put_line('non matching ids from tmp and main are :'||l_tmp_table(i).ID||' '||l_main_table(j).ID);
-- Maybe you do not need this update:
UPDATE tmp_table
SET version = l_tmp_table(i).version +1;
WHERE id = l_tmp_table(i).ID
END IF;
COMMIT;
END LOOP;
END LOOP;
EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Error at Executing the PLSQL-Block - ' || SQLERRM);
END; -
Bapi : BAPI_ALM_ORDER_MAINTAIN not updating table AFVU-USR08
Hi,
I have a requirement to update table AFVU-USR08.I am actualy dealing with tcode IW32/IW33 where in we need to update operation-->enhancement tab.I am using BAPI : BAPI_ALM_ORDER_MAINTAIN to do this.I am testing the BAPI directly( Not called in any program ),I can see a message like so and so order saved under notification,But there is no entry in table AFVU-USR08.
If any one have come across this prob. and got the sol. Pl. share it with me.
Your solution will be more helpful.
Thanks,
Bharani.Hi Ferry,
1. I have also tried ur given code before BAPI_TRANSACTION_COMMIT.
l_fname = 'SOBKZ'.
l_fvalue = 'U'.
CALL FUNCTION 'CO_BH_MOD_SINGLE_FIELDS'
EXPORTING
aufnr_imp = wa_meth-objectkey(12)
field1 = l_fname
value1 = l_fvalue.
but this program is giving dump for only this particular Value saying that This is PROTECTED field.
Can anyone help me out on How to Update Special Stock Indicator on Components Tab of Maintenance Order (IW32).
If anyone has faced such type of problem & solved it then please let me also.
2. Which BADI to use for Updating Special Stock Indicator when we press enter on Components tab in Transaction IW32 ?..
Thanks in advance,
Hope to get the solution soon from all SAP gurus.
and help will be appriciated .
Gaurav. -
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 -
Creating a better update table statement
Hello,
I have the following update table statement that I would like to make more effecient. This thing is taking forever. A little background. The source table/views are not indexed and the larger of the two only has 150k records. Any ideas on making more effecient would be appreciate.
Thanks.
Ryan
Script:
DECLARE
V_EID_CIV_ID SBI_EID_W_VALID_ANUM_V.SUBJECT_KEY%TYPE;
V_EID_DOE DATE;
V_EID_POE SBI_EID_W_VALID_ANUM_V.POINT_OF_ENTRY%TYPE;
V_EID_APPR_DATE DATE;
V_CASE_CIV_ID SBI_DACS_CASE_RECORDS.CASE_EID_CIV_ID%TYPE;
V_CASE_DOE DATE;
V_CASE_POE SBI_DACS_CASE_RECORDS.CASE_CODE_ENTRY_PLACE%TYPE;
V_CASE_APPR_DATE DATE;
V_CASE_DEPART_DATE DATE;
V_SBI_UPDATE_STEP SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP%TYPE;
V_SBI_CIV_ID SBI_DACS_CASE_RECORDS.SBI_CIV_ID%TYPE;
CURSOR VALID_CIV_ID_FROM_EID IS
SELECT EID.SUBJECT_KEY,
TO_DATE(EID.PROCESS_ENTRY_DATE),
EID.POINT_OF_ENTRY,
TO_DATE(EID.APPREHENSION_DATE),
DACS.CASE_EID_CIV_ID,
TO_DATE(DACS.CASE_DATE_OF_ENTRY,'YYYYMMDD'),
DACS.CASE_CODE_ENTRY_PLACE,
TO_DATE(DACS.CASE_DATE_APPR,'YYYYMMDD'),
TO_DATE(DACS.CASE_DATE_DEPARTED,'YYYYMMDD'),
DACS.SBI_UPDATE_STEP,
DACS.SBI_CIV_ID
FROM SBI_EID_W_VALID_ANUM_V EID,
SBI_DACS_CASE_RECORDS DACS
WHERE DACS.CASE_NBR_A = EID.ALIEN_FILE_NUMBER;
BEGIN
OPEN VALID_CIV_ID_FROM_EID;
SAVEPOINT A;
LOOP
FETCH VALID_CIV_ID_FROM_EID INTO V_EID_CIV_ID, V_EID_DOE, V_EID_POE,V_EID_APPR_DATE,V_CASE_CIV_ID, V_CASE_DOE,V_CASE_POE,V_CASE_APPR_DATE,V_CASE_DEPART_DATE,V_SBI_UPDATE_STEP,V_SBI_CIV_ID;
DBMS_OUTPUT.PUT_LINE('BEFORE');
EXIT WHEN VALID_CIV_ID_FROM_EID%FOUND;
DBMS_OUTPUT.PUT_LINE('AFTER');
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_CASE_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 1
WHERE V_CASE_CIV_ID IS NOT NULL
AND V_CASE_CIV_ID <> 0;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 2
WHERE V_SBI_CIV_ID IS NULL AND V_SBI_UPDATE_STEP = 0
AND V_EID_DOE = V_CASE_DOE
AND V_EID_POE = V_CASE_POE
AND V_EID_APPR_DATE = V_CASE_APPR_DATE
AND V_EID_APPR_DATE = V_CASE_DEPART_DATE;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 3
WHERE V_SBI_UPDATE_STEP = 0
AND V_EID_DOE = V_CASE_DOE
AND V_EID_POE = V_CASE_POE
AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 4
WHERE V_SBI_UPDATE_STEP = 0
AND V_EID_DOE = V_CASE_DOE
AND V_EID_POE = V_CASE_POE
AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4 ;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 5
WHERE V_SBI_UPDATE_STEP = 0
AND V_EID_DOE = V_CASE_DOE
AND V_EID_POE <> V_CASE_POE
AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 6
WHERE V_SBI_UPDATE_STEP = 0
AND V_EID_POE = V_CASE_POE
AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 7
WHERE V_SBI_UPDATE_STEP = 0
AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 8
WHERE V_SBI_UPDATE_STEP = 0
AND V_EID_DOE = V_CASE_DOE
AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 9
WHERE V_SBI_UPDATE_STEP = 0
AND V_EID_DOE = V_CASE_DOE
AND V_EID_POE = V_CASE_POE;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 10
WHERE V_SBI_UPDATE_STEP = 0
AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4;
END LOOP;
CLOSE VALID_CIV_ID_FROM_EID;
COMMIT;
END;
-----Thats it. Thanks for your help.
RyanPlease use [ code] or [ pre] tags to format code before posing:
DECLARE
V_EID_CIV_ID SBI_EID_W_VALID_ANUM_V.SUBJECT_KEY%TYPE;
V_EID_DOE DATE;
V_EID_POE SBI_EID_W_VALID_ANUM_V.POINT_OF_ENTRY%TYPE;
V_EID_APPR_DATE DATE;
V_CASE_CIV_ID SBI_DACS_CASE_RECORDS.CASE_EID_CIV_ID%TYPE;
V_CASE_DOE DATE;
V_CASE_POE SBI_DACS_CASE_RECORDS.CASE_CODE_ENTRY_PLACE%TYPE;
V_CASE_APPR_DATE DATE;
V_CASE_DEPART_DATE DATE;
V_SBI_UPDATE_STEP SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP%TYPE;
V_SBI_CIV_ID SBI_DACS_CASE_RECORDS.SBI_CIV_ID%TYPE;
CURSOR VALID_CIV_ID_FROM_EID IS
SELECT EID.SUBJECT_KEY,
TO_DATE(EID.PROCESS_ENTRY_DATE),
EID.POINT_OF_ENTRY,
TO_DATE(EID.APPREHENSION_DATE),
DACS.CASE_EID_CIV_ID,
TO_DATE(DACS.CASE_DATE_OF_ENTRY,'YYYYMMDD'),
DACS.CASE_CODE_ENTRY_PLACE,
TO_DATE(DACS.CASE_DATE_APPR,'YYYYMMDD'),
TO_DATE(DACS.CASE_DATE_DEPARTED,'YYYYMMDD'),
DACS.SBI_UPDATE_STEP,
DACS.SBI_CIV_ID
FROM SBI_EID_W_VALID_ANUM_V EID,
SBI_DACS_CASE_RECORDS DACS
WHERE DACS.CASE_NBR_A = EID.ALIEN_FILE_NUMBER;
BEGIN
OPEN VALID_CIV_ID_FROM_EID;
SAVEPOINT A;
LOOP
FETCH VALID_CIV_ID_FROM_EID INTO V_EID_CIV_ID, V_EID_DOE,
V_EID_POE,V_EID_APPR_DATE,V_CASE_CIV_ID, V_CASE_DOE,
V_CASE_POE,V_CASE_APPR_DATE,V_CASE_DEPART_DATE,V_SBI_UPDATE_STEP,V_SBI_CIV_ID;
DBMS_OUTPUT.PUT_LINE('BEFORE');
EXIT WHEN VALID_CIV_ID_FROM_EID%FOUND;
DBMS_OUTPUT.PUT_LINE('AFTER');
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_CASE_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 1
WHERE V_CASE_CIV_ID IS NOT NULL
AND V_CASE_CIV_ID <> 0;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 2
WHERE V_SBI_CIV_ID IS NULL AND V_SBI_UPDATE_STEP = 0
AND V_EID_DOE = V_CASE_DOE
AND V_EID_POE = V_CASE_POE
AND V_EID_APPR_DATE = V_CASE_APPR_DATE
AND V_EID_APPR_DATE = V_CASE_DEPART_DATE;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 3
WHERE V_SBI_UPDATE_STEP = 0
AND V_EID_DOE = V_CASE_DOE
AND V_EID_POE = V_CASE_POE
AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 4
WHERE V_SBI_UPDATE_STEP = 0
AND V_EID_DOE = V_CASE_DOE
AND V_EID_POE = V_CASE_POE
AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4 ;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 5
WHERE V_SBI_UPDATE_STEP = 0
AND V_EID_DOE = V_CASE_DOE
AND V_EID_POE <> V_CASE_POE
AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 6
WHERE V_SBI_UPDATE_STEP = 0
AND V_EID_POE = V_CASE_POE
AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 7
WHERE V_SBI_UPDATE_STEP = 0
AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 8
WHERE V_SBI_UPDATE_STEP = 0
AND V_EID_DOE = V_CASE_DOE
AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 9
WHERE V_SBI_UPDATE_STEP = 0
AND V_EID_DOE = V_CASE_DOE
AND V_EID_POE = V_CASE_POE;
UPDATE SBI_DACS_CASE_RECORDS
SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 10
WHERE V_SBI_UPDATE_STEP = 0
AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4;
END LOOP;
CLOSE VALID_CIV_ID_FROM_EID;
COMMIT;
END;Peter D. -
Guys,
I need to update table A columns col3, col4, col5 and col6 by table b columns col3, col4, col5 and col6 however table b col5 and col6 values need to come from table c col1.
Means table b col5 and col6 have values in it however i need to replace them with value from table c col1 and need to update table a col5 and col6 accordingly.
table a and table b has col1 and col2 in common.
i am trying something like this.
Update a
a.col3 = b.col3,
a.col4 = b.col4,
a.col5 = (select col1 from table_c c where c.col2=b.col5),
a.col6 = (select col1 from table_c c where c.col2=b.col6)
from table_A a inner join table_b
on a.col1=b.col1 and a.col2=b.col2
can someone help me reframe above update query?
thanks in advance for your help.Try the below:(If you have multiple values, then you may need to use TOP 1 as commented code in the below script)
create Table tableA(Col1 int,Col2 int,Col3 int,Col4 int,Col5 int,Col6 int)
Insert into tableA values(1,2,3,4,5,6)
create Table tableB(Col1 int,Col2 int,Col3 int,Col4 int,Col5 int,Col6 int)
Insert into tableB values(1,2,30,40,50,60)
create Table tableC(Col1 int,Col2 int,Col3 int,Col4 int,Col5 int,Col6 int)
Insert into tableC values(100,50,30,40,2,2)
--Insert into tableC values(200,50,30,40,2,2)
Insert into tableC values(100,60,30,40,2,2)
Select * From tablea
Update a Set
a.col3 = b.col3,
a.col4 = b.col4,
a.col5 = (select col1 from tablec c where c.col2=b.col5 ),
a.col6 = (select col1 from tablec c where c.col2=b.col6 )
from tableA a inner join tableb b
on a.col1=b.col1 and a.col2=b.col2
--Update a Set
--a.col3 = b.col3,
--a.col4 = b.col4,
--a.col5 = (select Top 1 col1 from tablec c where c.col2=b.col5 Order by c.Col1 asc),
--a.col6 = (select Top 1 col1 from tablec c where c.col2=b.col6 Order by c.Col1 asc)
--from tableA a inner join tableb b
--on a.col1=b.col1 and a.col2=b.col2
Select * From tablea
Drop table tablea,Tableb,TableC
Maybe you are looking for
-
IPod Classic Crashes randomly with ntdll.dll error
Sometimes when I plug-in my 120GB iPod Classic, iTunes would crash, giving me a ntdll.dll error, and I would need to unplug my iPod classic before it would allow iTunes to start again. Upon disconnect, the iPod will try to restart and then it would u
-
Best way to create Math-Book for several devices
Hello, I have written some Books about Mathematics and past months I rewrote the first one directly in iBooks Author - My original files have been written in WinWord 15 years ago, so there was only plain text, I could copy/paste into iBooks Author. T
-
Few common questions about Mobile Forms
Hello, everyone! I have a few questions about mobile forms: Can a form be integrated with a portal, which is build NOT on Adobe CQ\AEM technology? I've created a form and loaded it to the server repository via Form Manager. Now I can access it in my
-
I double click on itunes to open it but i get the message; The itunes library.itl file is locked, on a locked disk, or you do not have write permission for this file. How do I correct this problem. It just started doing this one week ago.
-
I have not been able to use facetime on my iphone 5 and my daughtes ipod 5 since yesterday...does anyone know if there are any issues with apple?