SAP CRM Events

17
1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt. http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 1/17 SAP CRM tutorials for all : Please feel free to contact me on [email protected]. This blog is for helping those who are facing issues in CRM technical and functional . Not for career counselling , Please refrain from sending those questions . Please do some research before asking any question . Please don't copy and paste the requirements which you get from your client . YOUR URGENCY IS NOT MY PROBLEM :) I will take my sweet time in replying . SAP CRM Technical Tutorials by Naval Bhatt. Home My Intro SAP Job Websites Document pdfs ... Middleware concepts ... Basics of OOABAP... Practical BOL programming .. SAP CRM related links ... Interview Questions .... Saturday, May 19, 2012 Account Classification Use Using classification categories, you can flexibly combine classification criteria and attributes, as you require. For example, a company could be a customer in the business unit "Automation" but a competitor in the business unit "Mobile Phones". In this activity, you define the classification categories, criteria, and attributes you require. Classification Categories One classification category is delivered for accounts, with a number of predefined criteria. However, you will generally define your own classification categories: You are allowed a maximum of five criteria per category. The assignment of criteria to category can be changed provided no data has been created yet for the account classification. You can add an unlimited number of your own or predefined attributes to a category. Criteria and Attributes When defining criteria and attributes you specify the following: Handler Class The handler class is used to determine the value ranges for criteria and attributes. It is called whenever values are required on the UI or validated. Using handler classes also allows you to implement your own logic for overriding values returned for standard attributes and criteria. The handler class inherits the methods from the superclass CL_CRM_BUPA_CLASS_HANDLER (delivery class G of table CRMC_BP_CLATTR, therefore protected against SAP updates). The following methods have to be redefined for your handler class to derive the value help correctly: IF_CRM_BUPA_CLASS_HANDLER~GET_DDLB_VALUES IF_CRM_BUPA_CLASS_HANDLER~GET_VH_DESCRIPTION Domain Define Account Classification Search Search This Blog Join this site with Google Friend Connect Members (103) More » Already a member? Sign in Followers:Join to get regular update SAP BPM & Workflow tutorials My travel experiences Me & my pursuit of happiness Wandering hermit Photography My other blogs Join me on my photography journey

description

SAP CRM Events

Transcript of SAP CRM Events

Page 1: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 1/17

SAP CRM tutorials for all : Please feel free to contact me on [email protected]. This blog is for helping those who arefacing issues in CRM technical and functional . Not for career counselling , Please refrain from sending those questions . Pleasedo some research before asking any question . Please don't copy and paste the requirements which you get from your client .YOUR URGENCY IS NOT MY PROBLEM :) I will take my sweet time in replying .

SAP CRM Technical Tutorials by NavalBhatt.

Home My Intro SAP Job Websites Document pdfs ... Middleware concepts ...

Basics of OOABAP... Practical BOL programming .. SAP CRM related links ...

Interview Questions ....

Saturday, May 19, 2012

Account Classification

UseUsing classification categories, you can flexibly combine classification criteria andattributes, as you require. For example, a company could be a customer in the business unit"Automation" but a competitor in the business unit "Mobile Phones".In this activity, you define the classification categories, criteria, and attributes you require.

Classification Categories

One classification category is delivered for accounts, with a number of predefined criteria.However, you will generally define your own classification categories:

You are allowed a maximum of five criteria per category. The assignment ofcriteria to category can be changed provided no data has been created yet for theaccount classification.

You can add an unlimited number of your own or predefined attributes to acategory.

Criteria and Attributes

When defining criteria and attributes you specify the following:

Handler Class

The handler class is used to determine the value ranges for criteria andattributes. It is called whenever values are required on the UI or validated.

Using handler classes also allows you to implement your own logic for overridingvalues returned for standard attributes and criteria.

The handler class inherits the methods from the superclassCL_CRM_BUPA_CLASS_HANDLER (delivery class G of tableCRMC_BP_CLATTR, therefore protected against SAP updates).

The following methods have to be redefined for your handler class to derive thevalue help correctly:

IF_CRM_BUPA_CLASS_HANDLER~GET_DDLB_VALUES

IF_CRM_BUPA_CLASS_HANDLER~GET_VH_DESCRIPTION

Domain

Define Account ClassificationSearch

Search This Blog

Join this sitewith Google Friend Connect

Members (103)  More »

Already a member? Sign in

Followers:Join to getregular update

SAP BPM & Workflow tutorials

My travel experiences

Me & my pursuit of happiness

Wandering hermitPhotography

My other blogs

Join me on my photographyjourney

Page 2: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 2/17

For attributes, you can also assign a domain with an attached value table. Thehandler class evaluates the domain values or attached value table and passesthese, if available, to the implementation for further processing. If neither adomain nor handler class is assigned, however, values can be entered on the UIwithout a value help, in the form of a free text.

SingleValue

An attribute can be singlevalue or multivalue. For example, an account canhave different roles for the same combination of critieria with identical values, butonly one rating.

Default SettingsA basic set of criteria and attributes are provided as standard for the classification categoryACCOUNT. If these do not meet your business requirements, you have two options:

Enhance the standard with your own criteria and attributes

Create your own classification category with the necessary criteria and attributes

Activities

If you want to enhance the standard category ACCOUNT with your own attributes, you candefine the new attributes in this Customizing activity and assign them to standard categoryACCOUNT.You define the relevant value ranges for these attributes according to the steps describedfor scenario 2.

To introduce a new classification category, consisting of your own combination of criteria(this can also include standard criteria such as "sales organization# or "country#) and arange of attributes, perform the following steps:

1. In the customer namespace, create a handler class which provides value rangesand value help types for custom criteria and attributes.

2. Define a classification category, criteria, and attributes, and assign the criteria andattributes to the new category (step 1 is a prerequisite for assigning the handler classto new criteria and attributes).

3. Create a new configuration for the custom classification category.

4. Generate and adjust the runtime repository for UI maintenance of the new categoryusing an enhancement set.

5. Add new assignment block to account overview page.

6. Create a new configuration to enable a search by the criteria, attributes and valuesassociated with the new category.

7. Enhance the search structure with the search term for the new category.

8. Implement the methods GET_DDLB_VALUES and GET_VH_DESCRIPTION ofthe handler class to provide values and value help types.

1. Creating a Handler Class

For each criterion, you need to enter a handler class which inherits the interface methodsIF_CRM_BUPA_CLASS_HANDLER~GET_DDLB_VALUES andIF_CRM_BUPA_CLASS_HANDLER~ GET_VH_DESCRIPTION. This handler class must bea subclass of either class CL_CRM_BUPA_CLASS_HANDLER orCL_CRM_BUPA_CLASSIFICATION. By entering one of these classes as the superclass,the above interface is passed down to the subclass.You can create different handler classes, which can be assigned to different criteria andattributes, depending on your business requirements:

Scenario 1: Assigning Your Own Attributes to theStandard Classification Category ACCOUNT

Scenario 2: Creating Your Own ClassificationCategory

Naval Bhatt Photography .. on Facebook

Find us on Facebook

Naval Bhatt Photography ..

Show More

554 people like Naval Bhatt Photography ..

Like

Naval BhattPhotography ..shared KasparsDaleckisPhotography'svideo.June 27, 2014

Kaspars Daleckis Photography

If you're feeling uninspired, thisvideo will almost certainly help.

03:37

►  2014 (13)

►  2013 (57)

▼  2012 (154)

►  December (2)

►  November (8)

►  October (1)

►  September (15)

►  August (14)

►  July (26)

►  June (18)

▼  May (10)CRM MiddlewareSurvival Guide

Importantmiddlewaretransactions

An introductionabout IPC

TerritoryManagement

Code for checkingthe action

Blog Archive

Page 3: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 3/17

Enter class CL_CRM_BUPA_CLASSIFICATION as the superclass for yourhandler class if you want to use a standard criterion or attribute and override thevalues returned by the standard.

Enter class CL_CRM_BUPA_CLASS_HANDLER as the superclass for yourhandler class if you want to create your own criteria or attributes and define thevalue range and value help type according to your requirements (standard criteriaand attributes are not sufficient).NoteIf you intend to use values associated with a domain (fixed values, attachedvalue table) for an attribute, you do not have to use a handler class. The valueswill be retrieved automatically from the domain assigned to the attribute inCustomizing.

2. Defining a Classification Category, Criteria, and Attributes

Prerequisite: Step 1 to be able to assign the handler class to new criteria and attributes

1. In this Customizing activity, create a new classification category and enter adescription (leave fields Search Structure and Field Name blank). Save the changes.

2. Create new criteria and enter the name of the class you created in the field HandlerClass. Each criterion can be assigned a different handler class. The handler classspecified can also be assigned to an attribute (see next step).

3. Create new attributes. You can enter the name of a handler class (which can alsobe assigned to a criterion), the name of a domain, or none of these.

If you specify a domain, make sure that there is either a value table associatedwith this domain or fixed values defined for the domain. Otherwise no values canbe returned for the attribute.

If a handler class is entered in addition to a domain, the values are retrieved fromthe domain during runtime and subsequently passed to the handler class. Afiltering of these values can be done in the implementation of the methodGET_DDLB_VALUES. (Where filtering is not required and there is therefore nologic implemented, the values provided to the method GET_DDLB_VALUES aremerely passed on for further processing).

If you enter a handler class only, the implementation of methodGET_DDLB_VALUES returns the values associated with the attribute.If neither a handler class nor a domain is specified, the values entered for thisattribute are regarded as free text. This means that values entered for thisattribute will not be validated.

Define whether the attribute is singlevalue or multivalue.

4. Choose Categories in the view cluster structure and select the classificationcategory you created. Choose Category > Criteria.You define the number andcombination of criteria that apply to the new classification category. A maximum offive different criteria can be assigned to the category in the fields Citerion 1 toCriterion 5.

Note

A value has to be entered for the first criterion.

Criteria have to be entered consecutively, starting with the first criterion andwithout any gaps.

A subsequent change to a criterion, associated with a position (changing theassigned criterion, deleting the last criterion), can only be made if no values existin the application table CRMM_BUT_CLASS for the relevant criterion, which isidentified by its position.

All available criteria can be assigned to the category, including standard criteria.

5. Choose Categories in the view cluster structure and select the classificationcategory you have created. Choose Category > Attributes and add the attributes you

triggered .

AccountClassification

Basic code fordate type valuesetting .

Basics of CRM UIcomponentprogramming .

CRM  changedocumentappointmentdate

How to usemessages inCRM web UI

►  April (9)

►  March (28)

►  February (13)

►  January (10)

powered by

CRM – Tables andTransaction CodesTABLE NAME DESCRIPTIONBUSINESS PARTNERSBUT000 BP: General dataContains Business PartnerNumber, Partner Category,Partne...

Importantmethods in CRMweb UIImportantmethods in CRM

Popular Posts

Page 4: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 4/17

want to include in the selected classification category. You can also add standardattributes.

6. Save your changes.

3. Creating a New Configuration for the Classification Category

1. Execute transaction BSP_WD_CMPWB for the component BP_CLASS, and selectthe view BP_CLASS/AccountClassificationOV with a doubleclick.

2. Go to the tab Configuration and switch to edit mode for the default configuration.

3. Choose Copy Configuration and confirm the prompt.A configuration attributes dialog box appears.

4. Select the values:Object Type = BP_ACCOUNTObject Subtype = <new classification category key> (as defined in step 2)Choose Enter.

5. Adjust the configuration appropriately (rename and configure the categories asdefined in step 2). To do this, delete unused fields and add text fields as required(depending on the type of value help). No text fields are required for DDLB.

6. Save the configuration.

7. Repeat these steps for the view BP_CLASS/AccountClassificationEL.

4. Generating and Adjusting the Runtime Repository

1. Start transaction SE38.

2. Enter one of the following programs and choose Execute:

CRM_BUPA_UI_CREATE_CLASS_EOVP (if you are using the editable overviewpage)

CRM_BUPA_UI_CREATE_CLASS (if you have set the user parameterCRM_UIU_OLD_UIC)

3. Select the enhancement set for which you want to make the new classificationcategory available.As enhancement sets are clientdependent, check which enhancement set is activein the client in which you want to make the new classification category available. Todo this, check the view BSPWDV_EHSET_ASG in transaction SM30.

4. Select the new classification category and run the report.

5. Adding a New Assignment Block to the Account Overview Page

1. Execute transaction BSP_WD_CMPWB for the component BP_HEAD and theenhancement set you selected in step 3, and select the viewBP_HEAD/BPHEADOverview with a doubleclick.

2. Go to the tab Configuration and switch to edit mode for the default configuration (orthe configuration for which you want to make the new classification categoryavailable).

3. Select the new assignment block from the list of Available Assignment Blocks andmove it to the list of Displayed Assignment Blocks.Choose Show Technical Details to see your classification category ID as a view ID.

4. In the list of Displayed Assignment Blocks, enter the description of the assignmentblock you have just added and other settings such as load option, etc.).The description specified for the classification category in Customizing is not copiedacross here.

5. Save your changes.

web UI or componentprogramming . View Impl classmethods:DO_CONFIG_DETERMINATION : The method is for runtim...

Getter  Setter methods inWeb UIUsing Get and Setter methodsyou can retrieve data to fieldand set specific data to field.Using Get_I method you canmake your field ...

SAP CRM interview questionsQ 1. What is the typicallandscape for a CRM project?What is the maximum numberof landscapes that you haveworked on in a project. ...

SAP CRM Most useful BADIs(Updating) .ORDER_SAVE BADI is used atthe time of saving order. 1stcalledCHECK_BEFORE_SAVE Useful for check if the valuesare filled as expect...

One orderframeworkOne Order ObjectModel The CRMOne Order

documents are created intransaction ‘CRMD_ORDER’.The Header table that isupdated by the crea...

How to create POPUP windowin UIOpen the component and thenview where the pop up is to beraised. You must be raisingthe popup on some event...You will need to crea...

TPM Trade promotionmanagement : Technicalaspect .Standard role: SAP_CRM_UIU_TPM_PROFESSIONAL  Components  :TPMOE  1.      TPM Summaryo     Trade PromotionManagement is the proce...

How to use messages in CRMweb UIIn general there are 4 differentSources for error messages:Important Info Message BSPFramework messages UIFramework mes...

An introduction about IPCSAP CRM uses IPC todetermine pricing informationwhen creating a business

Page 5: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 5/17

6. Creating a New Configuration for the Search

Repeat the steps performed in step 3 for the view BP_CLASS/AccountClassificationSearchin  the component BP_CLASS (transaction BSP_WD_CMPWB):

1. Copy the default configuration, and enter the object type BP_ACCOUNT and selectthe ID of the new classification category for the object subtype.

2. Add all relevant criteria to the configuration and change the field labels accordingly.Remove any unused criteria from the configuration. Leave the fields Attribute andValue unchanged.

3. Save your changes.

The type of value help for each field is determined at runtime in the implementation of themethod GET_VH_DESCRIPTION of the handler class associated with the correspondingfield.

7. Enhancing the Search Structure

A separate component must be available in the search structureCRMT_BUPA_IL_HEADER_SEARCH for every classification category:

1. Enhance the structure CRMT_BUPA_IL_HEADER_SEARCH with a newcomponent in the customer namespace using an existing append. If a customerappend does not yet exist, create one and add the new component.

2. Add the new search parameter to the account search in the transactionBSP_WD_CMPWB for the component BP_HEAD_SEARCH. Select the viewBP_HEAD_SEARCH/MainSearch and add the new search parameter to theconfiguration. Enter an appropriate name, ideally the description of the classificationcategory.

3. Enter the name of the search structure CRMT_BUPA_IL_HEADER_SEARCH andthe field name you added to this structure in step 1 in the definition of the newclassification category in the view cluster CRMVC_BUPA_CLASS.

4. Save your changes.

8. Implementing Methods for Deriving Value Helps

Implement the methods GET_DDLB_VALUES and GET_VH_DESCRIPTION of the handlerclass to provide values and value help types.

Method GET_DDLB_VALUES

The values maintained for criteria and attributes are retrieved from animplementation of the method GET_DDLB_VALUES, which needs to beredefined in the handler class you have assigned to the criterion or attribute.

The method is called at runtime every time values are requested when creatingclassification data for an account using a dropdown list box. It is also calledwhen the entered values are validated within BOL and and to provide valueranges in the account search (also see the note at the end of this section).

There is basically no difference in the way values are retrieved for criteria andattributes, except that an attribute might also have an associated domain thatprovides values, passing them to the handler class. If this is the case, you donot need to implement any logic for these attributes.

Whether the requested values apply for a criterion or an attribute is indicated bythe value passed in the parameter IV_TECTYPE of the methodGET_DDLB_VALUES. The ID passed in IV_ID identifies either a criterion or anattribute, depending on the value in IV_TECTYPE.

For a languagespecific determination of values, the language is passedadditionally in the parameter IV_LANGU (in the standard, this parameter is usedin the initial load of classification values to SAP NetWeaver BI).

Mutual dependency of criteria (in the standard there is a mutual dependency ofthe criteria SALES_ORG, DIST_CHANN, and DIVISION, which together form a

transaction, such as aquotation, sales order, serviceproce...

 

Total Pageviews

3 7 8 8 4 4

Follow by Email

Email address... Submit

Page 6: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 6/17

Posted by Naval Bhatt at 12:10 AM  2 comments: 

Labels: Account Classification., crm tutorials, sap crm tutorial, SAP CRM tutorials

valid sales area) can be realized by retrieving values already entered for criteriaother than those currently requested. The values already entered for the currentclassification "line# are passed in the parameter IS_CURRENT_CRITERIA.

Method GET_VH_DESCRIPTION

The type of value help for any criterion or attribute value is by default a dropdownlist box. This applies if there is no implementation of the methodGET_VH_DESCRIPTION for a criterion or attribute.

If a value help other than a DDLB is required, such as a standard input help usinga DDIC search help, the method GET_VH_DESCRIPTION needs to be redefinedand implemented.

To do this, simply copy the code of the existing implementation of the method inthe class CL_CRM_BUPA_CLASSIFICATION to your implementation and makethe necessary adjustments.

This basically involves changing the parts of code that check the technical typeand ID passed. This can be done by setting values for LV_F4_ATTR1,LV_F4_ATTR2, EV_HELP_ID, and EV_HELP_ID_KIND. A prerequisite is that aDDIC search help exists for your value table.NoteIf you opt for your own value help for criteria or attributes (using a DDIC searchhelp), you need to implement the logic in the method GET_DDLB_VALUES forthe relevant criterion or attribute, as this method method is called when thevalues entered are validated in the API.

If you want to override the logic of the value determination for determination for standardcriteria or attributes, you need to create your own handler class as a subclass of the classCL_CRM_BUPA_CLASSIFICATION.By redefining the method GET_DDLB_VALUES and implementing your own logic, yourvalues will be considered when maintaining the classification, regardless of the classificationtype.To do this, you have to enter your handler class instead of the standard handler classCL_CRM_BUPA_CLASSIFICATION for the criterion or attribute in the view clusterCRMVC_BUPA_CLASS.By calling the method GET_DDLB_VALUES of the superclass within your implementation ofthe method GET_DDLB_VALUES, you can retrieve standard values and modify the valuerange.Changing the handler class associated with a criterion or attribute in Customizing does notentail a modification.

Scenario 3. Overriding Values and Value Help forStandard Criteria and Attributes

Recommend this on Google

Saturday, May 12, 2012

Basic code for date type value setting .

<?xml version="1.0"?><SAPTimeRule><TimeRuleTree><! Begin of Rule Tree ><ruleline><! Begin of new LINE ><AssignTimeExp displaytype="AssignTime"><! Assign time >           <VarTimeExp displayType="VarTime"name="RESULT"

Page 7: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 7/17

Posted by Naval Bhatt at 9:30 AM  No comments: 

Labels: date type xml coding, sap crm tutorial, SAP CRM tutorials

position="B"><! Variable: Time ></VarTimeExp><MoveTimeExp displaytype="MoveTime" direction="+"><! Move ><VarTimeExp displayType="VarTime"name="ZIEFAPPRD"               > reference object position="B"><! Variable: Time ></VarTimeExp><ConstDuraExp displaytype="ConstDura"duration="3" timeunit="DAY">      > number of days to be added <! Constant Duration ><VarObjectExp displaytype="VarObject"name="SYSTEM"/><! Variable: Timeobject ></ConstDuraExp></MoveTimeExp></AssignTimeExp></ruleline></TimeRuleTree></SAPTimeRule>

+1 Recommend this on Google

Posted by Naval Bhatt at 9:25 AM  2 comments: 

Labels: Basics of CRM UI component programming, crm tutorials, sap crm tutorial, SAPCRM tutorials

Basics of CRM UI component programming .Basic code for UI .create an instance DATA: lr_ent TYPE REF TO if_bol_bo_property_access,

check if the instance is bound .

IF lr_ent IS BOUND.    me>typed_context>btpartnerset>on_new_focus( lr_ent ).* refresh the text (necessary after empty text!)    me>typed_context>bttexth>on_new_focus( lr_ent ).

for error handling  we use try  catch block . 

    TRY.        lr_entity ?= lr_ent.        lv_collection = lr_entity>get_related_entities(               iv_relation_name = 'BTHeaderTextSet' ).        lr_ent = lv_collection>get_first( ).

        me>typed_context>bttext>on_new_focus( lr_ent ).

      CATCH cx_crm_genil_model_error.*       should never happen        EXIT.      CATCH cx_sy_ref_is_initial.    ENDTRY.

+2 Recommend this on Google

Page 8: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 8/17

Thursday, May 10, 2012

CRM  change document appointment dateTo set up the appointment date we have to add a code similar to below code in 

CRM_APPOINTMENT_BADI   Method IF_EX_CRM_APPOINTMENT_BADI~CRM_APPOINTMENT_MERGE

** DATA DECLARATION*INCLUDE crm_direct.

* DocumentDATA lv_guid              TYPE crmt_object_guid.DATA lv_item_guid         TYPE crmt_object_guid.DATA lt_req_objects       TYPE crmt_object_name_tab.DATA lt_header_guid       TYPE crmt_object_guid_tab.DATA lt_appointment       TYPE crmt_appointment_wrkt.DATA ls_appointment       TYPE crmt_appointment_wrk.DATA lt_appointment_com   TYPE crmt_appointment_comt.DATA ls_appointment_com   TYPE crmt_appointment_com.

* Input fiels and othersDATA ls_logical_date_key  TYPE crmt_date_logical_date_key.DATA lt_input_fields      TYPE crmt_input_field_tab.DATA ls_input_fields      TYPE crmt_input_field.DATA ls_input_field_names TYPE crmt_input_field_names.DATA lt_input_field_names TYPE crmt_input_field_names_tab.

* AuxDATA lv_timestamp_from    TYPE timestamp.DATA lv_timestamp_to      TYPE timestamp.DATA lt_saved_objects     TYPE crmt_return_objects.

** SELECTION SCREEN * This part is added for you to test the code as an independent report program*SELECTIONSCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE textb01.PARAMETERS p_id       TYPE crmt_object_id. "Document IDPARAMETERS p_kind     TYPE crmt_object_kind. "AHeader, BItemPARAMETERS p_item     TYPE crmd_orderadm_inumber_int. "Item number. Example: 10SELECTIONSCREEN: END OF BLOCK b1.SELECTIONSCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE textb02.PARAMETERS p_type     TYPE crmt_appointment_wrkappt_type. "Appointment TypePARAMETERS p_datef    TYPE sydatlo. "Date fromPARAMETERS p_timef    TYPE sytimlo. "Time fromPARAMETERS p_datet    TYPE sydatlo. "Date toPARAMETERS p_timet    TYPE sytimlo. "Time toSELECTIONSCREEN: END OF BLOCK b2.

** READY, SET... GO!*STARTOFSELECTION.

* Check Fields  IF p_id IS INITIAL OR p_kind IS INITIAL OR p_type IS INITIAL OR p_datef IS INITIAL OR p_timef IS INITIAL.    MESSAGE 'Please fill all input fields, except date_to and time_to' TYPE 'E'.  ENDIF.  IF p_kind = 'B' AND p_item IS INITIAL.    MESSAGE 'Please fill item number to update' TYPE 'E'.  ENDIF.

* Get document GUID  SELECT SINGLE guid FROM crmd_orderadm_h INTO lv_guid WHERE object_id = p_id.  IF SYSUBRC NE 0.    MESSAGE 'Document not found' TYPE 'E'.  ENDIF.

Page 9: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 9/17

* Get item GUID?  IF p_kind = gc_object_kindorderadm_i.    SELECT SINGLE guid FROM crmd_orderadm_i INTO lv_item_guid WHERE header = lv_guid ANDnumber_int = p_item.    IF SYSUBRC NE 0.      MESSAGE 'Item not found' TYPE 'E'.    ENDIF.  ENDIF.

* Read Document Info  INSERT lv_guid INTO TABLE lt_header_guid.  INSERT gc_object_nameappointment INTO TABLE lt_req_objects.

  CALL FUNCTION 'CRM_ORDER_READ'    EXPORTING      it_header_guid       = lt_header_guid      iv_mode              = gc_modedisplay      it_requested_objects = lt_req_objects    IMPORTING      et_appointment       = lt_appointment    EXCEPTIONS      document_not_found   = 1      error_occurred       = 2      document_locked      = 3      no_change_authority  = 4      no_display_authority = 5      no_change_allowed    = 6      OTHERS               = 7.  IF sysubrc NE 0.    MESSAGE 'Error reading document' TYPE 'E'.  ENDIF.

* Calculate timestamp for new date/time  CONVERT DATE p_datef TIME p_timef INTO TIME STAMP lv_timestamp_from TIME ZONE syzonlo.  CONVERT DATE p_datet TIME p_timet INTO TIME STAMP lv_timestamp_to TIME ZONE syzonlo.

* Get current appointment data  IF p_kind NE gc_object_kindorderadm_i.    READ TABLE lt_appointment INTO ls_appointment WITH KEY ref_kind = p_kind appt_type = p_type.  ELSE.    READ TABLE lt_appointment INTO ls_appointment WITH KEY ref_kind = p_kind ref_guid = lv_item_guidappt_type = p_type.  ENDIF.  IF sysubrc NE 0.    MESSAGE 'Appointment type not found in document' TYPE 'E'.  ENDIF.

* Format the appointment data  MOVECORRESPONDING ls_appointment TO ls_appointment_com.  ls_appointment_comtimestamp_from = lv_timestamp_from.  ls_appointment_comtimestamp_to = lv_timestamp_to.

* Set logical key and build input fields  MOVECORRESPONDING ls_appointment_com TO ls_logical_date_key.  CALL FUNCTION 'CRM_APPT_BUILD_INPUT_FIELDS'    EXPORTING      iv_ref_handle   = '0'      iv_ref_guid     = ls_appointment_comref_guid      iv_ref_kind     = ls_appointment_comref_kind      is_logical_key  = ls_logical_date_key    IMPORTING      es_input_fields = ls_input_fields.  IF sysubrc <> 0.    MESSAGE 'Error generating input fields' TYPE 'E'.  ENDIF.

  INSERT ls_input_fields INTO TABLE lt_input_fields.  INSERT ls_appointment_com INTO TABLE lt_appointment_com.

* Clear the reference of the timecontext for recalculation of the dates  CALL FUNCTION 'CRM_DATES_TIMECONTEXT_DELETE'.

Page 10: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 10/17

Posted by Naval Bhatt at 7:56 AM  1 comment: 

Labels: CRM  change document appointment date, CRM opportunity, crm tutorials, sap crmtutorial, SAP CRM tutorials

* Change appointment in memory  CALL FUNCTION 'CRM_APPT_MAINTAIN_MULTI_OW'    EXPORTING      iv_ref_guid            = ls_appointment_comref_guid      iv_ref_kind            = ls_appointment_comref_kind      it_appointment_com     = lt_appointment_com    CHANGING      ct_input_fields        = lt_input_fields    EXCEPTIONS      precondition_violation = 1      invariant_violation    = 2      OTHERS                 = 3.  IF sysubrc <> 0.    MESSAGE 'Error changing appointment' TYPE 'E'.  ENDIF.

* Save document  CALL FUNCTION 'CRM_ORDER_SAVE'    EXPORTING      IT_OBJECTS_TO_SAVE   = lt_header_guid      IV_UPDATE_TASK_LOCAL = 'X'    IMPORTING      ET_SAVED_OBJECTS     = lt_saved_objects    EXCEPTIONS      DOCUMENT_NOT_SAVED   = 1      OTHERS               = 2.  IF sysubrc <> 0 OR lt_saved_objects IS INITIAL.    MESSAGE 'Error saving document' TYPE 'E'.  ELSE.    MESSAGE 'Date updated and saved!' TYPE 'S'.  ENDIF.  COMMIT WORK.

Recommend this on Google

Saturday, May 5, 2012

How to use messages in CRM web UIIn general there are 4 different Sources for error messages:

1.  Important Info Message2.  BSP Framework messages3.  UI Framework messages4.  BOL/Genil global message container

5.  BOL/Genil object realated message containers

The message level is considered first before the message types are

considered. Message level is 1-9 corresponding to data element:

BSP_WD_MESSAGE_LEVEL

9 Only Collect in Trace Mode

8 Administrator

6 Experienced User

3 Office-Based Sales Employee

1 Customer

0 None

The message level implies for which user group the messages are designed

for.

Page 11: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 11/17

In general the sorting sequence corresponds to the above sequence. Within

each group the sorting corresponds to “Error” “Warning” “Info” so on the

message type.

Data: lv_msg_service type ref to cl_bsp_wd_message_service.

Lv_msg_service = Me-> view_manager->get_message_service().

Create an important info message:lv_msg_service->add_message( IV_MSG_TYPE =…

IV_MSG_ID =…

IV_MSG_NUMBER=…

IV_MSG_V1=…

IV_MSG_V2=…

IV_MSG_V3=…

IV_MSG_V4=…

IV_MSG_LEVEL=…

IV_IMPORTANT_INFO = ABAP_TRUE).

The parameter iv_msg_type is ignored in this case.

This kind of message source is available in the context node via attribute errors which is aninstance of CL_BSP_MESSAGES. The class provides several methods to add messages indifferent formats like T100, Exception Objects etc. Those messages get an severityaccording to the constants in this class and messages with severity 1 or 2 (fatal error orerror) will automatically keep the user on the current page in order for him to correct therespective error first.Messages can be assigned to fields of the context nodes which will lead to a highlighting ofthe corresponding fields on the UI (depending on the Tag Library).All BSP Framework messages will automatically be deleted after the next round trip (thewhole message object will be invalidated with the next roundtrip).Errors in the automatic type conversion will also lead to BSP Framework messages (e.g.wrong format entries in a date field will automatically be display via this type of messages,no application coding is necessary here, as the framework does provide this 

Get access to UI Framework message service available in every controller class.

Data: lv_msg_service type ref to cl_bsp_wd_message_service.

Lv_msg_service = Me-> view_manager->get_message_service().

Create an important info message:lv_msg_service->add_message( IV_MSG_TYPE

IV_MSG_ID

IV_MSG_NUMBER

IV_MSG_V1

IV_MSG_V2

IV_MSG_V3

IV_MSG_V4

IV_MSG_LEVEL

IV_VERIFICATION).

This kind of messages is intended to be set on controller level. The optional parameteriv_verification can be used to register a call back method to verify the message on each

2      To No.1: How to create an important infomessage:Get access to UI Framework messageservice available in every controller class.

3      To No 2: How to use BSP Frameworkmessages:

4      To No.3: How to create an UIMessage:

Page 12: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 12/17

round trip if it is still valid. If this is not given the message is only shown once, so itdisappears after the next round trip.

BAPIMessages: The functionality there corresponds to the above statements. This is onlyfor those colleagues relevant who are calling BAPIs from their UIs.The corresponding method is called:            Add_bapi_messages

This automatically will be provided by the BOL Implementation:

There are two concepts for message filtering:Messages can be filtered by message level. This is a user specific setting (User Parameter:CRM_USER_LEVEL).In addition to this a programmed message filter is available.Per default messages from all sources except 5 – special BO Messages – are shown.In order to switch on messages of a single BO you have to implement method:IF_BSP_WD_HISTORY_STATE_DESCR~GET_MAIN_ENTITYIn the view controller which is loaded into the workarea.Windows are bypassed automatically.Of course this is only a valid option in that case the workarea contains “just” a single entity.In case the view in the workarea has not the knowledge which is the main entity of the viewassembly it has to dispatch the method call to it’s subviews (as in the bread crumbimplementation).Since this method is also of importance for the breadcrumb implementation it might bealready implemented in your case.

If you need more control about the message filtering you can implement method:IF_BSP_WD_STATE_CONTEXT~GET_MESSAGE_FILTERIn the view controller which is loaded into the workarea.Windows are bypassed automatically.Here you receive the current filter object of type CL_BSP_WD_MESSAGE_FILTER.Now you are able to switch on/off the several message sources and/or add additionalentities for which messages should be shown.

You might change the given filter or create a new one and you might also pass on the filterobject to subviews in order to aggregate the applied filter settings.

In any case the filter object has to be returned.

Message types:

Navigatable messages

         Nonnavigatable messages

Implementation:1.    Get the message service:

DATA: lr_service TYPE REF TO cl_bsp_wd_message_service.lr_service = me>view_manager>get_message_service( ).

2.    For navigatable messages only:2.1    Create a message handler class

This class must implement the interfaceIF_BSP_WD_MESSAGE_HANDLER and will be called when the messagelink is clicked.

5      To 4 and 5: BOL/Genil global messagecontainer and BOL/Genil object realated messagecontainers:

6      Message filtering:

7      How to handle messages on user request:

Page 13: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 13/17

Posted by Naval Bhatt at 8:40 AM  1 comment: 

Labels: crm tutorials, How to use messages in WEB UI, messages in CRM, sap crmtutorial, SAP CRM tutorials, web Ui developments .

2.2    Subscribe for a messageDATA: lr_handler TYPE REF TO zmsgcallback. “Handler classfrom 2.1

CREATE OBJECT lr_handler.

TRY. lr_service>subscribe_message( iv_message_class  ='CRM_IC_APPL_UI_BDC'                                iv_message_number = '114'                                iv_subscriber     =lr_handler                                iv_activation     =abap_true ).

  CATCH cx_bsp_wd_dupl_mess_subscr.ENDTRY.

3.    Example how to add a message:lr_service>add_message( iv_msg_type   = 'E'                         iv_msg_id     = 'CRM_IC_APPL_UI_BDC'                         iv_msg_number = '114' ).

+1 Recommend this on Google

Sunday, April 29, 2012

Everything about CRMV events

Initial View Maintenance for Customizing Event Handler

The following document contains an explanation of the entries and flags to be found in theEvent Handler Customizing table CRMC_EVENT_CALL and general information on how theEvent Handler works.This transaction is split into 4 sections 1. maintenance of CRMC_EVENT_CALL(Assignments), 2. How Callbacks are Selected, 3. Definitions and 4. Checks. Thesesections are described in detail below.In Release 4.0, the following change has been made:A new entity has been added to the Event Handler. This is the object function. Objectfunctions belong to objects or sets. For example, the partner set has the objectfunctions Partner and Buying Center Handling. Function modules are assigned to anobject function which in turn is assigned an object/set. The object/set is assigned to atransaction category (BUS Object) which is assigned to a transaction type or itemtype.  If an object is not assigned to a transaction type, then any callbacks assigned tothe object function can be ignored by the event handler. Thus, for each transactiontype or item type, the Event Handler can determine which function modules arerequired.  Via an additional function module (CRM_EVENT_FILTER_PROC_TYPE fortransaction  types and CRM_EVENT_FILTER_ITEM_TYPE for item  types), specificobject functions (i.e. groups of callbacks) can be excluded from selection.Which event do I need to register for?To find out which event is best for you, try the following:Set the user parameter CRM_EVENT_TRACE to X. You can find this in the menu under

CRM_EVENT_MAINTAIN____________________________________________________Short Text

Purpose

Page 14: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 14/17

System > User Profile > Own Data, tab Parameters.Run your transaction as normal. In a separate session, call transactionCRMD_EVENT_TRACE. The no. of records shown is set to 250 as default. You may needmore. While working in your transaction, you can refresh the trace report. This will beautomatically updated. As a result, you will be able to see which events have been set,which execution times have been reached, and you can hopefully decide which combinationof event, object and execution time is best for you.1. Maintenance of CRMC_EVENT_CALLCRMC_EVENT_CALL is used to register function modules for events.When an event is published, the event handler finds all function modules (callbacks)registered for this event and runs them at the appropriate time.Fields in CRMC_EVENT_CALL:Transaction category (SUB_TYPE)Business transaction category (Sales, service, contact, opportunity etc.). This can be thegeneral CRM transaction category BUS20001 (this makes the entry available to everyone) orit can be more specific (for example, BUS2000114 only applies to leasing scenarios).Please note: every process type contains a main transaction category (generally salesBUS2000115) followed by secondary transaction categories. For example, the process typeSRVO (Service order) contains the categories Sales (BUS2000115), Service (BUS2000116)and Contact (BUS2000126). If the entry you require exists for your main category, you donot need to recreate an entry for the secondary categories.Execution time (EXE_TIME)The point during the processing of a transaction when you want your callback to run. Variousexecution times are set during the processing of a transaction, for example, end of itemprocessing, end of header processing, before save. When the event you are registered for ispublished, you may need to react immediately, or you may want to wait until a later timepoint. For example, if partner data is changed, then the pricing data needs to be checkedimmediately (execution time 001). Orgman however can wait until the end of headerprocessing(execution time 030) to react to this change.Note: You should not use exe_time immediately (001) if you register for the event SAVE.Execution times are maintained under Definitions Execution times.Priority (PRIO)Priority of callback. Acts as an additional sort criterion as to when callbacks are carried out.Object name (OBJ_NAME)The object you are interested in (e.g. Partner, Orgman).Note: Objects are maintained under Definitions Objects.Event (EVENT)The event you are interested in (e.g. after_create, save, end of header processing).Note: Events are maintained under Definitions Events.Attribute (ATTRI1)The attribute is used as a filter to cut down on the number of function modules called.Depending on the object or set, you may not always need to react to an event beingpublished. If you always need to react to a particular event, then you should set ATTRI1 toSPACE or <*>. You can assign an attribute to the callback so that it only reacts when thisattribute is set. This attribute is used for example by the status, partner and appointmentsets. The partner set uses this attribute to communicate for which particular partner anevent has been published (0001 for contact person etc.). The status set communicates thestatus change via this attribute. The appointment set communicates the date field beingchanged via this attribute. If you set SPACE or <*> for one of these sets, then your callbackwill react to every event published by this set.Function (FUNC_NAM)The name of your callback (it should begin with CRM and end in EC). Before you can enter acallback in this view, it has to be assigned to an object function.Note: Callbacks can be assigned to object functions under Definitions Objectfunction/Callbacks.Object functions can be defined under Definitions Object functions.Perform function for document header (ONLY_HDR)The callback should be carried out at header level.Perform function for document item (ONLY_ITM)The callback should be carried out at item level.Do not process function if error occurs (ERROR_CHECK)If, for some reason, the callback raised an error, this flag causes the message to be passedon to the calling program.For example, if the user enters the wrong product, then you may not want your callback to

Page 15: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 15/17

be processed.Call callback (CB_FREQ)Frequency and characterization of the callback. This attribute is very, very, important! Itdetermines how often the function module should be called. The following values areallowed:

Call to Header/Item, with Object, Event, Attr., Old/New Data(SPACE)The callback can be carried out for headers and items. Thecallback is provided with the object name, the event, old and newdata. Old data is the old version of the work area structure. Newdata is the new version of the work area structure. The structure tobe passed is defined in table CRMC_EVENT_STRUC. If  old andnew data are required and the callback should run immediately(Exe_time = 001) once an event is published, you must use thissetting and not 'K'.  (K is explained below).

Call to Header/Item with Object, Event, Attr. W/Out Old/New (A)Like SPACE, but without old and new data.

Call to Header/Item, W/Out Object, Event, Attr.,Old/New Data (B)The callback can be carried out for header and items. Old and newdata are not provided.

Call Just Once Per Transaction (C)The callback is carried out only once per transaction. Old and newdata are not provided. Note: This is the only setting that should beused with EXE_TIME 080 (Save).

Call to Hdr/Item with Object/Event/attr.+ Compressed Old/New (K)The callback can be carried out for headers and items. Thecallback is provided with the object name, the event, andcumulated old and new data. This means that if an event ispublished more than once, you get the old data from the initial call,and the new data from the final call. All changes in between areirrelevant. Normally, you need to set SPACE if you want to reactimmediately and K if you react later. However, for specific partnerdata, i.e. if you are registered for a change to a specific partnerfunction (field attri1 = 0001 or similar) and not general partnerchanges (field attri1 = <*> ) you need to use SPACE, as partnerdata cannot be cumulated.

Changed on (CHANGED_AT)Date of change to recordChanged by (CHANGED_BY)User who made the changeONLY_ONE_CALL= this flag has no relevance as of release 3.0.2. How the event handler selects callbacksThe event handler selects callbacks for each transaction and item type. For the transactiontype, the selection is as follows:In table CRMC_PR_ASSIGN, business objects are found for a transaction type. Note: Thereis also a business object BUS20001. Entries in CRMC_EVENT_CALL for this businessobject  are valid for all transaction types.In tables CRMC_OBJECT_ASSI and CRMC_OBJ_ASSI_I,  the allowed set objects aredetermined for the business objects.In table CRMC_OBJECT_FUNC, object functions are determined for the set objects.In table CRMC_FUNC_ASSIGN,  the allowed callbacks are determined from the objectfunctions.In addition, there is a function module, CRM_EVENT_FILTER_PROC_TYPE_OW whichexists to filter out additional object functions based on objectspecific and transactiontypespecific Customizing.For the item type, the selection is as follows:In table CRMC_IT_ASSIGN, business objects are found for an item type. Note: There isalso a business object BUS20001. Entries in CRMC_EVENT_CALL for this businessobject  are valid for all  item types.

Page 16: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 16/17

Posted by Naval Bhatt at 4:52 AM  1 comment: 

Labels: crm tutorials, CRMV events, event handling in CRM, SAP CRM tutorials

In table  CRMC_OBJ_ASSI_I,  the allowed set objects are determined for the businessobjects.In table CRMC_OBJECT_FUNC, object functions are determined for the set objects.In table CRMC_FUNC_ASSIGN,  the allowed callbacks are determined from the objectfunctions.In addition, there is a function module, CRM_EVENT_FILTER_ITEM_TYPE_OW whichexists to filter out additional object functions based on objectspecific and itemtypespecificCustomizing.3. DefinitionsThe definition section contains the following:

Events: The events that can be published in the event handler

Objects: The objects that are used to design a transaction type oritem type

Structure for Event/Object: If an object wishes to passinformation when publishing an event (for example, new quantitiesin an order or changed partner data), then a structure is required todo so. The structure is entered in this table so that the eventhandler can format the data.

Object functions: Object functions are functions carried out by anobject or set. They are used to group sets of callbacks, so thatthey can be planned or excluded when an event is published.

Object/ Object functions: Object functions are assigned toobjects.

Object functions/Callback: Callbacks are assigned to objectfunctions.

Objects: The objects and sets available to design a 1Ordertransaction.

Times: These are the execution times that can be set during thevarious processing stages of a transaction. For example,initialization, delete, save, end of header processing.

4. ChecksIf  you enter a transaction type and click the execute button, you will get a list showing allcallbacks that are relevant to the transaction type. If  you enter a transaction type +  itemtype and click the execute button, you will get a list showing all callbacks that are relevantto the item type.  You need to enter both as some Customizing at header level has an effecton the item level. This check is particularly useful to see if any unnecessary callbacks havebeen assigned to the transaction type or item. If this is the case, then you should adjust thecustomizing tables accordingly or enhance the filter function modules mentioned above.

+1 Recommend this on Google

Sunday, April 22, 2012

Authorization for personalizationThere are 2 things required for that:

1.Check if you have in authorization object UIU_COMP privileges to display component CRM_BSP_PERS.

2. in business role customizing, in the function profile, below values should be there:

Page 17: SAP CRM Events

1/2/2015 SAP CRM Technical Tutorials by Naval Bhatt.

http://sapcrmtutorial.blogspot.in/search?updatedmax=20120519T08:19:0007:00&maxresults=7&reversepaginate=true 17/17

Newer Posts Older PostsHome

Subscribe to: Posts (Atom)

Posted by Naval Bhatt at 6:29 AM  No comments: 

Labels: Authorization for personalization, crm tutorials, SAP CRM Authorization, SAP CRMtutorials

    PERSONALIZATION =PP_ENABLED1140994 (Missing entries for framework personalization table) 

+1 Recommend this on Google

© Naval bhatt 2012. Awesome Inc. template. Powered by Blogger.