"Hiding" records with delete status
Hi,
In my project we use logical deletion from the DB, meaning that records have an is_deleted column.
Whenever I want to logically delete a record I just need to set the is_deleted field to 1.
The problem is as follows:
I have two objects A,B and to tables T_A and T_B that relates to these objects respectively.
Both objects have is_deleted field, and A contains a list of B objects.
When getting from A the list of Bs it returns also the ones with is_deleted=1.
What is your recommendation to solve this problem?
Is there a way of telling toplink not to load these records at all?
Thanks,
Lior.
You can either filter the deleted objects for the specific mapping or for all queries for the class.
To filter all queries for a class you can use a descriptor additionalJoinExpression. This is an expression that can be set in a descriptor's query manager, this feature is only available through the code API, so you need to use a descriptor amendment method to define it from the Mapping Workbench.
Example:
ExpressionBuilder builder = new ExpressionBuilder();
descriptor.getQueryManager().setAdditionalJoinExpression(
builder.getField("A.IS_DELETED").equal(1));
This will cause all queries for the A class to filter out deleted objects.
If you only wanted the filter on the A->B relationship mapping you could use a mapping selectionCriteria that filters on the is_deleted flag. Refer to the follow thread for an example of a mapping selectionCriteria filter.
Filtering results on the child vector
Similar Messages
-
Filtering records with deletion flag in Query report
Dear Friends,
We are using ECC6.00 (EHP4) for one of our QM requirement, i have created a query in SQ01 with the tables QMEL,AUFK,AFKO,QMFE etc., to get the details of production order and notification.
The report will list out the production scheduler wise, order wise, defect wise quantity with the notification number also in the display.
For notifications which are created wrongly, the users set deletion flag. The same i.e., notifications with deletion flag should not appear in the report and hence i have called the field and filtered the value in the output (i.e., field value not equal to X where X is for deletion flag set records).
Everything works fine upto this, but when users (to carry out analysis) send the data to the spread sheet, the filter values are removed and all records are populated in the excel sheet (even records with deletion flag).
To select and display only records without deletion flag, i want to introduce coding in the query. Kindly tell me whether this is possible, if so where and what code should be written to meet my requirement.
The records with the deletion flag (notifications) should be eliminated from the selection and display.
Experts help required.
Regards,
M.MDear Raymond Giuseppi,
Thank you for your reply. The code syntax had been corrected based on your information. Unfortunately the code doesn't filter the records. On further investigation , it was observed that the field KZLOESCH doesn't get updated and hence a field had been created in the infoset wherein the following coding is written
clear : w_dlfl.
data : w_inact type char1.
select single inact into w_inact from jest
where objnr = qmel-objnr
and stat = 'I0076'
and inact ne 'X'.
if sy-subrc = 0 .
w_dlfl = 'X'.
else.
w_dlfl = ''.
endif.
The field name is W_dlfl.
In the above condition how and where should i include the code given by you. Since the field KZLOESCH is not updated how should we get the data from the field w_dlfl be exempted from selection?
Kindly provide solution.
Regards,
M.M -
Deleting Records based on status in another table
Dear All,
I am using oracle 11gR1 on Linux.
We have two tables one holding year starting and closing dates with year status as open/closed for multiple years and multiple entities. Any year may be open for an entity.
Relevant columns/Pk
PK: entity_id, fin_year_id
Cols: year_st_dt, year_end_dt, year_status
We have another table where monthly summarized information is stored via scheduled procedure. Currently the procedure deletes all records and inserts new records.
Relevant columns/Pk
Cols: entity_id, year_month
What we want is that the procedure should not delete records that related to financial years that are closed.
How would I write a delete statement to do that?
Regards, ImranHi,
957 posts, but still while posting a question, you have not
1) Posted the table structure of all the tables involved. (create statement)
2) Posted the sample input (insert statement)
3) Posted the sample output.
4) More importantanly posted on the correct forum.
Regards
Anurag Tibrewal. -
Displaying ALV agan with deleted record not shown....
Hello Gurus,
I am working on ALV. The ALV deipalys data froma custom table. Now I have created a Button in application toollbar saying 'Delete'. I have wrirren logic in 'ALV_UC (i_callback_user_command) so that when user pushes 'Delete' button, the data record gets deleted from custom table.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = lv_progname
i_callback_pf_status_set = 'ALV_STAT'
i_callback_user_command = 'ALV_UC'
* i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = is_layout
it_fieldcat = field_lst
* is_variant = g_variant
it_event_exit = gt_event_exit
i_save = 'A'
it_sort = it_sort
i_screen_start_column = i_start_col
i_screen_start_line = i_start_ln
i_screen_end_column = i_end_col
i_screen_end_line = i_end_ln
tables
t_outtab = p_outtab
exceptions
program_error = 1
others = 2.
Now, I want the ALV to be dsiplayed with that deleted record not shown. How can I do this ? Is there a Refresh function or something ?
Thanks.
Regards,
Rajesh.Hello Rajesh
A quick view into the documentation of IMPORTING parameter I_CALLBACK_USER_COMMAND would have answered your question:
Within the USER_COMMAND callback routine set
REFRESH = 'X'. " That's all
EXIT routine for command handling
Description
Passing an EXIT routine indicates to the ALV that the application wants
to respond to certain function codes.
Generally, these are function codes that are unknown to the ALV (that
is, are not standard ALV functions) and that were defined and set by a
user status.
See also the documentation on parameter I_CALLBACK_PF_STATUS_SET.
The interface of the form routine specified must be defined as follows:
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Parameter R_UCOMM contains the function code triggered.
Structure RS_SELFIELD contains the following information:
o tabname : Name of the internal output table
o tabindex : Index of the internal output table
o fieldname: Field name
o endsum : Cursor is located on the totals line
o sumindex : If >0, the cursor is located on a subtotals line
o value : Value of the field on the list
o refresh : (Exporting) List should be set up again
o col_stable:(Exporting) Keep column position when list is set up
again
o row_stable:(Exporting) Keep row position when list is set up again
o exit :(Exporting) Exit list (and ALV)
o before_action: Call before standard action execution
o after_action : Call after standard action execution, before list
setup
o ignore_multi : Internal use
o sel_tab_field: Internal use
The EXIT routine is called whenever a function unknown to the ALV is
triggered or if the routine call before/after the execution of a
standard function code has been defined by interface parameter
IT_EVENT_EXIT.
See also the documentation on parameter IT_EVENT_EXIT.
The function code and the current cursor position are then passed on to
the calling program through the EXIT routine.
If the user has selected multiple rows by selecting checkboxes, the
output table field designated as the checkbox contains the current state
of the checkbox in the list.
Regards
Uwe -
SM30 - Deleting a record with Foriegn Key Constraints
I have a two custom tables ZCCED_STATUS and ZCCED_COSTITEM.
ZCCED_COSTITEM has a status column with a foriegn key to a (PK) status record in ZCCED_STATUS.
I have generated table maintenance objects for the table ZCCED_STATUS.
When I go to SM30 and maintain the table ZCCED_STATUS I can select a status record and delete it. (still ZCCED_COSTITEM records using that status)
Is there any way that SM30 can warn or stop a user from deleting a ZCCED_STATUS record when there are child records in the ZCCED_COSTITEM table?
Regards,Create a maintenance view , link both tables and generate a table maintenance for the maintenance view . it will work.
-
How to deal with delete record in generic delta of generic datasource
Hi,
Anyone can give me suggestion about the delete record in generic delta of generic data. I need extract data with a generic datasource and hope deleted record in datasource also can be "delete" in next delta extraction. I do a test with generic delta. It seem that the delete record can not be updated in ODS. but updated record can be updated in next delta extraction.
How dose BW generic delta deal with the deleted record with generic delta mechanisim? Or how can I use generic delta mechanisim to realize that BW "delete" the deleted record of source system in ODS with delta extraction?
Thanks in advance!
BillyDelete is not supported in delta mechanism of generic delta extractor. You will need to add a workaround for that.
- Capture the deleted records somewhere (maybe enhance the txn deleting the record so the key is written to a Z table). Take these records to BW and manipulate the recordmode to affect deletion of corresponding record from ODS.
- If your generic delta is based on FM, and if the 'delete' is captured in change document tables, add the logic to check change document tables whether any records are deleted, and if yes, send those to BW with appropriate recordmode to achieve deletion. -
Inbund IDOC error: Status records with status 51 after status 53
Hi all,
I'm looking to resolve an issue related to posting an inbound IDOC. when I process inbound IDOC created from report prg I'm getting a status message: "Status records with status 51 after 53" .
Functionality: I'm creating an IDOC from flat file and processing it to post Customer master data into SAP. During this process creation of IDOC is successful but when I'm changing the existing data record (customer master data) IDOC is throwing this error.
Changing data: For changing existing data I'm passing KUNNR field and overwriting the remaining data. Even though the idoc status is 51 the changed data is getting posted in to SAP. Here my concern is to see IDOC status as 53.
Regards,
Ganesh.
Edited by: Ganesh Sunkara on Aug 1, 2009 3:45 AMHi all,
I solved this issue by myself. There is an error in the user exit code.
regards,
Ganesh. -
How to delete Pending WIP Move Transactions with running status
hello,
can any one guide me, how to delete Pending WIP Move Transactions with running status
thanks in advance
sadiqPlease refer to the following note:
Note: 105647.1 - WIP and COST Frequently Used Troubleshooting Scripts
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=105647.1 -
SUN TEAM: Bugs in update and delete a record with long query
Creator Team,
In my opinio there is a bug issue with update and delete a record with a complex sql query. I�m using oracleXE and ojdbc14.ar with tomcat
In just two page I�m receving the following msg (I have 12 pages doing the same thing with less complex queries)
* Number of conflicts while synchronizing: 1 SyncResolver.DELETE_ROW_CONFLICT row 2 won't delete as values in database have changed: 2006-11-29
* Cannot commit changes: Number of conflicts while synchronizing: 1 SyncResolver.UPDATE_ROW_CONFLICT row 0 values changed in database
when i tried to delete or commit the updated changes in the register...
The interesting is that this code function with jdbc of jsc...
My query is bellow:
SELECT ALL PATRIMONIO.TB_BEM.INCODIGOBEM,
PATRIMONIO.TB_BEM.VATOMBAMENTO,
PATRIMONIO.TB_BEM.VAMATERIAL,
PATRIMONIO.TB_BEM.INCODIGOSETOR,
PATRIMONIO.TB_SETOR.VANOME AS NOMESETOR,
PATRIMONIO.TB_BEM.INCODIGOFORNECEDOR,
PATRIMONIO.TB_FORNECEDOR.VANOME AS NOMEFORNECEDOR,
PATRIMONIO.TB_BEM.DACHEGADA ,
PATRIMONIO.TB_BEM.DASAIDAPREVISTA,
PATRIMONIO.TB_BEM.DASAIDAEFETIVA,
PATRIMONIO.TB_BEM.VAMARCA,
PATRIMONIO.TB_BEM.VAMODELO,
PATRIMONIO.TB_BEM.VADESBAIXABEM,
PATRIMONIO.TB_BEM.INCODIGOTIPOAQUISICAO,
PATRIMONIO.TB_TIPOAQUISICAO.VANOME AS NOMETIPOAQUISICAO
FROM PATRIMONIO.TB_BEM , PATRIMONIO.TB_TIPOAQUISICAO, PATRIMONIO.TB_SETOR, PATRIMONIO.TB_FORNECEDOR
WHERE PATRIMONIO.TB_BEM.INCODIGOTIPOAQUISICAO = PATRIMONIO.TB_TIPOAQUISICAO.INCODIGOTIPOAQUISICAO
AND PATRIMONIO.TB_BEM.INCODIGOSETOR = PATRIMONIO.TB_SETOR.INCODIGOSETOR
AND PATRIMONIO.TB_BEM.INCODIGOFORNECEDOR = PATRIMONIO.TB_FORNECEDOR.INCODIGOFORNECEDOR
AND PATRIMONIO.TB_BEM.INCODIGOBEM LIKE ?
AND PATRIMONIO.TB_BEM.VATOMBAMENTO LIKE ?
AND PATRIMONIO.TB_BEM.VAMATERIAL LIKE ?
AND PATRIMONIO.TB_SETOR.VANOME LIKE ?
AND PATRIMONIO.TB_FORNECEDOR.VANOME LIKE ?
ORDER BY PATRIMONIO.TB_BEM.VATOMBAMENTO ASC
Why this problem is happing? Did you had some solution for that? Is the problem because the query is too long?!
please help me!
Gustavo CallouHello people,
I�m doing this to try to solution that bug:
This code is working fine... but I do not understand why I�m receiving the nullpointer exception!??!!?
// create a new rowset
CachedRowSetXImpl pkRowSet = new CachedRowSetXImpl();
try {
RowKey rk = tableRowGroup1.getRowKey();
if (rk != null) {
// set the rowset to use the Patrimonio database
pkRowSet.setDataSourceName("java:comp/env/jdbc/Patrimonio");
String query = "DELETE FROM TB_BEM WHERE INCODIGOBEM = "+tb_bemDataProvider.getValue("INCODIGOBEM", rk).toString();
pkRowSet.setCommand(query);
pkRowSet.setTableName("TB_BEM");
// execute the rowset -- which will contain a single row and single column
pkRowSet.execute();
pkRowSet.next();
info("Apagado");
} catch (Exception ex) {
log("ErrorDescription", ex);
error(getApplicationBean1().trateException(ex.getMessage()));
} finally {
pkRowSet.close();
Please someone help me!!!
Gustavo Callou -
How to update Cube witha deletion of a record in ECC
Hi
I am extracting Data from ECC using a ZZ Datasource based on a View
Data Flow in BW
ECC(ZZ EXTractor)-->DSO1(Full)->DSO2(Delta)----.Cube(Delta)
Scenario:
Lets say today i loaded Records A,B,C,D to Cube
In ECC C & D Records are deleted
How can i replicate those deletions in CUBE
Thanksif you do a complete full load from r/3 to your dso1 (assuming it's not W-O), then with the activation of the dso request, the generated delta will contain the deletion of the two records (ie all KF put to 0). your next delta will be correct. if you actually want to delete the line from cube, i think you have no other option then to do full delete of the cube data and only do full loads from T/3 to cube
M. -
Error message B1 357-Status records with status 51 after status 53
Hi All,
somebody knows why is can be caused this message:
''Error message B1 357-Status records with status 51 after status 53''
Thanks and best regards
LDear Luis,
Please Check
Status records with status 51 after status 53
Best Regards,
Amit -
Can I retrieve a deleted video that was recorded with my iPad and not backed up?
I deleted a video that was recorded with my iPad & was not backed up. Is there any way to retrieve it?
No.
-
Count total number of record of table with deletion from archiving object
Does anyone know is there any SAP standard program to count the total number of record of the table with deletion from Archiving Object and display in repprt?
Not sure of the question. Are you looking to get the sql "select count(*) from table" from using the TopLink expression framework or are you getting that SQL already and want something else?
If you are looking just to get the count from a table/class, you can use a ReportQuery:
ReportQuery rquery = new ReportQuery(ClassToQueryOn.class);
rquery.addCount(); //equivalent to count(*);
session.executeQuery(rquery);
You can use a report query to return data instead of objects, and use selection criteria just like a normal read query.
Best Regards,
Chris -
Inventory record is deleted but quant is in 'Not counted' status within Bin
Hi Gurus,
I have a problem which is related to Inventory count in warehouse. The Bins are showing certain Inventory number is as not counted ( against the quant in Inventory tab of Bin) . But when I go to the Inventory record, I find it's deleted. For an ideal situation when an Inventory record is deleted, the bin should update the quant as Cancelled aginst the Inventory number, in the Invent. tab on Bin. But instead this is updated as 'Not counted'.
This is causing me a problem regarding any transfer transfer of those stocks since in the LQUA table the Inventory Active is checked.
Can you please help me.
Thanks in advance
Amithi pavan,
whats happening is just to give u an idea about my tables, i have
SELECT prod_code, prod_name, prod_qty_in_hand from product_MASTER
PROD_C PROD_NAME PROD_QTY_IN_HAND
2002 PROD2 10.000
2003 PROD3 20.000
2004 PROD4 30.000i have a master-detail Form for PURCHASE_ORDER_HEADER & PURCHASE_ORDER_DETAIL
(with Delete Record Behavior property set as Cascading),
for example lets say if i have record like
SQL> SELECT POH_CODE,POH_NO, POH_PARTY_CODE FROM purchase_ORDER_HEADER;
POH_CO POH_NO POH_PA
PUR 1.000 1001
SQL> SELECT POD_POH_CODE,POD_POH_NO,POD_PROD_CODE,POD_QTY FROM purchase_ORDER_DETAIL;
POD_PO POD_POH_NO POD_PR POD_QTY
PUR 1.000 2002 5.000
PUR 1.000 2003 8.000
PUR 1.000 2004 10.000whats happening is, on form when i am querying record, lets say i want to delete the PO_header record no.1,
it should obviously delete the 3 records of PO_Detail (due to cascade property), and also, reduce the prod_qty_in_hand field for the 3 items 2002,2003 & 2004 (deleted from the PO_detail above), from the PRODUCT_MASTER Table, to 5,12 & 20 respectively.
i am able to update the prod_qty_in_hand , if after query, i go in the detail section & delete a particular record, but can't do it at header level with given the pre-delete code that i posted in my first post.
hope i am -
Hi, I am trying to implement custom hold order / send to in sharepoint 2010 to send files in to holds / record center.
I am at the last step where I am trying submit the metadata using soap call- submit file
[SoapDocumentMethod("http://schemas.microsoft.com/sharepoint/soap/recordsrepository/SubmitFile", RequestNamespace = "http://schemas.microsoft.com/sharepoint/soap/recordsrepository/", ResponseNamespace = "http://schemas.microsoft.com/sharepoint/soap/recordsrepository/", Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public string SubmitFile([XmlElement(DataType = "base64Binary")] byte[] fileToSubmit, [XmlArrayItem(IsNullable = false)] Microsoft.SharePoint.RecordsRepositoryProperty[] properties, string recordRouting, string sourceUrl, string userName)
return (string)base.Invoke("SubmitFile", new object[] { fileToSubmit, properties, recordRouting, sourceUrl, userName })[0];
I am getting an error "The request failed with http status 401: Unauthorized".
Actual file was transferred successfully but while transferring the properties (metadata) I am getting this exception.
ganeshHi ganesh,
Please try to disable the loop back check, compare the result:
In Registry Editor, locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
Right-click Lsa, point to New, and then click DWORD Value.
Type DisableLoopbackCheck, and then press ENTER.
Right-click DisableLoopbackCheck, and then click Modify.
In the Value data box, type 1, and then click OK.
Quit Registry Editor, and then restart your computer.
In addition, please check if these links are useful:
http://www.sharepointpills.com/2011/10/send-sharepoint-2010-document-to.html
http://www.codeproject.com/Articles/497729/UploadingplusDocumentsplusProgramaticallyplustoplu
I hope this helps.
Thanks,
Wendy
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Wendy Li
TechNet Community Support
Maybe you are looking for
-
Urgent: need weekly, monthly report function in 6i for 10g
Hi, we are trying to move some reports built in 6i to 10g. Need some help urgently. The y-axis is values, x-axis is date, if there is a value between 2 dates, , a line will connect them. If there is no value, it will skip it and try next date. I have
-
How can i recover or reset my oracle 10g user password?
Hi Scolars, How can i reset or recover my oracle 10.2.0 database user password? I have system or sys user password for the same database. I want to just recover the user password only. hlep me please..
-
Ipod needs to be restored, but itunes wont do it!
my ipod needs to be restored so i can sync it. it doesnt even show up as anything other than "ipod" with no information about the ipod. when i click restore i has an error message saying: "there was a problem downloading the ipod software for 'ipod'.
-
Hello On my computer, whenever I try to playback somehting to see a preview, it plays at 17 frames per second, with red text saying, Not in realtime. Is there anyway that this can be remedied?
-
We have a mac book purchased in 2007 System Version: Mac OS X 10.4.11 (8S2167) Kernel Version: Darwin 8.11.1 Which OS X version should we or can we upgrade to?