Selctive Deletion of Production Data
Hi,
Is it possible to selectively delete the data from Solution Manager infocubes? (like systemwise, datewise ) we have a requirement from customer where they want the Production Solution data to be fresh from the day of Go Live. Whatever the
data(EWAs,Reporting,Alerts...etc) that is already present in the Solution Manager System for production systems needs to be erased. We do not want to delete entire solution. How do we acieve this?
Regards
Vivek
Dear Pankaj,
Plz refer the below links
[http://forums.sdn.sap.com/click.jspa?searchID=33491224&messageID=4110748]
[production version deletion;
Regards
kumar
Similar Messages
-
Hi,
Currently we have a data error issue.Hence we need to delete the entire data and reload it again.Currently we have delta loads.Can you please provide us with the best possible way to delete and reload the data.
We are thinking of deleting the data and then doing a init load t start with and then do a delta load later.Is it fine?
Also ,can you please tell us about wht we need to do in the source sytem with the SETUP and all.
Thanks,
SamirSince you have data error issues.
You have to do reinit and load data from source system
To do this :
1) First of all delete your old init.
2) Pull data from outbound queues using job control if its LO.
3) Get a quiet period.
4) Fill set up tables in this quiet period.
5) Do Init.
6) Later on schedule job control
7)Pull deltas
Hope this helps. -
Deletion of master data for 0CS_ORDER
Hello Friends,
I have a requirement to enhance an IOBJ 0CS_ORDER with Order status values(2 new statues are added). I have done the enhancement part to the extractor in the source system side. Now after replication in BW, to add 2 new IOBJs in CS_ORDER, I need to delete the master data.
When I try to do this, I get the msg that some master data could not be deleted.
This is fine as we have transaction data loaded for large no. of objects which has 0CS_ORDER.
In dev, I have deleted the master data using SE14 for tables P, S , X, T.
My concern is in Production, I have huge volume of transaction data. To transport the changes, I need to delete master data. But this would require deletion of Transaction data from all IP where CS_ORDER is used.
If I do so using SE14, and tranport the changes and later load MD to CS_ORDER. Will this cause INCONSISTENCIES?
What can be other possible ways??
Please share your opinions.
Many Thanks,
VA
Edited by: Vishwa Anand on Sep 2, 2010 5:36 PMDefinitely Yes.
It will damage all the SID connections earlier which this master data had with the other objects likes transactiona objects (ODS, CUBES etc). Even You can not access the data from the cube or ODS where the navigational attributes are flagged for reading.
So do not use SE14 for deletion of MD. This is very specific to use.
You can delete the Master data as long as its not been used in other targets so that you can refill it easily and also there wont be any inconsistencies..
Hope this is clear for you.. -
Deletion of master data with / without SID
Hi Experts,
Client have requested for master data clean up.
Requirement:
"Several masterdata tables in Production system contain wrong entries. These entries should be cleaned up. The attached Excel contains the keys of the entries to be deleted"
Steps to be taken:
1. emptied/deleted content of all the cube.
2. delete data from master data
Help required:
What will be impact of deleting master data with SID when DSO data is not deleted.
What if i choose without SID option for deletiing master data
Regards
Suresh KumarHi Suresh,
Deleting master data is one critical job and ned to be very care ful.
First try to find out the where used list of that particular IO. delete data from all the CUBEs and DSOs. i don't think without deleting the transaction data from all the objects that you see from where used list, you will be able to delete the maste data.
System doesn't allow you, it will say "Not all selected data is deleted" Some message of this sort when you try deleting the master data.
If you are deleting the TD and master data, why do you need the SID to be spared, delete them too. next time you load the correct master data. the SIDs are again generated.
Go thru the below thread, this gives you lot if info on MD deletion.
[Re: SID Tables] -
Delete Customer Master Data OBR2
Hi
I'm using LSMW to import data. I would like to delete it afterwards. Transaction OBR2 which is in spro Financial Accounting (New) -> Accounts Receivable And Payable -> Customer Accounts -> Master Data -> Delete Customer master data.
But it does not delete the sales are segment, it also does not allow me to delete general data if sales segment exists.
Can anyone please let me know if there is another way around this? Any other way to delete this test data???
Thanks in advanceHi
Please go through the SAP documentation on how to perform deletion of customer master data.
This may help you in executing the function correctly.
<b>Delete Customer Master Data</b>
In this activity, you delete the master records for customers by using a program. Only use this program in the test phase.
Note
The company code for which master records are to be deleted, may not yet be flagged as productive.
Only master records for accounts which do not have any transaction data may be deleted.
Requirements
The general customer master data is only deleted for customers who are not also created as customers in Sales and Distribution.
Activities
Delete the master records for the required company codes.
Additional information
Refer to the SAPF019 program documentation for further information on the program.
Deleting Master Data
Description
This program deletes master data in Financial Accounting and is designed for preparing the system for productive startup. It deletes:
Customer master data
Vendor master data
G/L account master data
You can run this program in three different ways:
1. Deleting general master data (in G/L accounts in one chart of accounts)
2. Deleting master data dependent on company code
3. Deleting general master data and master data dependent on company code
For each deletion run, you can specify whether or not the system should take into account the deletion flag in master records ("Delete per deletion flag only"). If it takes into account deletion flags, it uses the following standard logic:
Option 1: The "All areas" deletion flag must be set.
Option 2: The "Specified co. code" deletion flag must be set.
Option 3: It is sufficient to have the "All areas" deletion flag set.
Note: Deletion blocks are always checked at general data and company code-dependent data level. If there is a block at company code-dependent data level, then the general data is not deleted either. The deletion block takes precedence over the deletion flag.
General master data in Financial Accounting can also be used in other SAP applications:
Customer master data in Sales and Distribution
Vendor master data in Purchasing
G/L accounts as primary cost elements in Cost Accounting
The program deletes the following:
Change documents for master data
SAPscript text files
The following data is deleted for customers:
o General master data
o Bank details
o VAT registration numbers
o Addresses
o Classifications
o Credit management: across control areas
o Credit management: centrally
o Unloading points
o Tax indicators
o Contact persons
o Licenses
o Partner function limit
o Shipping data
o Master data in the company code
o Dunning data
o Linked data
The following data is deleted for vendors:
o General master data
o Bank details
o Contact persons
o VAT registration numbers
o Addresses
o Classifications
o Master data in the company code
o Dunning data
o Linked data
The following data is deleted for G/L accounts:
o General master data in the chart of accounts
o Names in the chart of accounts
o Key word list in the chart of accounts
o Master data in the company code
o Sample accounts, if selected
For customer and vendor contact persons, the addresses are not determined from central address management until the actual runtime. Therefore differences can arise as to the number of addresses in the detail log between the test run and the update run.
Automatic worklists for customers and vendors are also deleted with the general master data. Matchcodes are always deleted.
You may have to fix the number ranges after the program run.
The system makes changes to the database in the update run only. It will then also write a system log entry for documentation.
Requirements
General master data can only be deleted if no other application makes reference to the account. Use the resetting programs from
Sales and Distribution (customer master data)
Purchasing (vendor master data)
Cost Accounting (G/L account master data)
If you want to delete only general master data, master data dependent on company code cannot have been created in Financial Accounting.
If you want to delete master data in a test company code, master data dependent on company code cannot have been created in any other company code except the test company code. The productive indicator cannot be set for the company code.
If a customer or vendor is referenced by another customer or vendor (for example, via fiscal address or alternative payee), you can only delete the referenced master record by deleting the referencing master record at the same time.
Furthermore, you can only delete master data in Financial Accounting if no transactions have been posted to the corresponding accounts. If there are transaction figures in one of the selected accounts, you have to manually access and run program SAPF020 (reset transaction data from a company code) before you can delete that account.
Output
The log lists every table which is processed in the program selection.
You can also create a detail log for each account type to find out why certain data cannot be deleted. The detail logs show you what other company codes and applications use the data and how customers and vendors are linked to one another.
Note
Since deleting or displaying even smaller volumes of data can result in runtime problems, you should run this program as a background job. Currently, the program individually deletes matchcodes for each master record in the database. Several match code IDs refer to each matchcode. This can place a considerable load on the database.
You cannot delete transaction data in individual accounts.
Important: The archiving programs in Financial Accounting are designed for the productive system.
If you are running this deletion program for the first time, then you must start program SAPF047 before deletion in order to generate link information.
I hope this may be of help to you
Good Luck
Hari -
Deletion Of Production Order Collectively.
Hi Guys,
I want to delete my Production Orders Collectively,i know it can be done in CO78,Can any one plese tell me what are the steps to be carried out in CO78.
I have 1 FERT material (Productoin Order)
and 11 HALB material (Production Order)...all the production order to be delete collectively.
Awaiting a positive reply from this thread.
Regards,
Kumar.SDear,
Please follow these steps
1. Use program PPARCHP1 to activate deletion flag and deletion indicator.
2. Use program PPARCHA1 to archive the production order.(Basis settings should be completed for storage of data before running this program).
3. Use program PPARCHD1 to delete the order from the database.
You can run this program from SE38 or using background scheduling using SM36.
Note :- Archive the production order thru tcode CO78.
Variant for PPARCHD1 remove the Test Mode. System will automatically select the Archive File based on the File Path. Also see SAP notes 540834
Regards,
R.Brahmankar -
Cascade delete of products in APO
Hi,
I´m wondering if there are predefined ways for deleting a product and all it´s dependencies totally in APO. (Cascading deletion). I.e. setting a flag in the product master and getting rid of all connected PPM:s, location/product split, quota arrangements etc etc... Anybody knows how to do this efficiently?
BR
KarlHi,
I wish SAP has provided something like this.
UNfortunately there is no one button where in you can delete all the dependencies
Let me list you the steps to my best knowledge
(1) Supply Chain Engineer -- TRansaction-- /n/sapapo/SCC07
You can delete most of what you have asked
Location, LOcation Product, Product, Resource, Trans Lane, PPM
(2) Remember before this step, you will have to delete all the orders in all versions for this particular product location.
Use report: /sapapo/rlcdelete to do this.
Sometimes not all the orders get deleted and when you try to delete the master data in SCEngineer, it will say that there are dependencies.
Then you would have to use the " WHERE USED LIST" for each master data and then it will display you the order numbers.
You would have to manually delete each order number using the RLCDELETE report.
Hope this helps.
Regards
Kumar -
Physical Inventory Document deletion in Production system
Hi Friends,
There is an physical inventory document # xxxxxxxxx from 2003, which has
also posting block, which is likely to cause that couple of materials
can not be maintained.
Now This document needs to be simply deleted in tx
MI02. I tried this in Test system and did not have any trouble.
However I am not sure can i do the deletion in Production system..??
Pleae guide me is there any problem in production to cancel this Document.
What type of precations i need to take care in Production system.
Brgds,
RKHi there
You can delete it directly, it is not an issue, if you want to cross check ( if the material with CC), you can run in MICn for those materials and generate session page you can see for avail for the generate session to create the new PI/CC (based on the Last count date as the older one, not the recently counted and deleted,,)
Hope it helps
Senthil -
Dear SAP Gurus,
Can anyone suggest how can i delete multiple products in one go.
As i had to delete around 10000 products out of 30000 from the dtabase of SAP CRM.
The report available in CRM is either to delete the single product or the multiple product.
As i have not much idea of coding, therefore i'm unable to delete the multiple products in one go.
Can anyone please suggest how can i do this deletion.
Best Regards,
JatinHi,
COM_PRODUCT_DELETE_ALL Used to delete product master data.
COM_PRODUCT_DELETE_SINGLE Used to delete product master data.
For executing above reports please register your user id and program names in below table then only you can execute above reports.COMC_PR_TOOL_REG
Regards
Vinod -
Disk Utility - delete RAID killed data on drives before server install
OK. Here's the scenario.
I had a Dual 1G G4 with a fully functioning RAID 1 installed. So I attempted to do an install of Leopard Server. It came up with a message that said something like "OS X could not prepare disk for installation." After reading some forum posts, one guy said that he was able to install Leopard by deleting the RAID, thus splitting the RAID into two volumes. So I booted from the DVD again, and this time it reports that the RAID is degraded, and that the second drive in the RAID set is a "spare."
This seemed odd, but I figured if I delete the RAID set it would keep the section that had all the good data on it. That's when my world went to ****.
Once it deleted the RAID set, and the message came up prompting me that I would NOT lose my data, it went ahead and deleted all my data. Perhaps replacing the good volume with the so-called spare. So I have been trying in vain to get the data back. The one product that I own, DiskWarrior, does not see the drives as volumes. So it won't work. Anyone have any ideas?
There was not a LOT of data on the drive, but there was a lot of complicated web shares and a few IMPORTANT websites that I need to get back. And, yes, I do not have a current backup of the volume. I was riding the RAID 1 cushion way too hard.It would seem that I have the answer, and I believe that this is a MAJOR problem that Apple should address with some kind of warning to its customers. The RAID set I deleted was an Apple RAID 1.0 set. Upon reading further into the documentation, I see that RAID 2.0 sets can be deleted, and the volumes split into two. But with RAID 1.0 sets, the data is lost when you delete a volume.
So, even though I was deleting the set in 10.5, it seems to have applied the rules for RAID 1.0.
http://docs.info.apple.com/article.html?path=RaidUtility/1.0/en/s1ru11.html
I am hoping that there is a way to recover my data, but i'm not too hopeful. -
Hi Experts
Is there a transaction (or any other means) in BW to delete all data (transactional and master data)at once?
I have to clear out our sandbox client now that the R/3 prototype systems have been cleaned up and revised, and would like to do the job as efficently as possible.
Thanking you in advance.
Regards
SeanI had this issue a while back and there is no standard transaction to do this. However, what we came up with was a simplish process as follows because we had to do this on a bi weekly basis whenever we refreshed from production:
-Delete all transactional data manually,
-Collate the tablenames of all the MD objects (by looking at a table which had the meta data for these), and downloaded them to a excel spreadsheet.
- Then create a CAT script which uses SE14 (and the table names from the spreadsheet) to delete the master data and SID table.... -
Can we Delete the Product/Material from Product Master in CRM
Hi Gurus,
I want to delete some test products from Product master, I don't see any link for delete there in product master transaction.
Can we Delete the Product from Product Master in CRM??
Thanks in Advance.
Regards,
Manoj TiwariTry this:
*& Report ZVB_PRODUCT_DELETE (release CRM 4.0 SP03) *
*& Instructions are in OSS Note #427332 *
report zvb_product_delete line-size 300.
const, include
include com_product_const001.
include com_product_const003.
include com_product_const009.
include com_product_const011.
include com_settype_attribute_const03.
tables: comm_iproduct, "#EC NEEDED
comm_product.
constants:
gc_program type programm value 'COM_PRODUCT_DELETE_SINGLE'.
data: gv_product_guid type comt_product_guid,
gv_prty type comt_product_type,
gv_syslog(70) type c,
lv_mobile_active type comt_boolean,
lv_delete type comt_boolean value 'X'.
data: lt_settypes type comt_frgtype_tab_ext,
lt_status_guid type comt_prd_status_guid_tab.
data: begin of lt_products occurs 0,
product_id like comm_product-product_id,
product_guid like comm_product-product_guid,
end of lt_products.
Screen User query
selection-screen comment /1(60) text-006.
selection-screen skip 2.
select-options: s_prid for comm_product-product_id.
*parameters: p_prid type comt_product_id obligatory,
parameters: p_prty type comt_product_type obligatory default '01',
p_logs type comt_logsys obligatory,
p_objf type comt_product_object_family,
p_send as checkbox modif id 001 default on,
p_usage as checkbox modif id 001 default off,
p_test as checkbox default 'X'.
at selection-screen output.
perform check_mobile_download
changing lv_mobile_active.
if lv_mobile_active is initial.
loop at screen.
check screen-group1 = '001'. "disable field p_send, p_usage
screen-active = '0'.
modify screen.
endloop.
endif.
start-of-selection.
perform check_authority.
Write syslog entry
concatenate 'Rep. ' sy-repid ': ' p_prid(30) '/' p_prty '/' p_logs
into gv_syslog. "#EC NOTEXT
call 'C_WRITE_SYSLOG_ENTRY'
id 'TYP' field ' '
id 'KEY' field 'C00'
id 'DATA' field gv_syslog .
inactive product are not supported here
select * from comm_iproduct
where product_id = p_prid
and product_type = p_prty
and object_family = p_objf
and logsys = p_logs.
endselect.
if sy-subrc = 0.
write: / text-001, text-005.
exit.
endif.
read products according to the selection criteria
select * from comm_product
into corresponding fields of table lt_products
where product_id in s_prid
and product_type = p_prty
and object_family = p_objf
and logsys = p_logs.
if sy-subrc ne 0.
write: / text-010.
exit.
endif.
loop at lt_products.
read product and enqueue
perform product_enqueue
using lt_products-product_id
p_prty
p_logs
p_objf
changing gv_product_guid
gv_prty.
check not gv_product_guid is initial.
if p_usage = on.
perform check_usage
using gv_product_guid
changing lv_delete.
endif.
check lv_delete = on.
check p_test = space.
first delete the component of the IBase
perform delete_ibasecomponent
using gv_product_guid.
perform delete_extensions
using gv_product_guid
lt_settypes.
perform delete_settypes
using gv_product_guid
lt_settypes
changing lt_status_guid.
perform delete_interlinkages
using gv_product_guid.
perform delete_pme_data "multivalue attributes
using gv_product_guid.
perform delete_decoupled_data "long text, longmatnr,
using gv_product_guid. "ibase prodvar,...
perform delete_status
using lt_status_guid.
perform delete_favorites
using gv_product_guid.
perform delete_clear_case
using gv_product_guid.
if p_send = 'X'.
perform send_deletion_to_mw
using gv_product_guid.
endif.
delete from comm_product where product_guid = gv_product_guid.
delete from comm_producth where product_guid = gv_product_guid.
delete from comm_product_idx where product_guid = gv_product_guid.
delete from comm_prwb_user_2 client specified
where client = sy-mandt and last_object = gv_product_guid.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
write: / text-001, lt_products-product_id, text-004.
endloop.
*& Form product
form product_enqueue
using iv_prid type comt_product_id
iv_prty type comt_product_type
iv_logs type comt_logsys
iv_objf type comt_product_object_family
changing ev_pguid type comt_product_guid
ev_prty type comt_product_type.
data ls_product type comt_product.
call function 'COM_PRODUCT_GUID_GET'
exporting
iv_product_id = iv_prid
iv_product_type = iv_prty
iv_logsys = iv_logs
iv_object_family = iv_objf
iv_show_popup = 'X'
importing
ev_product_guid = ev_pguid
exceptions
not_found = 1
wrong_call = 2
internal_error = 3
others = 4.
if sy-subrc <> 0.
write: / text-001, space, iv_prid.
write: text-003. "Product not found
exit.
else.
write: / text-001, space, iv_prid.
write: text-002. "Product found
endif.
call function 'COM_PRODUCT_READ_SINGLE'
exporting
iv_product_guid = ev_pguid
iv_enqueue_mode = ' '
importing
es_product = ls_product
exceptions
not_found = 1
wrong_call = 2
foreign_lock = 3
enqueue_failed = 4
others = 5.
if sy-subrc <> 0.
if sy-subrc > 2.
write: / text-001, space, iv_prid.
write: text-007. "Product enqueued
exit.
else.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
exit.
endif.
exit.
endif.
ev_prty = ls_product-product_type.
special authotirty check (with considering the assigned
categories)
call function 'COM_PRODUCT_CT_AUTHORITY_CHECK'
exporting
iv_auth_act = '06'
iv_product_guid = ev_pguid
exceptions
no_authority = 1
wrong_call = 2
internal_error = 3
others = 4.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " product
*& Form delete_extensions
form delete_extensions
using iv_product_guid type comt_product_guid
et_settype type comt_frgtype_tab_ext.
data: lv_db_tab type ddobjname,
lv_subrc_pr_guid like sy-subrc,
table_name_ref type ref to data,
lt_extension type comt_frgtype_tab_ext,
ls_extension type comm_frgtype_ext.
field-symbols: <table_name> type any,
<field_name> type any.
check not iv_product_guid is initial.
delete extensions e.g. COMM_PRFREEATTR, CRMM_PR_TAX, COMM_PR_UNIT,
COMM_PR_SHTEXT,COMM_PR_GTIN, comm_prprdcatr,..
perform load_extensions
using iv_product_guid
changing lt_extension
et_settype.
loop at lt_extension into ls_extension.
lv_db_tab = ls_extension-frgtype_tab.
check not lv_db_tab is initial. "CRM_CAT_SAT & CRM_CAT_PUR
does table exist ?
call function 'DDIF_NAMETAB_GET'
exporting
tabname = lv_db_tab
exceptions
not_found = 1
others = 2.
check sy-subrc = 0.
Due to any reason (I don't know why) sometimes we have product_guid
and sometimes we have frg_guid as name of the key field.
create data table_name_ref type (lv_db_tab).
assign table_name_ref->* to <table_name>.
assign component 'PRODUCT_GUID' of structure <table_name>
to <field_name>.
lv_subrc_pr_guid = sy-subrc.
if lv_subrc_pr_guid = 0.
delete from (lv_db_tab)
where product_guid = iv_product_guid.
else.
delete from (lv_db_tab)
where frg_guid = iv_product_guid.
endif.
delete history of extension table
concatenate ls_extension-frgtype_tab 'H' into lv_db_tab.
create data table_name_ref type (lv_db_tab).
assign table_name_ref->* to <table_name>.
assign component 'LOGSYS' of structure <table_name>
to <field_name>.
check sy-subrc = 0.
call function 'DDIF_NAMETAB_GET'
exporting
tabname = lv_db_tab
exceptions
not_found = 1
others = 2.
check sy-subrc = 0.
if lv_subrc_pr_guid = 0.
delete from (lv_db_tab)
where product_guid = iv_product_guid.
else.
delete from (lv_db_tab)
where frg_guid = iv_product_guid.
endif.
endloop. " end of loop for all extensions
endform. " delete_extensions
*& Form delete_settypes
form delete_settypes
using iv_product_guid type comt_product_guid
it_settypes type comt_frgtype_tab_ext
changing et_status_guid type comt_prd_status_guid_tab.
data: ls_reldesc type coms_pr_org_rel,
lt_reldesc type comt_pr_org_rel_tab,
lt_reltab type ref to data,
ls_settype type comt_settype_ext,
ls_table type tabname,
ls_status_guid type crmt_object_guid.
field-symbols:
<fs_reltab> type any table,
<fs_relrow> type any,
<fs_settype> type comt_frgtype_guid,
<fs_setguid> type comt_frg_guid,
<fs_statguid> type crmt_object_guid.
memorise product status guide
ls_status_guid = iv_product_guid.
append ls_status_guid to et_status_guid.
load description of relation tables
call method cl_com_product_org_type=>comc_pr_org_link_read_all
importing
et_pr_org_rel = lt_reldesc
exceptions
no_desc = 0.
for all relation types (e.g. comm_pr_frg_rel, comm_pr_frg_rod)
loop at lt_reldesc into ls_reldesc.
read product/settype relations
create data lt_reltab type (ls_reldesc-link_table_ttyp).
assign lt_reltab->* to <fs_reltab>.
call function ls_reldesc-func_rel_read_pr
exporting
iv_product_guid = iv_product_guid
importing
et_rel = <fs_reltab>
exceptions
wrong_call = 1
not_found = 2
others = 3.
check sy-subrc = 0.
for all links...
loop at <fs_reltab> assigning <fs_relrow>.
assign component 'FRAGMENT_TYPE' of structure <fs_relrow>
to <fs_settype>.
assign component 'FRAGMENT_GUID' of structure <fs_relrow>
to <fs_setguid>.
assign component 'STATUS_OBJECT' of structure <fs_relrow>
to <fs_statguid>.
read table it_settypes with key frgtype_guid = <fs_settype>
into ls_settype.
check sy-subrc = 0.
settype table
delete from (ls_settype-frgtype_tab)
where frg_guid = <fs_setguid>.
history table
concatenate ls_settype-frgtype_tab 'H' into ls_table.
delete from (ls_table)
where frg_guid = <fs_setguid>.
memorise settype status guide
if not <fs_statguid> is initial.
ls_status_guid = <fs_statguid>.
append ls_status_guid to et_status_guid.
endif.
endloop. "of links
relation table (e.g. comm_pr_frg_rel)
delete from (ls_reldesc-link_table)
where product_guid = iv_product_guid.
history table
concatenate ls_reldesc-link_table 'H' into ls_table.
delete from (ls_table) where product_guid = iv_product_guid.
endloop. " of relation types
endform. " delete_settypes
*& Form delete_interlinkages
form delete_interlinkages
using iv_product_guid type comt_product_guid.
constants: cv_db_name(8) type c value 'COMM_IL_',
cv_suffix_h(2) type c value '_H'.
data: lt_ilinks type comt_il_data_tab,
lt_reltype type comc_il_reltype_tab with header line,
lv_ddictype type dd02v-tabclass,
lv_dbname type comt_structure.
CHECK p_objf IS INITIAL.
first we have to read all ILs where the productguid is sourceguid
refresh lt_ilinks.
call function 'COM_IL_API_WHERE_USED'
exporting
iv_objectguid = iv_product_guid
iv_objtype = gc_bus_objtype_bus1178
iv_direction = 'S'
importing
et_interlinkage = lt_ilinks.
check not lt_ilinks[] is initial.
delete adjacent duplicates from lt_ilinks comparing reltype.
read ilinkage customizing
select * from comc_il_reltype into table lt_reltype
for all entries in lt_ilinks where reltyp = lt_ilinks-reltype.
delete interlinkages
loop at lt_reltype.
if lt_reltype-streltyp ne space.
concatenate cv_db_name lt_reltype-streltyp into lv_dbname.
else.
concatenate cv_db_name lt_reltype-reltyp into lv_dbname.
endif.
delete data
call function 'DDIF_NAMETAB_GET'
exporting
tabname = lv_dbname
importing
ddobjtype = lv_ddictype
exceptions
not_found = 1
others = 2.
check sy-subrc = 0 and lv_ddictype = 'TRANSP'. "#EC NOTEXT
delete from (lv_dbname) where sourceguid = iv_product_guid.
delete history
check lt_reltype-change_doc = 'X'.
concatenate lv_dbname cv_suffix_h into lv_dbname.
call function 'DDIF_NAMETAB_GET'
exporting
tabname = lv_dbname
importing
ddobjtype = lv_ddictype
exceptions
not_found = 1
others = 2.
check sy-subrc = 0 and lv_ddictype = 'TRANSP'. "#EC NOTEXT
delete from (lv_dbname) where sourceguid = iv_product_guid.
endloop.
endform. "delete_interlinkages
*& Form delete_pme_data
form delete_pme_data
using iv_product_guid type comt_product_guid.
delete multivalue attributes from PME
data: lt_pmemap like standard table of comm_pme_prd_map,
ls_pmemap like comm_pme_prd_map.
select * into table lt_pmemap
from comm_pme_prd_map
where crm_object_guid = iv_product_guid.
check sy-subrc = 0.
loop at lt_pmemap into ls_pmemap.
call function 'CRM_SCE_DB_KB_DELETE'
exporting
iv_kbid = ls_pmemap-kbid.
endloop.
delete comm_pme_prd_map from table lt_pmemap.
endform. "delete_pme_data
*& Form send_deletion_to_mw
form send_deletion_to_mw
using iv_product_guid type comt_product_guid.
data: cv_function_module like rs38l-name
value 'CRM_PROD_SEND_DELETION_MESSAGE'. "#EC NOTEXT
data: lt_product_guid type comt_product_s_tab with header line.
lt_product_guid-product_guid = iv_product_guid.
append lt_product_guid.
call function 'FUNCTION_EXISTS'
exporting
funcname = cv_function_module
exceptions
function_not_exist = 1
others = 2.
check sy-subrc = 0.
call function cv_function_module
exporting
it_product_guid = lt_product_guid[]
iv_test_only = space
exceptions
internal_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " send_deletion_to_mw
*& Form check_mobile_download
form check_mobile_download
changing ev_mobile_active type comt_boolean.
data:
cv_db_tab type ddobjname value 'SMOMARA'.
data: lv_lines type i value 0.
clear ev_mobile_active.
call function 'DDIF_NAMETAB_GET'
exporting
tabname = cv_db_tab
exceptions
not_found = 1
others = 2.
check sy-subrc = 0.
select count( * ) into lv_lines
from (cv_db_tab) up to 10 rows. "#EC CI_NOWHERE
if lv_lines > 0.
ev_mobile_active = on.
endif.
endform. " check_mobile_download
*& Form check_authority
form check_authority.
tables: t000, comc_pr_tool_reg. "#EC NEEDED
check productiv system - report must not be executed
select single * from t000 client specified "#EC CI_CLIENT
where mandt = sy-mandt.
if t000-cccategory = 'P'.
message e807(com_product) .
leave.
leave to transaction ' '.
endif.
Check authority for product delete
call function 'COM_PRODUCT_AUTHORITY_CHECK'
exporting
iv_auth_act = '06'
exceptions
no_authority = 1
wrong_call = 2
internal_error = 3
others = 4.
if sy-subrc ne 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
MESSAGE e808(com_product).
leave.
leave to transaction ' '.
endif.
Additional step: registration
select single * from comc_pr_tool_reg
where program_name = gc_program
and user_name = sy-uname
and exec_date = sy-datum.
if sy-subrc ne 0.
message e809(com_product).
endif.
endform. " check_authority
*& Form delete_decoupled_data
form delete_decoupled_data
using iv_product_guid type comt_product_guid.
include com_product_const018.
Deleting decoupled and customer requested data (long_text, longmatnr,
upload registry, ibase product variants coming from R/3,
archive verify registry). Documents like PDF,XLS,DOC,JPG stored in
Content Management will not be deleted
load BADI implementations
class: cl_exithandler definition load.
data: exit_obj type ref to if_ex_com_product_delete.
call method cl_exithandler=>get_instance
exporting
exit_name = gc_badi-com_product_delete
null_instance_accepted = on
changing
instance = exit_obj.
call BADI implementations (User Exit)
call method exit_obj->delete_extra_data
exporting
iv_product_guid = iv_product_guid.
endform. " delete_decoupled_data
*& Form load_extensions
form load_extensions
using iv_product_guid type comt_product_guid
changing et_extension type comt_frgtype_tab_ext
et_settype type comt_frgtype_tab_ext.
data: lt_prd_cat type comt_prod_cat_rel_tab,
ls_prd_cat type comt_prod_cat_rel,
lt_cat_frg type comt_prcat_frag_rel_tab,
ls_cat_frg type comt_prcat_frag_rel,
lt_settype_guid type comt_frgtypeguid_tab,
ls_settype_guid type comt_frgtype_guid,
lt_settype type comt_frgtype_tab_ext.
refresh et_extension.
read categories assigned to product
call function 'COM_PROD_CAT_REL_READ_WITH_PR'
exporting
iv_product_guid = iv_product_guid
importing
et_set = lt_prd_cat.
loop at lt_prd_cat into ls_prd_cat.
read allowed settypes for categories
call function 'COM_PRCAT_FRAG_REL_READ'
exporting
iv_category_guid = ls_prd_cat-category_guid
importing
et_prcat_frag_rel = lt_cat_frg
exceptions
wrong_call = 1
others = 2.
check sy-subrc = 0.
refresh lt_settype_guid.
loop at lt_cat_frg into ls_cat_frg.
ls_settype_guid = ls_cat_frg-frgtype_guid.
append ls_settype_guid to lt_settype_guid.
endloop.
read settype defintions
call function 'COM_SETTYPE_READ_MULTIPLE'
exporting
it_settype_guid = lt_settype_guid
importing
et_settype = lt_settype
exceptions
nothing_found = 1
others = 2.
if sy-subrc = 0.
only settypes
et_settype[] = lt_settype[].
delete et_settype[] where
( prod_comp_type = gc_prod_comp_type-extension or
prod_comp_type = gc_prod_comp_type-simple_extension ).
only extensions
delete lt_settype[] where
( prod_comp_type ne gc_prod_comp_type-extension and
prod_comp_type ne gc_prod_comp_type-simple_extension ).
et_extension[] = lt_settype[].
endif.
endloop. " end of product categories
endform. " load_extensions
*& Form delete_status
form delete_status
using it_status_guid type comt_prd_status_guid_tab.
data:
lt_status like crm_jsto_pre occurs 0,
ls_status type crm_jsto_pre,
ls_status_guid type crmt_object_guid.
loop at it_status_guid into ls_status_guid.
ls_status-objnr = ls_status_guid.
append ls_status to lt_status.
endloop.
call function 'CRM_STATUS_DELETE_MULTI'
tables
objnr_table = lt_status.
endform. " delete_status
*& Form delete_favorites
form delete_favorites
using iv_product_guid type comt_product_guid.
call function 'COM_PRODUCT_DELETE_FAVORITES'
exporting
iv_object_guid = iv_product_guid.
endform. " delete_favorites
*& Form delete_clear_case
form delete_clear_case
using iv_product_guid type comt_product_guid.
data: ls_customizing type comc_product,
lv_clear_case_guid type comt_clear_case_guid.
Is cusotmizing-flag INACTIV_PROD activated ?
call method cl_com_product_general=>comc_product_read_all
importing
es_prod_general = ls_customizing
exceptions
not_found = 1
others = 2.
check ls_customizing-inactive_prod = on.
select single clear_case_guid from comm_clear_targ "#EC *
into lv_clear_case_guid
where object_guid = iv_product_guid "active
and object_class = 'PROD'.
normaly two entries for active and inaktive product version
delete from comm_clear_targ
where clear_case_guid = lv_clear_case_guid
and object_class = 'PROD'.
delete from comm_clear_stack
where guid = lv_clear_case_guid
and application = 'PROD'.
endform. "delete_clear_case
*& Form check_usages
form check_usage
using iv_product_guid type comt_product_guid
changing ev_delete type comt_boolean.
include sbal_constants.
data: cv_function_module like rs38l-name
value 'COM_PRODUCT_USAGE_CHECK'. "#EC NOTEXT
data: ls_product type comt_product,
lt_product type comt_product_tab.
data: ls_logheader type bal_s_log, "Kopfdaten des Protokolls
lv_loghandle type balloghndl.
data: ls_msg_filter type bal_s_mfil,
ls_log_filter type bal_s_lfil,
lt_msg_handle type bal_t_msgh,
ls_log_handle type bal_s_logh,
ls_msg_handle type balmsghndl,
ls_msg type bal_s_msg,
ls_string type string.
does CRM function exist
call function 'FUNCTION_EXISTS'
exporting
funcname = cv_function_module
exceptions
function_not_exist = 1
others = 2.
check sy-subrc = 0.
create log handle
ls_logheader-aldate = sy-datum.
ls_logheader-altime = sy-uzeit - 10.
ls_logheader-aluser = sy-uname.
ls_logheader-alprog = sy-repid.
call function 'BAL_LOG_CREATE'
exporting
i_s_log = ls_logheader
importing
e_log_handle = lv_loghandle
exceptions
log_header_inconsistent = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
ls_product-product_guid = iv_product_guid.
append ls_product to lt_product.
call usage checks
call function cv_function_module
exporting
it_product = lt_product
iv_loghandle = lv_loghandle.
filter settings
ls_log_handle-sign = 'I'.
ls_log_handle-option = 'EQ'.
ls_log_handle-low = lv_loghandle.
append ls_log_handle to ls_log_filter-log_handle.
get messages
call function 'BAL_GLB_SEARCH_MSG'
exporting
i_s_log_filter = ls_log_filter
i_s_msg_filter = ls_msg_filter
importing
e_t_msg_handle = lt_msg_handle
exceptions
msg_not_found = 1
others = 2.
check sy-subrc = 0.
ev_delete = space.
write: / text-001, text-008.
read messages
loop at lt_msg_handle into ls_msg_handle.
call function 'BAL_LOG_MSG_READ'
exporting
i_s_msg_handle = ls_msg_handle
importing
e_s_msg = ls_msg
exceptions
log_not_found = 1
msg_not_found = 2
others = 3.
check sy-subrc = 0.
message id ls_msg-msgid type ls_msg-msgty number ls_msg-msgno
with ls_msg-msgv1 ls_msg-msgv2 ls_msg-msgv3 ls_msg-msgv4
into ls_string.
write: /, ls_string.
clear ls_msg.
endloop.
endform. " check_usages
*& Form delete_ibasecomponent
text
-->P_GV_PRODUCT_GUID text
form delete_ibasecomponent using p_product_guid.
data: lv_guid22 like sysuuid-c22,
ls_comp type ibas_dat1.
tables: ibin.
break pvho.
call function 'GUID_CONVERT'
exporting
iv_guid_x16 = p_product_guid
importing
ev_guid_c22 = lv_guid22
exceptions
no_unicode_support_yet = 1
parameters_error = 2
others = 3.
find the component
select * from ibin
where objnr = lv_guid22.
clear ls_comp.
ls_comp-instance = ibin-instance.
ls_comp-ibase = ibin-ibase.
call function 'IBASE_COMP_DELETE'
exporting
i_comp = ls_comp
exceptions
data_not_consistent = 1
ibase_locked = 2
not_succesful = 3
others = 4.
if sy-subrc eq 0.
call function 'IBASE_SAVE'.
endif.
endselect.
endform. " delete_ibasecomponent -
Where to delete SAP delivery data
Hello,
I want to delete SAP delivery data cos client its not needful. If i do delete SAP delivered controlling areas in DEV it won't create automatic transport request.
In PRD it's delete function for deleting controlling areas are disabled.
In which client it should be deleted? and how to do transport?
Thanks for helpHello,
You should be extremely careful and never try to do these experiments in production with these programs.
Only you can delete them in DEV - (development environment - but not testing) in case if somebody inadvertently posted some transaction data.
IMG ==> Financial Accounting (New) General Ledger Accounting ==> Preparation for Produtive Start ==> Delete Test Data ==>
Delete Transaction data
PS: Please make sure that you are doing in the right client. Otherwise, these deletes are IRREVERSIBLE.
Regards,
Ravi -
Is it possible to delete a product in GTS?
Hi Gurus,
Is it possible to delete a product in GTS?
When we set for a material in ERP a deletion indicator
is this information also coming to GTS via regular /SAPSLL/MATMAS_DISTRIBUTE_R3 material transfer job?
Rgds
DieterHi Gabriel,
I have tried this dev. once.. Just thought of sharing the same. Defined some product attributes in GTS to hold some customized flags in Product master-Additional data tab.
For example: Tried updating country flags in the Product master in GTS.
Country flags are updated based on extension of a Material to a Plant in R/3. i.e, Whenever a Material is extended to a Plant in GTS, we use the Plant country code and update the same in Product master.
And similarly, whenever the Deletion flag is setup, the same can be removed. For this to work automatically, just activated change pointers for MARC-LVORM for /sapsll/matmas_sll.
But in my case, it was a customized development.Not really sure, if this is available in standard.
Thanks
Dhilipan -
How to delete the product?
Hi Gurus
I want to delete product how I can do it?
E.g.: I Created Product id 3 now I want to delete that Product id 3 so what should I do
I used Re Categorized products: COMM_PROD_RECATEG but it showing
So what should I do?
Regards
Mahi
[email protected]Hi Mahesh,
Transaction code for archiving the product master data is SARA. After archiving product, can be deleted.
Refer the following link here you can find more information on this.
http://help.sap.com/saphelp_crm50/helpdata/en/d0/493a40a63bc65de10000000a155106/frameset.htm
The following constraints apply when archiving products in the CRM System:
· Archived products cannot be reloaded into the CRM System
· Products can only be deleted if they have been archived
· Archived products can only be displayed in a technical view in the Archive Information System
· Inactive products cannot be archived
· Configurable products cannot be archived
· Contents of documents are not archived, only the URL is archived
· Documents and condition records cannot be archived or deleted
Hope this information helps you.
With Best Regards
Nadh.R
Maybe you are looking for
-
I am getting the following error when I compile the JSP page. I have set my CLASSPATH correctly, still I am getting the error.Where should I place my class file??? HTTP Status 500 - type Exception report message description The server encountered an
-
Dear all, Can any one told me the Standard report with reference to Customer Group wise? Plz send me the solution for the same. Thanks & Regards, PM
-
I created 40 or 50 report and some dashboards. Now I have to rename a few column in Presentation Layer of the Admin Tool. I know that creating alias I can rename the column. The problem is that this modification will be visible only in the left panel
-
My iPhoto keeps trying to import photos and can't use it
Having a block with iphoto, wont stop importing and cant use, what happening
-
Can Outlook calendars be downloaded to an iPad?
Can Outlook calendars be downloaded to an iPad?