Update Entities from updated tables URGENT!
I have just been assigned to clear the mess on a project, where the following happened:
Tables retrofitted into designer (container 1)
E-R Diagrams created from retrofitted entities, and then (entities and diagrams) updated
Entities copied (not completely, just Edit-> Copy) into a new container (container 2), therefore keep relationships with entities in container 1, NO E-R Diagrams on container 2
Tables created (container 2)
Tables updated (container 2) (Tables, not entities)And I need to update the entities on container 2 with the changes made to the tables and then update the E-R diagrams (still container 1) to show all the changes that happened.
First problem: How can I update the entities based on modified tables? Haven't been able to find a way.
Second problem: Do I have to recreate all the E-R diagrams or someone has an idea that will help me avoid spending the coming weekends solving the mess someone else left?
Thanks,
Carlos
When I was faced with a similar project, I created a single "Entity" (basically a table) that contained my questions and answers:
LightSwitch Survey: Handling
Complex Business Logic Using WCF RIA Services
Unleash the Power - Get the LightSwitch 2013 HTML Client / SharePoint 2013 book
http://LightSwitchHelpWebsite.com
Similar Messages
-
How to update Records from Internal table to u2018Zu2019 table?
Hi Friends,
How to update Records from Internal table to u2018Zu2019 table.
I have records in Internal table , that records want to update on u2018Zmarau2019 Table.
( my internal table & u2018 Zu2019 table structures are same.)
Thanking you.
Regards,
SubashHi,
loop at internal table.
modify <Z- table > from values < internal table Workarea>.
if sy-subrc = 0.
COMMIT work.
else.
ROLLBACK waork.
endif.
endloop.
or
UPDATE <Z- table > from table < internal table Workarea>.
if sy-subrc = 0.
COMMIT work.
else.
ROLLBACK waork.
endif.
Prabhudas -
Hi
how to create a external content type for Read and Update data from two tables in sqlserver using sharepoint designer 2010
i created a bcs service using centraladministration site
i have two tables in sqlserver
1)Employee
-empno
-firstname
-lastname
2)EmpDepartment
-empno
-deptno
-location
i want to just create a list to display employee details from two tables
empid firstname deptno location
and same time update in two tables
adilWhen I try to create an external content type based on a view (AdventureWorks2012.vSalesPerson) - I can display the data in an external list. When I attempt to edit it, I get an error:
External List fails when attached to a SQL view
Sorry, something went wrong
Failed to update a list item for this external list based on the Entity (External Content Type) 'SalesForce' in EntityNamespace 'http://xxxxxxxx'. Details: The query against the database caused an error.
I can edit the view in SQL Manager, so it seems strange that it fails.
Any advice would be greatly GREATLY appreciated.
Thanks,
Randy -
Update ztable from internal table
I want to update the Ztable from internal table datas.
what is the syntax to update.
Its urgent send with coding example is betterHi
PARAMETERS: p_carrid TYPE sflight-carrid,
percent(1) TYPE p DECIMALS 0.
DATA sflight_tab TYPE TABLE OF sflight.
FIELD-SYMBOLS <sflight> TYPE sflight.
SELECT *
FROM sflight
INTO TABLE sflight_tab
WHERE carrid = p_carrid AND
fldate = sy-datum.
IF sy-subrc = 0.
LOOP AT sflight_tab ASSIGNING <sflight>.
<sflight>-price =
<sflight>-price * ( 1 - percent / 100 ).
ENDLOOP.
ENDIF.
<b>UPDATE sflight FROM TABLE sflight_tab.</b>
Thanks
Vijay
PLZ reward points if helpful -
Update databse from internal table statement not using index
Hi Guys,
We are updating a databse table from a file. The file has a couple of fields which have data different from what the database has (non-primary fields :). We upload the file data into an internal table and then update the database table from internal table. At a time, internal table is supposed to have 10,000 records. I did SQL trace and found that the update statement is not making use of the databse index.
Should not the update statement here be using the table index (for primary key)?
Regards,
Munish... as often there are recommendations in this forum which makes me wonder, how people overestimate their knowledge!!!
Updates and Deletes do of course use indexes, as can be seen in the SQL Trace (use explain).
Inserts don't use indexes, because in many databases inserts are just done somewhere, But also with the INSERT, the primary key is the constraint for the uniqueness condition, duplicate keys are not allowed.
Coming to the original question, what is you actually coding for the update?
What is the table, which fields are in the internal table and what are the indexes?
Siegfried -
Update ztable from database table directly
hi all,
can u tell me the possible ways to update a ztable from database table directly.
i mean is there anyway to update ztable whenever entry is created in database table .
i dont want to update using insert,modify statements.
points will be rewarded to all hlpful answers.A slightly dirty solution:
Use SAP functions for reading from CDHEADER and CDPOS tables [with enough filters such that you extract minimum records possible] to read changes to MARA table fields since last run of your program. Use this information to update your ZTABLE. I would recommend having a table maintainance generator on ZTABLE. The actual update should be by a BDC by calling transaction SM30 for ZTABLE maintainance. Now the program may be set up as a batch job running 1ce an hour. You get updates to the extent of 1 hour latency.
Alternatively, you may look if an opportunistic BADI / user Exit is there alongside MM01/02 transactions - assuming the latter are the only ones updating MARA. In this BADI you may write the code to update ZTABLE- again, look to do it by BDC call transaction sm30 to maintain ZTable. To lighten up the code -load on BADI you may simply raise a custom event and move on. You will configure a job that runs your program when that particular event is raised. This will need the 'burden' of figuring out the changes, though.
An elegant way would be to fire a MATMAS fIDOC for every change to Material, capture that and turn back the changes to ZTABLE. This will facilitate the delta load. -
Update JList from database table
Hi! I have a JList that take some value from a mysql table. I want that the JList add or remove value when insert or delete row from db table.
Can you help me?Well then you need to write the add/remove code of the JList yourself. So when ever you updated the database you update the ListModel as well.
Read the JList API and follow the link to the Swing tutorial on "How to Use Lists" for a working example that dynamically updates a ListModel. -
Creating Entities from database tables ?
Hi everyone,
I am trying to prpare an entity relationship diagrams for a small application that about 5 or 6 tables. Can someone please let me know how I can reverse engineer or make entities from tables ?
Thanks
IQHi there,
I have checked to see that I" am using the correct container. Also this is a fresh Designer installation so there are not previous entities.
I however notice a few warningas and and error. I am sure this should not be the cause for me not seeing tables in the table to entoty retrofit but I may be wrong. I am seing the following warnings/ errors. Is this the cause of my problem or could it be something else.
CDS-15317 Warning: invalid Database User reference ('RCAR') in Database Object Grant to 'RCAR' - ignored
CDS-15317 Warning: invalid Database User reference ('BOLDING_SHARED') in Database Object Grant to 'BOLDING_SHARED' - ignored
CDS-15317 Warning: invalid Database User reference ('SKMT') in Database Object Grant - ignored
CDS-15317 Warning: invalid Role reference ('PASD_USER') in Database Object Grant to 'PASD_USER' - ignored
CDS-15014 Error: invalid Table reference ('EMPLOYEES') in Foreign Key 'EMP_FK'
Processing Complete: 1 error(s), 281 warning(s)
Please advise
Thanks
IQ -
How to get input text values from adf table - Urgent
Hi Friends,
This is my requirement. I designed customized master - detail - detail page. I customized the page in below format.
1. Master Data Field (Input text,etc) .
2. Detail in table format ( Rows are mapped to child table) and i given two buttons for to create row and delete row. I designed the table based on the example provided in forum for to create customized table. The input text component is mapped to the rows.
Now i want to retrieve all the data's entered in the rows. The table is mapped to child table. When i read the values from the table its showing null.
If any one faced this problem and fixed it, please send me the solution.
Thanks & Regards
VBDid you look into the valueChangeEvent?
It has oldValue and newValue attributes.
public void SaveMaterial(ValueChangeEvent valueChangeEvent) {
Object oldVal = valueChangeEvent.getOldValue();
Object newVal = valueChangeEvent.getNewValue();
// check if you see what you are looking for.....
getSelectedRow();
SaveMaterial(material);
}Timo -
To read data from cluster table urgent
i need to get personnel number(PERNR) from BSEG table which is a CLUSTER TABLE
what else i have to add in here to get personnel number(PERNR)
this code is giving no data only lots of ZEROS
FORM getexpcode1 TABLES in_tab21 STRUCTURE itcsy
out_tab21 STRUCTURE itcsy.
DATA : w_belnr LIKE bseg-belnr,
w_bukrs LIKE bseg-bukrs,
w_gjahr LIKE bseg-gjahr,
w_pernr like bseg-pernr,
w_invnos(255).
Read company code
READ TABLE in_tab21 INDEX 1.
IF sy-subrc = 0.
w_bukrs = in_tab21-value.
ENDIF.
Read document number
READ TABLE in_tab21 INDEX 2.
IF sy-subrc = 0.
w_belnr = in_tab21-value.
ENDIF.
Read Fiscal Year
READ TABLE in_tab21 INDEX 3.
IF sy-subrc = 0.
w_gjahr = in_tab21-value.
ENDIF.
SELECT pernr FROM bseg
INTO w_pernr
WHERE bukrs = w_bukrs
AND belnr = w_belnr
AND gjahr = w_gjahr.
ENDSELECT.
READ TABLE in_tab21 INDEX 1.
out_tab21-value = w_pernr.
MODIFY out_tab21 INDEX 1 TRANSPORTING value.
ENDFORM. "GETEXPCODE1hi,
try:
SELECT pernr FROM bseg
INTO w_pernr
WHERE bukrs = w_bukrs
AND belnr = w_belnr
AND gjahr = w_gjahr
AND PERNR <> SPACE.
ENDSELECT.
A.
Message was edited by:
Andreas Mann -
Update data from one table to another
Hi, I am trying to update the blank records with the value present in the other table but it fails saying that Sub-Query returns more than one row.
UPDATE MASTER SET CODE = (SELECT C_MASTER.CODE FROM C_MASTER WHERE
MASTER.DOL = C_MASTER.SEDOL AND MASTER.CODE IS NOT NULL)
Thanksperhaps
UPDATE MASTER SET CODE = (
SELECT C_MASTER.CODE FROM C_MASTER
WHERE MASTER.DOL = C_MASTER.SEDOL
AND C_MASTER.CODE IS NOT NULL)
WHERE MASTER.CODE IS NULL
of course, c_master.sedol must be unique (pk or unique constraint/index) for this to work
and the outer where clause prevents updating MASTER records that already have values. -
Copying and updating Data from a table to new table using Merge command
Hi ,
Can anyone please tell me how to do this?
I have a table : EMP(empno(pk),ename,sal,dept) another table is EMP_CLASS(empno(pk),ename)
I want to insert corresponding rows from emp to emp_class table if that row does'nt exist in emp_class
otherwise it will update corrsponding info in emp_class table as well as delete from emp_class according to emp delete operation.
Thanks ,
Deekay.
Edited by: Deekay on Aug 12, 2010 10:59 PMHi Vishu,
This is really helpful, but I want little modification like it will check for deptno in emp and insert in class field if dept is 10 then 1 ,20 ,2 like wise. I have changed emp_class structure .Please find my updated code eaccording to that ,but I am getting error.
MERGE
INTO emp_class
USING emp
ON (emp.empno = emp_class.empno)
WHEN MATCHED
THEN
UPDATE
SET emp_class.ename = emp.calss_name,
emp_class.deptno = emp.deptno,
emp_class.class=select decode(deptno,10,1,20,2,30,3,40,4)from emp
DELETE
WHERE emp_class.empno = emp.empno
WHEN NOT MATCHED
THEN
INSERT (emp_class.empno,emp_class.name,emp_class.deptno,emp_class.class)
VALUES (emp.empno,emp.name,emp.sal,emp.deptno,decode(deptno,10,1,20,2,30,3,40,4)emp.class);
Please help me to fix this.
this is the error:
MERGE
INTO emp_class
USING emp
ON (emp.empno = emp_class.empno)
WHEN MATCHED
THEN
UPDATE
SET emp_class.ename = emp.calss_name,
emp_class.deptno = emp.deptno,
emp_class.class=select decode(deptno,10,1,20,2,30,3,40,4)from emp
DELETE
WHERE emp_class.empno = emp.empno
WHEN NOT MATCHED
THEN
INSERT (emp_class.empno,emp_class.name,emp_class.deptno,emp_class.class)
VALUES (emp.empno,emp.name,emp.sal,emp.deptno,decode(deptno,10,1,20,2,30,3,40,4)emp.class); -
Update value from internal table into table control
hi friends,
i have two text field and a button in a screen.if give the value and click the button it should get updated in the table control which is in the next screen.plz
help me with some sample coding.hi Karthik ,
Here you go with the sample coding of moving internal table values to table control on module pool programs :
in screen painter flow-logic ............
process before output.
module status_3000.
loop at g_tab_con_01_itab
into g_tab_con_01_wa
with control tab_con
cursor tab_con-current_line.
module tab_con_move.
endloop.
process after input.
module exit at exit-command.
module user_command_3000.
module clear_ok_code.
loop at g_tab_con_01_itab.
module read_tab_con.
endloop.
in your program .............
include z_tab_ctrl_top . " global Data
program z_tab_ctrl.
tables : sflight,sbook,zsflight.
types:begin of t_tab_con_01 ,
carrid like sflight-carrid,
connid like sflight-connid,
sel type c,
end of t_tab_con_01.
data: g_tab_con_01_itab type t_tab_con_01 occurs 0 with header line,
g_tab_con_01_wa type t_tab_con_01,
g_tab_con_01_copied ,
g_tab_con_01_lines like sy-loopc,
ok_code like sy-ucomm,
lines type i,
init ,
fill type i.
controls: tab_con type tableview using screen 3000.
module status_3000 output.
set pf-status 'ST100'.
set titlebar 'T100'.
endmodule.
module update_table_control input.
describe table g_tab_con_01_itab lines tab_con-lines.
endmodule.
module exit input.
ok_code = sy-ucomm.
if ok_code eq 'BACK' or ok_code eq 'EXIT' or ok_code eq 'CANCEL'.
leave program .
endif.
endmodule.
module clear_ok_code input.
clear ok_code.
endmodule.
module fill_tab_con output.
read table g_tab_con_01_itab into zsflight index tab_con-current_line.
endmodule. " fill_tab_con OUTPUT
module read_tab_con input.
*lines = sy-loopc.
read table g_tab_con_01_itab into g_tab_con_01_wa index tab_con-current_line.
if sy-subrc eq 0.
move-corresponding sflight to g_tab_con_01_wa.
modify g_tab_con_01_itab from g_tab_con_01_wa index tab_con-current_line.
else.
move-corresponding sflight to g_tab_con_01_wa.
append g_tab_con_01_wa to g_tab_con_01_itab.
endif.
module tab_con_move output.
move-corresponding g_tab_con_01_wa to sflight.
endmodule. " tab_con_move OUTPUT
module tab_con_get_lines output.
g_tab_con_01_lines = sy-loopc.
endmodule. " tab_con_get_lines OUTPUT
module tab_con_modify input.
move-corresponding sflight to g_tab_con_01_wa.
modify g_tab_con_01_itab
from g_tab_con_01_wa
index tab_con-current_line.
endmodule. " tab_con_modify INPUT
module populate_tab_ctrl input.
if sy-subrc eq 0.
endif.
endmodule.
Look at the following modules in the above program ....
fill_tab_con
tab_con_modify
tab_con_get_lines
update_table_control
This will definately solve your problem or give an idea for solution ....
reward if helpful,
Regards,
Ranjita -
Update query - updating data from another table.
I have the following tables and data
CREATE TABLE UPD_TEST1
T1_COL1 NUMBER(10),
T1_COL2 VARCHAR2(10 BYTE),
T1_COL3 VARCHAR2(10 BYTE)
INSERT INTO UPD_TEST1 ( T1_COL1, T1_COL2, T1_COL3 ) VALUES (
1, 'raji', 'sis');
INSERT INTO UPD_TEST1 ( T1_COL1, T1_COL2, T1_COL3 ) VALUES (
2, 'manju', 'sis');
INSERT INTO UPD_TEST1 ( T1_COL1, T1_COL2, T1_COL3 ) VALUES (
3, 'chinnu', 'sis');
COMMIT;
CREATE TABLE UPD_TEST2
T2_COL1 NUMBER(10),
T2_COL2 VARCHAR2(10 BYTE),
T2_COL3 VARCHAR2(10 BYTE)
INSERT INTO UPD_TEST2 ( T2_COL1, T2_COL2, T2_COL3 ) VALUES (
1, 'muralee', 'bro');
INSERT INTO UPD_TEST2 ( T2_COL1, T2_COL2, T2_COL3 ) VALUES (
2, 'manoj', 'bro');
INSERT INTO UPD_TEST2 ( T2_COL1, T2_COL2, T2_COL3 ) VALUES (
3, 'manoop', 'bro');
COMMIT;
I need to update the columns of UPD_TEST1 with some values from UPD_TEST2 based on some conditions.
i wanted to update multiple rows at a time.Can it be done using one query..
Anyone please help me.
I have dome some search and got the following query but it can update only one record at a time
UPDATE upd_test1
SET ( t1_col2,t1_col3) =(SELECT t2_col2,t2_col3 FROM upd_test2 WHERE t2_col1 =2)
the following query won't work
UPDATE upd_test1
SET ( t1_col2,t1_col3) =(SELECT t2_col2,t2_col3 FROM upd_test2 WHERE t2_col1 IN (2,3))
ORA-01427: single-row subquery returns more than one row
I wanted to update multiple records at a timebit weird approach though, but you could try merge
SQL> Select * From Upd_Test1;
T1_COL1 T1_COL2 T1_COL3
1 raji sis
2 manju sis
3 chinnu sis
SQL> Merge Into Upd_Test1 A Using Upd_Test2 B
2 On (a.T1_Col1 = b.T2_Col1 and b.t2_col1 in (2,3))
3 When Matched Then
4 Update Set
5 A.T1_Col2 = B.T2_Col2
6 ,a.T1_Col3 = b.T2_Col3;
2 rows merged.
SQL> Select * From Upd_Test1;
T1_COL1 T1_COL2 T1_COL3
1 raji sis
2 manoj bro
3 manoop broVivek L -
Update records from a table in correct sequence that look from 2 tables and loop
Hi!
My question title is kinda unclear but here how it goes.
I created 2 tables for my BOM (Bill of Materials). I have BOM_Header and BOM_Detail.
Below are my sample data.
BOM_Header
Product_ID Int
Product_Name Varchar(50)
Cost Numeric(18,2)
Yield Varchar(50)
Select * from BOM_Header
1 Choco Cake 850.00 10
2 Mixed Flour 700.00 30
3 Choco Syrup 160.00 10
4 Egg Formula 2150.00 20
BOM_Detail
Product_ID int
ItemNo Int
ItemName varchar(50)
Quantity int
Unit varchar(50)
ProdCost numeric(18,2)
Select * from BOM_Detail
1 2 Mixed Four 10 Grams 15.00
1 3 Choco Syrup 20 ML 25.00
1 4 Egg Formula 20 Grams 10.00
2 101 Flour 5 packs 80.00
2 4 Egg Formula 5 Grams 60.00
3 201 Cocoa Power 2 kg 20.00
3 202 Sugar 2 kg 60.00
4 301 Whole Egg 10 pcs 85.00
4 302 EP12 Formula 25 ml 52.00
My computation is below.
BOM_Header = a
BOM_Detail = b
a.Cost = b.Quantity x b.Product Cost where a.Product_ID = b.Product_ID
My problem is how can I automatically compute their Food Cost in sequence from raw materials to finished products.
Based on the data, I need to compute first the Egg Formula because it is used as component of Mixed Flour then compute the Mixed Flour and other component to get the cost of Choco Cake.
How can I do this automatically in query to look first in detail if there are ingredients within a sub - ingredients then compute before computing the final cost of the Product.
This is because cost of ingredients are changing most of the time and need to recalculate to get the most updated cost.
Any suggestion is very much appreciated.
Thank you very much,
Regem>> My question title is kinda unclear but here how it goes. <<
Then your answers will be unclear, too :(
You do not know data modeling, so your data types are wrong. What math are you doing with the product_id? None. This is why identifiers are char(n) and not numeric. They should be industry standards if possible. I like the GTIN.
You do not even know that rows are not records.
Why is the product name fifty characters? Certainly not research! But if you are an ACCESS programmer using a default vale, then you might do this.
Besides violating ISO-11179 rules, “<vague>_field” makes no sense! It is a quantity that you put in a string.
CREATE TABLE BOM_Header
(gtin CHAR(15) NOT NULL PRIMARY KEY,
product_name VARCHAR(25) NOT NULL
unit_cost DECIMAL(18,2) NOT NULL
CHECK ( unit_cost >= 0.0.),
yield_qty INTEGER NOT NULL
CHECK (yield_qty >= 0));
>> Any suggestion is very much appreciated. <<
Get a copy of my book on TREES in SQL and read the chapter on BOM problems. I am not goingto try to post a whole chaper and diagrams to answer this. You are doing the wrong things and have done them poorly.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL
Maybe you are looking for
-
In AWM, i created the dimensions ,mapped them to relational table.Then i created a cube,added the dimensions.while mapping the cube,when i map the cube to corresponding relational table and give apply,the mapping gets disappeared. i haven't come acro
-
How to transfer videos to dvd's
Hello, I downloaded the free quick time for my grandsons ipod. Unfortunetly it turned all my home videos to quick time format. I can't get them to transfer to dvd now, so that we can play them on our dvd player. How can I fix this? any help is apprec
-
Here is my menu lay out. Three buttons. Play all (Want it to play enire movie) Play part one ( Play up to track 6 and return to menu) Play part two (Play from track 7 to end) Can someone please tell me how to do this correctly? What am I doing Wrong
-
File failure with Adobe Dynamic link when opening a *.prproj file - Premiere Pro CS4
Hi everyone, I'm trying to open a Premiere Pro CS4 file (*.prproj) but the bar that appears sating 'Opening file' (or similar) gets stopped before finishing to load the file. I tryed to export some sequences using Adobe Media Encoder CS4 (I wanted to
-
Dear All, Our customer is on SAP2007 PL49, SQL Server 2000. When I modify the PLD for them, I can save the changes. But when they log off SAP then log back in, all changes I made before is gone. Any idea? Thanks a lot. Regards, Yuka