Change Product data in CRM
Hi,
I'm using CRM 5.0 and I need to add product category (with attributes) and thumbnail picture to existing products.
As I browse through the forum, many have suggest to use Function COM_PRODUCT_MAINTAIN_MULT_API. However, it seems this function require me to populate many fields other than Product ID and GUID.
Is there any other FM or BAPI that I can use to modify product data or perhaps is there a function that I need to call to get all the existing product data before calling com_product_maintain_multi_api.
Thanks in advance for any help.
Hi,
I have success in getting the product data now. The problem is how should I populate table parameter for COM_PRODUCT_MAINTAIN_MULT_API. I tried copy coding from OSSnote 810153, but it doesn't work in CRM 5.0 ( missing some structure).
Has anyone try this function before in CRM 5 and can give me some guidance. Thanks.
Similar Messages
-
How to change product description in CRM
Hi gurus
I need to chage the product description in de CRM oportunity and in CRM quotations.
The product description is composed for every customer, for this reason I need to change the standar product description in the opprtunities and in the sales order
Could you help meHello,
In CRM, product is considered to be a master data and hence product description for the same product should be same
in opportunity as well as in quotation, or else it might create inconsistencies later on.
You have the option to maintain produce descriptions in difference languages but not for different txn types.
Hope this helps!
Best Regards,
Shanthala Kudva. -
Hi all,
We have a product hierarchy created in ECC in Tcode V/76. These hierarchies have 3 levels and assigned to different materail in ECC materail master.
We have done a initial load of Materail and all the products in CRM now have the R3PRODSTYP. But none of them got assigned to R3PRODHIER when I check in Product wokbench. This is making my product search in a Sales order really difficult.
Is it a standard behavior that R3PRODHIER does not get assigned automatically even though those materail belong to that hierarchy in ECC?
I cheked the SMW01, no errors in initial load of the objects "Material", "DNL_CUST_PROD01" etc.
Any help much appreciated.
Edited by: Praveen Rangineni on Aug 4, 2008 4:10 PMYes..That can be a possible approach. But the product maintenance workbench will not allow you to delete the base category with which the product was created.
Instead the best way is to use this recategorization trx. COMM_PROD_RECATEG to change the category assignment of all your products on the fly.
Please use this in TEST mode first and then go for it!
Thanks,
Sudipta.
Note: Unfortunately, the report cannot be executed to delete the assignment of a category to a product when that category is assigned to the base hierarchy.
In that case, a report program to reassign the base hierarchy would be 1 option. Alternatively, you need to purge your product data in CRM and restart the download from ECC after making the customizing change.
Edited by: Sudipta Sarma on Aug 5, 2008 1:00 AM -
Hi All,
I am trying to upload service product data to CRM system. What is the recommended method of doing that?
I could get my hands on idoc type
CRMXIF_PRODUCT_SERVICE_SAVE. Is this something we can use for service product uploading to CRM?
Your inputs are appreciated.
Regards
Navdeephi, it looks you need to add some field in your LSMW product inbound project.
As it is go through the IDOC way, you need to make clear how to fill the description and sale area info in IDOC, then you can adjust the data mapping logic in LSMW.
Normally, you can check the IDOC related segament to try the fields and the inbound effects.
And an another easy way is you can configure a outbound IDOC, and create a product you want in CRM GUI with all the field you require, then check how SAP fill the outbound IDOC content. -
How to upload data into CRM using batch job
Hello,
I got some problem and need some hints.
I am uploading data from a flat text file (product data) into CRM using thefunction module GUI_UPLOAD. My program starts with a selection screen whereI enter the path and the filename of the program, then I click start, and
the data is transferred in CRM. This works perfect, and I can automaticallycreate service products in CRM.
Here comes the PROB:
But now I want to automize this procedure using a batch job that automatically picks up the file from the server and processes it automatically without any user interaction. BUT I always get an error saying that my function module GUI_UPLOAD can't run in batch mode. So
anyone has an idea how to do this? Any other function modules that can run in batch mode? Any other ideas?
Thx very much for ur help on this.Hi Bill,
GUI_UPLOAD, like the name says, uses the SAPGUI to upload the data to theserver.. and in a batch job, you don't have the connection to a SAPGUI.
So you should use following kind of coding:
DATA MSG(100).
OPEN DATASET "FILENAM" FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE
MSG.
IF sy-subrc = 0.
DO.
READ DATASET "FILENAM" INTO [Your internal table].
IF sy-subrc <> 0.
EXIT.
ENDIF.
APPEND [Your internal table]P_DATA.
ENDDO.
ENDIF.
The file should then be available on the server.
Regards -
Uploading Data Into CRM Using a Batch Job
Hi,
How can I automate the procedure of uploading data from a flat text file (product data) into CRM using the function module GUI_UPLOAD?
Thanks,
Rachita.Hi,
GUI_UPLOAD, like the name says, uses the SAPGUI to upload the data to the server, and in a batch job, you don't have the connection to a SAPGUI. So you should use following kind of coding:
DATA MSG(100).
OPEN DATASET "FILENAM" FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE
MSG.
IF sy-subrc = 0.
DO.
READ DATASET "FILENAM" INTO [Your internal table].
IF sy-subrc <> 0.
EXIT.
ENDIF.
APPEND [Your internal table]P_DATA.
ENDDO.
ENDIF.
Reward points if found helpfull...
Cheers,
Siva. -
Change pointers in CRM for Product Data Extraction using MDM_CLNT_EXTR
Hi All,
We want to extract Product data in Delta mode using MDM_CLNT_EXTR.
I think change pointers are activated in CRM system in a different way. Please let me know steps to activate change pointers in CRM system for Product Data.
Thanks in advance for your help.
Regards,
ShivHi,
Please follow the below steps fro change pointers.
1. In the Implementation Guide (IMG, transaction SALE), choose Modeling and Implementing ® Master Data Distribution ®Replication of Modified Data ® Activate Change Pointers ‑ Generally.
2. Set the activation status Activate Change Pointers ‑ Generally, and save your entry (i.e BD61 Activate Change Pointers ).
3. Choose the activity Activate Change Pointers for Message Types like ORDERS.
4. Set the active indicator for the message type .
5. Save your entries.
warm regards
Mahesh. -
Not able to change the data of test data containers in production system
Dear All,
We have created eCATT scripts in Development SolMan System and moved the transports to Production SolMan System. Customer wants to change the data at Test data containers and run the scripts in production system but we are not able to edit the data.
May be the reason is SCC4 transaction code has set the below option.
Changes and transports for client-specific Objects
u2022 No changes allowed
Customer doesnu2019t want to change the above option and wanted to change the test data containers to give different datau2019s and run the eCATT scripts.
Could you please let me know the solution for this?
Your help is really appreciated.
Thanks,
MahendraeCatt has the feature where you don't need to transport the scripts or test configuration to our target system. We can keep all our scripts and test data in Solman and run this script any other system in your landscape using the System data container and target system.
Maintain the production as one of the target system in System container in Solman and point that system while running the script. Change the test data in Solman to run this script.
Let me know if you need more information
thanks
Venkat -
How to change product master data in GTS?
Hi Experts,
I want to change additional data of a product master in GTS.
I want to update the values in the screen below (Additional data)
How can I do this? are there any function modules?
Please help.
Thanks
GopalHi Gopal, guys
Sorry if i`m repeating what someone else said before as its a long thread.
The preferable option that we implemented is a small custom Z transactio where users maintain these attributes. Selection screen same as the ususal /sapsll/product_02, and then get the PRGEN entry and maintain on second screen.
Using the API FM used for ECC system sync... well maybe its a bit unnecessary & overcomplicated. Once you get the Product Object, you can use the maintain object/ maintain subobject methods that is standard and works without simulating inbound api call..
heres the screenshot
Hope this helps,
UPDATE : Mind you, that if you do changes to the attributes in GTS, they will stay for as long as there is no new update for the material in ECC...
Once a change pointer or manual transfer triggers a re-transfer, manuall changes will most likely be flushed and set back to what comes from ECC api.. just bear this in mind pls & test this case...
Branio -
Dowloding product attributes / set type to Master Data in CRM 2007
We have created set-type and attribute in txn:COMM_ATTRSET.
Created set-type and assign attributes to them,you need to assign set-type to categories in txn:COMM_HIERARCHY by selecting the category.
And then you assign category to a product and hence your set-types are available to that product.
We are maintianing Attribute for COMPETITOR PRODUCT ( MAT_ZCPT as Category Hierarchy ). All Attributes are assigned to Competitor Product and Relationship is maintained with company Product .
What BApi or BAdi shgould be used .
When we are implementing BDC , SAP says from CRM 2007 they are not supporting GUI . Use existing BApi .
But we want to download more than 5000 Products . Please guide .
Regards,
Anup RecheHi Anup,
use the following bapi ;
BAPI_PPR_MAINTAIN:-This method allows the independent maintenance (create/change) of the following objects of Partner/Product Ranges (PPRs):
BAPI_PPR_MAINTAIN_40:-This method allows the independent maintenance (create/change/delete) of the following objects of Partner/Product Ranges (PPRs):
Badi:
PRODUCT_UPDATE2 -Obsolete: Create or Change Product
hope it will useful.
thanks
Hemant ghiya -
How to fetch data for CRM Product Master
Hi,
I'm trying to write a report on the product master in CRM.
In our current setup, we have few Ztables attached to the Product Master tabs.
The key field linking the Ztables is
field name:FRG_GUID
component type COMT_FRG_GUID
description:SET GUID
I would like to know if there is any function module which reads the product master table based on Product_ID just like 'for example 'CRM_ORDER_READ'.( which gives all the GUID's based on Business Transaction Numbers)
I need this because I'm not able to match the Fragment_guid of many DB tables to each other.
Please help.
Regards
RasheedHi Pratik,
Thank you for trying to help me. I shall explain my scenario for better undestanding.
I'm creating a Product Master Report which is linked to several Z tables.I need to fetch the details based on the price group .
The structure of one of the Z tables is as below:
Field Name Component Type
.INCLUDE COMT_FRG_KEY
CLIENT MANDT
FRG_GUID COMT_FRG_GUID
.INCLUDE COMT_PRODUCT_ADM
VALID_FROM COMT_VALID_FROM
VALID_TO COMT_VALID_TO
UPNAME COMT_UPNAME
HISTEX COMT_HISTEX
LOGSYS COMT_LOGSYS
ZZ0010 ZMODELTYPE
ZZ0011 ZMODELDESC
ZZ0012 ZMODSALEABLEAREA
ZZ0013 ZMEAUNIT
ZZ0014 ZBUILTUPAREA
ZZ0015 ZCARPETAREA
ZZ0016 ZTERRACEAREA
ZZ0017 ZGARDENAREA
ZZ0018 ZBALCONYAREA
now the only way I can get the information from this table is if I get the FRG_GUID.
Is there any way where I can get all the FRG_GUID for the PRODUCT_GUID'S.
Regards
Rasheed -
Interdependent Changes in Sales Orders (CRM -- R/3)
Dear Sap gurus,
at my current customer they have implemented warranty complaints in SAP CRM.
This is a copy of the transaction type CRMC (service complaint)- Type leading transaction category = BUS2000120 (complaints).
Once the complaint has user status 'closed' this complaint is sent to R/3 for further processing.
At that moment no changes made in R/3 are replicated back to CRM.
Note 642944 explains that ou can make changes independent of the system in which you originally created the order. This is called scenario A (compared to scenarios X , Y and Z which are described in oss note 705200 (which are valid for older releases of CRM and R/3). <b>Since we are using CRM 5.0 and R/3 (release 4.7 and one is SAP ECC 6.0) we fall into validity for scenario A.</b>
You still have a bunch of other related OSS notes such as:
- 630778: Scenario A: mutual change of sales documents
- 620139: Scenario A: independent changes in sales documents- R/3
- 720511: FAQ: Data exchange sales documents (CRM <-> R/3) II
- 656224: FAQ: Sales documents data exchange (CRM>-> R/3)
- 642269: Scenario A: mutual change of sales documents - CRM
- 971782: New Badi for exchanging data from sales document lists
- 541113: Data exchange scenario for orders (CRM-R/3)
-490932: Data exchange of sales transactions between CRM & R/3
<u><b>My question is the following:</b></u>
Since they speak about sales orders/Sales documents etc all the time, I am wondering if all these notes also would apply in the case of CRM Complaints (CRMC with leading transaction category COMPLAINTS).
I would like to avoid investigating every single note, if in any case these would not apply to Complaints.
<b>(Just for the record: the reason why I ask is that for example Product proposal (in the cross selling context) is for example also not supported for Complaints in SAP CRM 5.0, as opposed to Sales orders and Quotations.)</b>
Thanks for a quick answer for those that already have had experience.
davyTo start with I have to describe the actual scenario...(therefore I think Interdependent changes is not valid as Lorna explained already).
<b>Scenario:</b>
We are using Complaint management in CRM 5.0. combined with SAP ECC 6.0.
Now we are not following the standard process flow which is described in:
http://help.sap.com/saphelp_crm50/helpdata/en/ed/8816f949e90644ada2c210ba2316e0/content.htm
When Creating a Complaint (CRMC) and adding a unit (individual object/material) at header level, and the spare parts (on item level) we do certain validation checks
for warranty validity etc.
On item level we can set the status on either "Accepted" or "rejected"(where we also indicate per item based on code groups if this should be
- credit memo request
- free of charge substitute delivery
After all item statuses are either Accepted or rejected, the user status on header level automatically changes to 'immediate settlement'.
When this is the case we can manually set the user status to closed on header level.
At this very moment replication takes place in the form that a Sales Order is created in R/3 with either a credit memo request and/or
a Free of charge delivery. (these have the same item category as in SAP CRM).
so far so good. But in this stage no manual changes are possible anymore in the SAP CRM complaint.
Changes can still be made on Sales order level in R/3 by adding for example another item (spare part).
<b>My Question now is:</b>
Suppose a change is made on sales order level (this sales order has the same number as the complain which was originally created in SAP CRM), how can we
update the Complaint in SAP CRM?
I first was looking at delta replication for sales documents (described in notes 642944 and 705200) but this is not valid since the actual complaint is not
replicated to R/3 in the first place.
The only thing I could think of is making use of some action (profile)...which might for example check if the R/3 sales order with same document number is changed.
Anyone experience with setting up such a thing or perhaps has another suggestion?
Thanks in advance
davy -
ALE distribution of HR master data to CRM - subtype CELL and MAIL
Hello,
Overview/Introduction:
we are using the ALE distribution of HR master data to CRM. The distribution has already been set up and it is running. We know that the infotype communication (0105) is especially distributing the subtypes 0010 (e-Mail) and 0020 (telephone number). This e-Mail address and the telephone number are stored in the business partner in the CRM system.
For this infotype 0105 there are also the subtypes CELL (cell phone) and MAIL (e-Mail address). Unfortunately this cell phone number and the mail address (from subtype MAIL) are not stored at the business partner in CRM.
Our request is on the one hand to store the data from subtype CELL into the field mobile number of the business partner. And on the other hand we want to store the e-mail address of subtype MAIL at the business partner instead of subtype 0010.
For some reason it seems that these requests canu2019t be setup within SAP standard.
So we found SAP note 758426 which suggests to use the BAdI HRALEX_INBOUND and the report RH_ENHANCE_BP_TEMPLATE.
Problem:
Now the problem is that the BAdI does not get called! The BAdI is active! We tried to set break points -> unfortunately did not stop! And we also implemented an endless loop in the BAdI -> even with this the system did not u2018stopu2019!?
Any ideas?
Thank you,
RomanHi,
First you need to create a distribution model using transaction BD64 : Edit > Model View > create.
Then you will need to maintain fields for description and technical name. In partner box you need to enter the source system (HR) and the target system (FI) in the second field. Then you need to assign a message type and filter settings if you need it. You need to create this distribution model in source system (HR).
After, still in BD64, go to environment > change partner profile or transaction WE20
Select your target system and enter the corresponding message type ( HRMD_A or HRMD_ABA depends on your scenario) with the correct customizing (receiver port, packet size, idoc type, syntax check and output mode).
Then please do the same things in your source system using WE20 for your source system and define your inbound parameters (Process code HRMD, processing by function module : use trigger immediately if it is not a production system or else trigger by background program and this case you will need to run report RBDAPP01 to process Idocs).
Once done, then go back to your model view in your source system (BD64) and go to Environment > generate partner profiles. Then please go to Edit > Model View > distribute
After all these settings done, it should work.
Please also check out documentation :
http://help.sap.com/erp2005_ehp_04/helpdata/EN/82/933b90aa9e11d6b28800508b5d5211/frameset.htm
Best Regards
Christine -
Product Replication from CRM 5.0 to ECC 6.0
Hi,
My requirement is to replicate newly created product master from CRM to ECC.
For this I created subscription with publication name <b>Product Materials (MESG)</b>.
Nest created product in CRM, but this product is not replicated to ECC. But BDoc generated successfully with status green.
Where as new sales orders,change sales orders, BP changes, Product master changes are replicated in ECC from CRM and Vice Versa.
Appreciate, if some one could tell me the steps I need to do in ECC & CRM to replicate new products created in CRM into ECC.
Thanks & Best Regards,
SAP CRM MW.
Message was edited by:
SAP CRMHi BPB,
Have you created a number range for materials in CRM?
If you create materials in the R/3 system and the CRM system in parallel, duplicate numbers for different materials may occur if the number ranges in the R/3 system and the CRM system are overlapping. Duplicate numbers do not cause errors because each material gets an internal unique identifier in addition. To avoid duplicate numbers you have to make sure that the number ranges for materials in the CRM system and the R/3 system do not overlap.
Remove the subscription in Adminconsole that is not required for the product upload.
The upload function is only active in product processing if this was allowed in Customizing.
The corresponding path in the SAP reference IMG is 'Customer Relationship Management -> Master Data -> Product -> Settings for Product Type -> Allow Upload for a Product Type'.
<b>Reward points if it helps!!</b>
Best regards,
Vikash.
Message was edited by:
Vikash Krishna -
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
Maybe you are looking for
-
Print Button Not Working if i not inital the Crystal Report Viewer
hiii every body here i have problem on my web application with framework (4.0) i use crystal report viewer (crystal report 13) and i installed the engine of crystal report and use dataset as datasource to my report and my report work fine but .... my
-
How can I maximize my wifi speed using the Time Capsule?
I do not feel that my wifi speed is as fast as it should be. I have a 2 TB Time Capsule and connect wirelessly with an Apple MacBook Air, an iPhone 5s, an iPad 4, and iPad mini. The online manual just tells how to do the initial setup but not how t
-
When I click on the tab to 'open a new tab' or when I select 'new tab' from the file menu then a new tab does not open. It used to.
-
Hi guys i want to run oracle health check i.e 1. check security on the users , roles , privileges 2. db maintenance 3. all reports to check the databases but the main thing is i have to use Enterprise Manager (OEM) to do all that. we are ruining orac
-
I purchased an itunes card in the USA while on vacation for $50.00----how can I use the card while in the usa.....Ellis