Quantcast
Channel: SCN : Document List - Customer Relationship Management (SAP CRM)
Viewing all 252 articles
Browse latest View live

SAP Quote Header & item status Change document

$
0
0

This document will elaborate to change Quote /order /contract status in Header & item as well.

Below are the details..

 

Go to se37  --> FM CRM_STATUS_UPDATE


After run FM need to choose JEST_UPD. Next






 

 



Please the above steps need to perform when user not able to change status's then use above FM & set right status's.


Thanks,

sanjeevb


Integration of Document Management System with SAP CRM 7

$
0
0

In this document I will discuss about the steps which needs to be done to integrate a Document Management System (Content Server) with CRM 7.

 

At first the Content Server needs to be defined which would be compatible with SAP. We have used Open Text Document Access 10.0.

 

The Content Server has to be integrated with CRM in transaction OAC0:

OAC0.PNG

Once the content server has been defined then we need to decide the document types under which we will be storing the documents. These document types will be created as folders in the content server. This configuration is done in OAC2:

 

OAC2.PNG

 

The document types is now assigned to business objects in transaction OAC3. In this transaction we decide which business objects will require the functionality of storing the documents. This configuration stores the combination of Business object, Document type and the content repository.

 

OAC3.PNG

 

In addition a new external alias needs to be defined in the content repository service in SICF transaction as shown below:

 

DMS alias.PNG

 

With all the above mentioned settings the documents can be uploaded and viewed in the attachments assignment block in the respective object as shown below:

Attachments.PNG

Attachments 2.PNG

 

Hope the information shared helps the community.

Must Do: Activities to be done to integrate SAP DQM (Address Review) with SAP CRM 7 Ehp3 – Part 1

$
0
0

In this series of documents I am going to discuss about the important steps that needs to be done for integrating the address review screen with any of the address screens in SAP CRM. The pre requisite for this activity is SAP DQM (DS 4.1) has to be connected with SAP CRM through standard RFC connections and the address review jobs needs to be run on DQM server. 


Thus I have divided the series into three parts which will cover:

 

  • Basic Integration of DQM with CRM 7
  • Integration of DQM services with UI Components
  • Additional services provided by DQM

 

In this document I am going to cover the Basic Integration of DQM with CRM 7

 

The following activities needs to be done for the basic integration in the following IMG path: SPRO > SAP NetWeaver>Application Server>Basis Services>Address Management>SAP BusinessObjects Data Quality Management

  • Maintain settings to switch off the Address Reviewer screen: This activity is required to turn on / off the address review screen based on the country settings.
  • Maintain settings for Address Validation Control: This setting should only be done on the country on which the address validation is to be triggered.
  • SAP handshake with RFC servers: The RFC connections needs to be maintained are FL_GDQC_SERVER and FL_GDQC_BATCH. These RFC connections connect with DS and fetch address related information.
  • Maintain operating parameters: This is the key configuration for integration of CRM with DQM. It determines which RFC user will talk with DQM, how much data can move in batches and what will be width of address review screen etc.

Address review.PNG

Address Review 1.PNG

 

  • Maintain fields for address reviewers: This the key configuration which provides the option for putting the sequence of fields that should be shown in the address review.

 

Address Review 2 .PNG

  • Maintain Suggestion List Fields : In this configuration the field list is shown if more than one address has been found in the output

 

  • Activate/Deactivate postal validation functionality: In this setting we can activate / deactivate the DQM functionality by activating / deactivating the BADI /FLDQ/ADDRESS_CHECK.
  • /FLDQ/47U6X BC Set also needs to be activated.

 

 

In addition the following settings needs to be done in SPRO > SAP NetWeaver>Application Server>Basis Services>Address Management> DQM: Global Data Quality Adapter: CRM7 Extension

  • We will have to activate the BADI FLDQ_BS_DUPL_FUZZY_IMPL for the fuzzy search
  • BC set /FLDQ/BSP_PV  and /FLDQ/EXT_SEARCH needs to be activated

 

This completes the basic settings for DQM integration. In the next document I am going to discuss about DQM integration with UI component.

Must Do: Activities to be done to integrate SAP DQM (Address Review) with SAP CRM 7 Ehp3 – Part 2

$
0
0

In the part 1 of this series I discussed about the basic settings of DQM with SAP CRM.In this part I will discuss about the integration of DQM service with UI Component.

 

DQM service is only supported in specific objects. As I am working in Utilities domain, I have integrated the DQM with Business Partner address and Customer Move In process.

 

The following simple steps needs to be done to integrate the UI component with DQM service:

  • Open the UI component in transaction BSP_WD_CMPWB. In this case I have taken the UI component BP_ADDR
  • Go to Component Usage in the Runtime repository editor
  • Add the component usage : Used Component /FLDQ/DQXI_PV

 

UI Addr.PNG

 

After the UI Component has been integrated with DQM then the address will get reviewed from DQM as shown in the example below.

 

UI Addr2.PNG

 

This completes the second part about DQM integration with UI component. In the next section I will discuss about the additional features of DQM


Top 10 viewed SAP KBAs for January 2015

$
0
0

Purpose

The purpose of this document is to provide a list of the top ten most viewed SAP Knowledge Base Articles for Customer Relationship Management in the month of January 2015.

Overview

Below are the top 10 most viewed SAP KBAs for CRM.
KBA NumberKBA Title
Usage of IE11 for CRM Interaction Center
How to analyse problems related to session loss or logoff in CRM WebUI
How to analyze why an ERMS inbound E-Mail is not found in the agent inbox
1866138
VM_STACK_TRACE dumps in CRM
1906933
The ASSERT condition was violated
1954574Problems with CRM IC Functionalities related to Communication Session (alerts, greyed out ready/not ready buttons, agent dashboard) in complex system landscapes
1888001
Error “This content cannot be displayed in a frame” is shown on CRM WebUI page
1840776Launch SAP GUI Transaction from WebClient UI does not work as expected
1866327CRM IC: How to identify the source of sessions when working with CRM IC business roles and steps for resolving in case of errors
1853316
The ASSERT condition was violated
Please note, in order to view the contents of the SAP KBAs, you will need to be logged into Service Marketplace.

Related Content

DecemberJanuaryFebruary

Top 10 viewed KBAs for December 2014

Top 10 viewed KBAs for January 2015Top 10 viewed KBAs for February 2015

New Options for Accessing ECC SAP GUI Transactions from SAP CRM Web Client

$
0
0

Many companies have implemented SAP CRM for the Inbound Contact Center scenario. One of the biggest challenges that they find is the integration with the backend ECC system for quote and order creation at the time the customer is in the phone line waiting for the confirmation number. In this aspect, SAP offers to implement different standard approaches.

 

List of Standard Solutions:


  1. Implementing SAP CRM Sales integrated with SAP SD Backend, the agent of the contact center will create a sales order object in SAP CRM  during the inbound call. This order will get replicated into SAP ECC. For this option you need to make sure that SAP CRM has configured all the pricing, material master and order customizing properly. If the company has implemented SAP SD for many years, a harmonization of SAP CRM will be necessary for all the validations applied in user exits/badis in the SAP ECC SD module.
  2. Another solution would be the SAP CRM Lean Order WebUI Interface with a backend SAP SD module instead of SAP CRM. SAP CRM offers a Web Interface that routes the information through RFC into SAP SD and vice versa.The approach considers many validations of the backend of SAP SD because the RFC calls points to the same places as you were creating the order in the VA01 (except module pool screen validations). One of the biggest challenges of this solution is the performance, since we are calling the SAP SD from SAP CRM as many times as the user is hitting “enter”. Another challenge could be that Lean Order does not support configurable products into the maximum extent as you were implementing SAP SD.
  3. The last option would be the so-called “transaction launcher”. This solution is a technique to call SAP ECC through a HTTP request session that shows the SAP GUI in a web-browser. This solution will cover all the scenarios of your pricing and order creation but the performance is not good if you consider a customer in the line waiting for the order confirmation. Additionally, there is no standard way to configure the linkage between the order confirmation and your interaction record object.


Besides the standard solutions, I would like to share a new technique for integrating the SAP CRM with SAP ECC. This method is based on the SAP shortcut sending parameters to the process of Order/Quote Creation or any transaction you desire.

 

Features:

 

  • Ability to call any transactions of SAP ECC from SAP CRM
  • Multiple SAP logins available
  • Roundtrip or callback information to SAP CRM. For example, an order gets created, and SAP CRM could trace the order from the interaction record. The order confirmation is sent back to SAP CRM
  • SAP GUI shortcut has magnificent performance in the integration with SAP CRM during a telephone call
  • Implemented in more than five contact centers

 

Please "click" on the following slides:

2014-12-30_9-43-44.jpg

va01.jppg.jpg

 

As you can see, we have inserted a button in the account overview that calls the VA01 (Order Creation in SAP ECC) sending over the parameters such as Customer number, Order Type, Contact Person. The order creation will be very fast. As soon as the interaction with the client is finished, we can connect the order number with a particular interaction record of SAP CRM.

 

Now let's take a look at the scenario for displaying past orders/quotes created from SAP CRM.

 

We have created a web ui component in the account overview that lists the previous orders of the customer. In this particular component, we can click on the quote/order and jump again into SAP ECC for visualization.


va23.jpg

 

va232.jpg

2014-12-30_10-13-08.jpg

Additionally, we have implemented a component in the Account overview where you can add categories and transactions or websites for your convenience:

 

Transactions.jpg

 

The user can click over the transactions and the SAP ECC GUI will open the corresponding transaction or Website URL.

 

Please feel free to connect me if you need any advice on how to implement a similar approach.

 

Federico Kamelhar

 

Moderation: Please, do not insert your contact data in a SCN blog.

ERMS OUTBOUD MAIL INFORMANTION

$
0
0

Purpose

This page shows how to find out the outbound mail information with their linked service ticket no in ERMS.

Overview

In ERMS we can easily find out the inbound mails and out outbound mails Information but it’s difficult to find out the outbound mail with their linking service ticket number information.

This wiki will help you how to find out the outbound mails with their linking service ticket numbers before that I will explain what are the tables which are frequently used in ERMS.

Detailed Explanation about ERMS tables

CRMD_ERMS_HEADER : This will gives Header Details information.

This table will give's the information about mails like From mail address,TO mail address, Creation Date, Changed Date, Status, Work Item ID, Employee responsible etc..

each and every mail will attached with there corresponding service ticket.

CRMD_ERMS_E21O: link email to one order.

This table will give’s the information about the Linkage from E-Mail to one order object. Here every mail id have there own id that is CON_ID and linked GUID. This GUID will gives the service ticket no.

CRMD_ERMS_CONTNT: Get subject of the mail.

This table will give's the E-Mail subject information based on CON_ID.

CRMD_ERMS_EVENTT: This will give’s the E-Mail event text.

This table will give's Email event text which is like replied, rejected,process, new etc..

eventerms.JPG

CRMD_ERMS_STATUS:  E-Mail status.

This table will give's E-Mail Status Description based on Status_id.

SOOD,SOST,SOES this table are helpful to find out the outbound mail info with there linked service ticket number.

SOOD: SAPoffice: Object definition.

This table will give's the email information like Created Date, Created Time,Description based on OWNTP = 'USR'.

SOST: SAPoffice: Status log table.

This table will gives the Status log details.

SOOS : Send process.

This table will gives the TO,CC and BCC mails information.

SOES: This will gives the outbound From mail address , outbound To mail address and Status.

If we observe standard ERMS Process For each service ticket under there is inbound and outbound mails. This mails are having their own ids that is CON_ID.

zsrvo.JPG

if we want to know the service ticket no for the replied mail id we have a function module.

In that function module we have to pass CON_ID  and object type = ‘SOFM’ then will get guid for the corresponding linked service ticket.

Pass that GUID into crmd_order_read or crmd_orderadm_h you will get service ticket no.

 

     lv_root-objkey = lv_conid.
      lv_root-objtype = 'SOFM'.

 

* Get the persisted doc flows
      CALL FUNCTION 'SREL_GET_NEXT_RELATIONS'
        EXPORTING
          object         = lv_root
          max_hops       = 1
        TABLES
          links          = lt_bor
        EXCEPTIONS
          internal_error = 1
          no_logsys      = 2
          OTHERS         = 3.
      IF sy-subrc <> 0.
        RETURN.
      ENDIF.

      READ TABLE lt_bor INTO ls_bor INDEX 1.
      IF sy-subrc = 0.
        lv_guid = ls_bor-objkey_a.

APPEND lv_guid TO it_header_guid.

 

        CALL FUNCTION 'CRM_ORDER_READ'
          EXPORTING
            it_header_guid       = it_header_guid[]
          IMPORTING
            et_orderadm_h        = it_orderadm_h[]
          CHANGING
            cv_log_handle        = lv_log_handle
          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 sy-subrc <> 0.
*   Implement suitable error handling here
        ENDIF.

 

        READ TABLE it_orderadm_h INTO wa_orderadm_h WITH KEY process_type = 'ZSRT'.

        IF sy-subrc <> 0.
        wa_data-service_tkt =  wa_orderadm_h-object_id.

       ENDIF.
      ENDIF.

Actual Requirement :

I have designed one BSP Component which is like search and result and custom model too.

Step by step procedure to achieve this requirement.

1)       Create one custom model.

2)      create search/result bsp component.

3)      Attach model to that component.

4)      Create search and result view.

Here we have so many blogs which is already explained how to create custom model and search/result bsp component.

So that I haven’t explain procedure to create model or search/result view.

Creating Custom Search/result view link..

http://scn.sap.com/docs/DOC-26564

http://scn.sap.com/community/crm/webclient-ui-framework/blog/2012/05/29/custom-component-based-on-custom-genil-component

Creating Custom Model..

http://scn.sap.com/community/crm/webclient-ui-framework/blog/2012/05/28/custom-genil-object-model-an-overview

ZCRM_ERMS_SRVO this is my structure which is I have used in my model.

zcrm_erms_srvo.JPG

This is the my Custom Model class ZCL_CRM_ERMS_SRVO.

 

zcl_crm.JPG

Redefine the method IF_GENIL_APPL_INTLAY~GET_DYNAMIC_QUERY_RESULT and write the logic.

srvo_srch.JPG

*****************************************************
*    Declaring  select-options                      *
*****************************************************
  TYPES : BEGIN OF t_selopttab,
           sign   TYPE crmsignran,
           option TYPE crmoptran,
           low    TYPE symsgv,
           high   TYPE symsgv,
          END OF t_selopttab.

 

  DATA : it_sel_objdes      TYPE STANDARD TABLE OF t_selopttab,
         it_sel_crdate        TYPE STANDARD TABLE OF t_selopttab,
         it_sel_emaifrom    TYPE STANDARD TABLE OF t_selopttab,
         it_sel_emailto     TYPE STANDARD TABLE OF t_selopttab,
         wa_sel             TYPE t_selopttab,
         wa_param           TYPE genilt_selection_parameter,
         lr_entity           TYPE REF TO if_genil_cont_root_object,
         lr_attr_props       TYPE REF TO if_genil_obj_attr_properties,
         v_key               TYPE string,
         lv_conid            TYPE string.

 

  DATA it_data TYPE STANDARD TABLE OF zcrm_erms_srvo,
          wa_data TYPE zcrm_erms_srvo,
          it_srvkt TYPE STANDARD TABLE OF zcrm_srvtkt_emp,
          wa_srvkt TYPE zcrm_srvtkt_emp.

 


  DATA lv_root          TYPE borident,
          lt_bor           TYPE crmt_ic_irec_links,
          ls_bor           TYPE relgraphlk,
          lv_guid          TYPE swo_typeid,
          it_header_guid   TYPE crmt_object_guid_tab,
          it_orderadm_h    TYPE crmt_orderadm_h_wrkt,
          wa_orderadm_h    TYPE crmt_orderadm_h_wrk,
          lv_log_handle    TYPE balloghndl.

 

*****************************************************
*            DECLARE THE TYPES                      *
*****************************************************

 

  TYPES : BEGIN OF t_sood,
          objtp  TYPE sood-objtp,
          objyr  TYPE sood-objyr,
          objno  TYPE sood-objno,
          objdes TYPE sood-objdes,
          crdat  TYPE sood-crdat,
          crtim  TYPE sood-crtim,
          END OF t_sood,
          BEGIN OF t_sost,
          rectp  TYPE sost-rectp,
          recyr  TYPE sost-recyr,
          recno  TYPE sost-recno,
          objtp  TYPE sost-objtp,
          objyr  TYPE sost-objyr,
          objno  TYPE sost-objno,
          msgid  TYPE sost-msgid,
          END OF t_sost.

 

  TYPES   : BEGIN OF t_soes,
            rectp  TYPE soes-rectp,
            recyr  TYPE soes-recyr,
            recno  TYPE soes-recno,
            msgid  TYPE soes-msgid,
            msgv1  TYPE soes-msgv1,
            msgv2  TYPE soes-msgv2,
            msgv4  TYPE soes-msgv4,
            status TYPE soes-status,
            END OF t_soes.

 


  DATA : lv_msgid TYPE symsgid,
         lv_langu TYPE char2 VALUE 'EN',
         lv_msgno TYPE char3,
         lv_msgv1 TYPE string,
         lv_msgv2 TYPE string,
         lv_msgv4 TYPE string,
         lv_message TYPE string.

 

  DATA : gt_sood TYPE STANDARD TABLE OF t_sood,
         gs_sood TYPE t_sood,
         gt_sost TYPE STANDARD TABLE OF t_sost,
         gs_sost TYPE t_sost,
         gt_soes TYPE STANDARD TABLE OF t_soes,
         gs_soes TYPE t_soes.

 


*****************************************************
*    Search Qurey and Selection Screen inputs       *
*****************************************************

 

  IF iv_query_name = 'SEARCH_SRVO'.

 

    LOOP AT it_selection_parameters INTO wa_param.
      CASE wa_param-attr_name.
        WHEN 'DESCRIPTION'.
          MOVE-CORRESPONDING wa_param TO wa_sel.
          REPLACE ALL OCCURRENCES OF '*' IN wa_sel WITH '%'.
          APPEND wa_sel TO it_sel_objdes.
        WHEN 'FROM_DATE'.
          MOVE-CORRESPONDING wa_param TO wa_sel.
          APPEND wa_sel TO  it_sel_crdate.
        WHEN 'EMAIL_FROM'.
          MOVE-CORRESPONDING wa_param TO wa_sel.
          APPEND wa_sel TO it_sel_emaifrom.

 

        WHEN 'EMAIL_TO'.
          TRANSLATE wa_param-low TO LOWER CASE.
          TRANSLATE wa_param-high TO LOWER CASE.
          MOVE-CORRESPONDING wa_param TO wa_sel.

 

          APPEND wa_sel TO it_sel_emailto.
      ENDCASE.
      CLEAR : wa_param,wa_sel.
    ENDLOOP.


* <---data fetching logic based on selection screen inputs--->

 

    SELECT objtp objyr objno objdes crdat crtim INTO CORRESPONDING FIELDS OF TABLE gt_sood FROM sood
                                                                                  WHERE crdat IN it_sel_crdate
                                                                                  AND   owntp = 'USR'.

 

    IF gt_sood[] IS NOT INITIAL.

 

      SELECT rectp recyr recno objtp objyr objno msgid FROM sost INTO CORRESPONDING FIELDS OF TABLE gt_sost
                                                      FOR ALL ENTRIES IN gt_sood WHERE objtp = gt_sood-objtp
                                                                                 AND   objyr = gt_sood-objyr
                                                                                 AND   objno = gt_sood-objno
                                                                                 AND   msgid = 'SO'.
      IF gt_sost[] IS NOT INITIAL.
        SELECT rectp recyr recno msgid msgv1 msgv2 msgv4 status FROM soes INTO CORRESPONDING FIELDS OF TABLE gt_soes FOR ALL ENTRIES IN gt_sost
                                                         WHERE   rectp = gt_sost-rectp
                                                         AND     recyr = gt_sost-recyr
                                                         AND     recno = gt_sost-recno
                                                         AND     msgv1 IN it_sel_emailto
                                                         AND     msgv2 IN it_sel_emaifrom.
      ENDIF.
    ENDIF.

 

    LOOP AT gt_soes INTO gs_soes.

 

      READ TABLE gt_sost INTO gs_sost WITH KEY rectp = gs_soes-rectp
                                               recyr = gs_soes-recyr
                                               recno = gs_soes-recno.
      IF sy-subrc = 0.

 


        READ TABLE gt_sood INTO gs_sood WITH KEY objtp = gs_sost-objtp
                                                 objyr = gs_sost-objyr
                                                 objno = gs_sost-objno.
        IF sy-subrc = 0.

 

          wa_data-objtp = gs_sood-objtp.
          wa_data-objyr = gs_sood-objyr.
          wa_data-objno = gs_sood-objno.
          wa_data-description = gs_sood-objdes.
          wa_data-from_date = gs_sood-crdat.
          wa_data-send_time = gs_sood-crtim.

 

          wa_data-email_from = gs_soes-msgv2.
          wa_data-email_to = gs_soes-msgv1.

 

          lv_msgid = gs_soes-msgid.
          lv_msgno = gs_soes-status.
          lv_msgv1 = gs_soes-msgv1.
          lv_msgv2 = gs_soes-msgv2.
          lv_msgv4 = gs_soes-msgv4.

 

          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
            EXPORTING
              input  = lv_msgno
            IMPORTING
              output = lv_msgno.

 

          CALL FUNCTION 'FORMAT_MESSAGE'
           EXPORTING
             id              = lv_msgid
             lang            = 'EN'
             no              = lv_msgno
             v1              = lv_msgv1
             v2              = lv_msgv2
*         V3              = lv_MSGV3
             v4              = lv_msgv4
           IMPORTING
             msg             = lv_message
*       EXCEPTIONS
*         NOT_FOUND       = 1
*         OTHERS          = 2
                    .
          IF sy-subrc <> 0.
* Implement suitable error handling here
          ENDIF.

 

          wa_data-status = lv_message.

 

          CLEAR : lv_msgid,lv_msgno,lv_msgv1,lv_msgv2,lv_msgv4.

 


          CONCATENATE gs_sood-objtp gs_sood-objyr gs_sood-objno INTO lv_conid.
          wa_data-conid = lv_conid.

 

          SHIFT lv_conid BY 17 PLACES RIGHT.

 

          lv_root-objkey = lv_conid.
          lv_root-objtype = 'SOFM'.

 

* Get the persisted doc flows
          CALL FUNCTION 'SREL_GET_NEXT_RELATIONS'
            EXPORTING
              object         = lv_root
              max_hops       = 1
            TABLES
              links          = lt_bor
            EXCEPTIONS
              internal_error = 1
              no_logsys      = 2
              OTHERS         = 3.
          IF sy-subrc <> 0.
            RETURN.
          ENDIF.

 

          READ TABLE lt_bor INTO ls_bor INDEX 1.
          IF sy-subrc = 0.
            lv_guid = ls_bor-objkey_a.

 

            APPEND lv_guid TO it_header_guid.

 

            CALL FUNCTION 'CRM_ORDER_READ'
              EXPORTING
                it_header_guid       = it_header_guid[]
              IMPORTING
                et_orderadm_h        = it_orderadm_h[]
              CHANGING
                cv_log_handle        = lv_log_handle
              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 sy-subrc <> 0.
*   Implement suitable error handling here
            ENDIF.

 


            READ TABLE it_orderadm_h INTO wa_orderadm_h WITH KEY process_type = 'ZSRT'.

 

            wa_data-service_tkt =  wa_orderadm_h-object_id.
          ENDIF.

 

 

 

          APPEND wa_data TO it_data.
        ENDIF.
      ENDIF.
      CLEAR : wa_data,lv_conid,lv_guid,it_header_guid,wa_orderadm_h,it_orderadm_h,lt_bor,lv_root,lv_log_handle.
      CLEAR : gs_soes,gs_sood.
    ENDLOOP.

 

*populating data into result

 

    LOOP AT it_data INTO wa_data.

 

      TRY.
          CALL METHOD iv_root_list->add_object
            EXPORTING
              iv_object_name = 'RESULT_SRVO'
              is_object_key  = wa_data
            RECEIVING
              rv_result      = lr_entity.

 

        CATCH cx_crm_genil_duplicate_rel .
        CATCH cx_crm_genil_model_error .
      ENDTRY.
      CALL METHOD lr_entity->set_attributes
        EXPORTING
          is_attributes = wa_data.

 

      CLEAR : wa_data.
    ENDLOOP.

 

  ENDIF.

srvrelt.JPG

this is the final output here we can come to know sent mails based on creating date.

Related Content

http://scn.sap.com/thread/1340812

http://scn.sap.com/thread/3181618

Related Documents

E-MAIL INBOUND CONFIGURATION- ALM: Incident Management#MAILINBOUNDCONFIGURATION-ALM:IncidentManagement-3SAPBusinessWorkflowandCommunicationSettings

How to set up Threading in ERMS

Featured Content for CRM

$
0
0

Where Should SAP CRM On Premise Invest Next? by John Burton

 

Make your voice heard! Be sure to sign up for the next round of the Customer Connection program, CRM2016, whichkicks off on Aug 26, 2015. Make sure to join today in order to get a jump start on the registration process, non-disclosure agreements, and feedback agreement forms.

 

 

The World's Greatest ERMS Configuration Guide, by Amrish Singh blog post created by John Burton - View
the full blog post

 

SAP first introduced ERMS (E-Mail Response Management System) with CRM 4.0 Service Industries Extension back in 2004. In early 2006 I published SAP Note 940882 (ERMS
FAQ Note)
that contained links to two presentations: an ERMS Overview presentation and an ERMS How-To Guide. While the How-To Guide was very well received at the time, over the next nine years the guide gradually became somewhat outdated as new ERMS features were introduced and  configuration options were modified and expanded.

 

Thankfully, I'm happy to announce that a new, updated ERMS configuration guide is now available. Amrish Singh, a Senior CRM Solution Consultant with UCS Solutions (Pty) Ltd, has created what can only be described as, "The World's Greatest ERMS Configuration Guide for SAP CRM". This new guide is based on the latest CRM 7.0 release and contains helpful and up-to-date images and screen shots.


Integration of Document Management System with SAP CRM 7

$
0
0

In this document I will discuss about the steps which needs to be done to integrate a Document Management System (Content Server) with CRM 7.

 

At first the Content Server needs to be defined which would be compatible with SAP. We have used Open Text Document Access 10.0.

 

The Content Server has to be integrated with CRM in transaction OAC0:

OAC0.PNG

Once the content server has been defined then we need to decide the document types under which we will be storing the documents. These document types will be created as folders in the content server. This configuration is done in OAC2:

 

OAC2.PNG

 

The document types is now assigned to business objects in transaction OAC3. In this transaction we decide which business objects will require the functionality of storing the documents. This configuration stores the combination of Business object, Document type and the content repository.

 

OAC3.PNG

 

In addition a new external alias needs to be defined in the content repository service in SICF transaction as shown below:

 

DMS alias.PNG

 

With all the above mentioned settings the documents can be uploaded and viewed in the attachments assignment block in the respective object as shown below:

Attachments.PNG

Attachments 2.PNG

 

Hope the information shared helps the community.

Must Do: Activities to be done to integrate SAP DQM (Address Review) with SAP CRM 7 Ehp3 – Part 1

$
0
0

In this series of documents I am going to discuss about the important steps that needs to be done for integrating the address review screen with any of the address screens in SAP CRM. The pre requisite for this activity is SAP DQM (DS 4.1) has to be connected with SAP CRM through standard RFC connections and the address review jobs needs to be run on DQM server. 


Thus I have divided the series into three parts which will cover:

 

  • Basic Integration of DQM with CRM 7
  • Integration of DQM services with UI Components
  • Additional services provided by DQM

 

In this document I am going to cover the Basic Integration of DQM with CRM 7

 

The following activities needs to be done for the basic integration in the following IMG path: SPRO > SAP NetWeaver>Application Server>Basis Services>Address Management>SAP BusinessObjects Data Quality Management

  • Maintain settings to switch off the Address Reviewer screen: This activity is required to turn on / off the address review screen based on the country settings.
  • Maintain settings for Address Validation Control: This setting should only be done on the country on which the address validation is to be triggered.
  • SAP handshake with RFC servers: The RFC connections needs to be maintained are FL_GDQC_SERVER and FL_GDQC_BATCH. These RFC connections connect with DS and fetch address related information.
  • Maintain operating parameters: This is the key configuration for integration of CRM with DQM. It determines which RFC user will talk with DQM, how much data can move in batches and what will be width of address review screen etc.

Address review.PNG

Address Review 1.PNG

 

  • Maintain fields for address reviewers: This the key configuration which provides the option for putting the sequence of fields that should be shown in the address review.

 

Address Review 2 .PNG

  • Maintain Suggestion List Fields : In this configuration the field list is shown if more than one address has been found in the output

 

  • Activate/Deactivate postal validation functionality: In this setting we can activate / deactivate the DQM functionality by activating / deactivating the BADI /FLDQ/ADDRESS_CHECK.
  • /FLDQ/47U6X BC Set also needs to be activated.

 

 

In addition the following settings needs to be done in SPRO > SAP NetWeaver>Application Server>Basis Services>Address Management> DQM: Global Data Quality Adapter: CRM7 Extension

  • We will have to activate the BADI FLDQ_BS_DUPL_FUZZY_IMPL for the fuzzy search
  • BC set /FLDQ/BSP_PV  and /FLDQ/EXT_SEARCH needs to be activated

 

This completes the basic settings for DQM integration. In the next document I am going to discuss about DQM integration with UI component.

Must Do: Activities to be done to integrate SAP DQM (Address Review) with SAP CRM 7 Ehp3 – Part 2

$
0
0

In the part 1 of this series I discussed about the basic settings of DQM with SAP CRM.In this part I will discuss about the integration of DQM service with UI Component.

 

DQM service is only supported in specific objects. As I am working in Utilities domain, I have integrated the DQM with Business Partner address and Customer Move In process.

 

The following simple steps needs to be done to integrate the UI component with DQM service:

  • Open the UI component in transaction BSP_WD_CMPWB. In this case I have taken the UI component BP_ADDR
  • Go to Component Usage in the Runtime repository editor
  • Add the component usage : Used Component /FLDQ/DQXI_PV

 

UI Addr.PNG

 

After the UI Component has been integrated with DQM then the address will get reviewed from DQM as shown in the example below.

 

UI Addr2.PNG

 

This completes the second part about DQM integration with UI component. In the next section I will discuss about the additional features of DQM


Simple navigation from one component into another component with data

$
0
0

We already have many wonderful blogs in SCN regarding navigation, here I have attempted simple approach for data sharing.

 

Step 1:  Custom Source Component

  • Create an Custom Component with view
  • This view is holding the Value node
  • Create the context node for the component controller which is similar to view’s

        Context node.

  • Bind the View’s Context Node with component controller context node.

1.PNG

Note:

Please make sure that all case sensitive letters are coming correctly,

2.PNG

Step 2: Target custom component

 

  • Create an Custom Component with view
  • This view is holding the Value node
  • Create the context node for the component controller which is similar to view’s

        Context node.

  • Bind the View’s Context Node with component controller context node.

 

** Note: Both the source and Target component context node should be same.

3.PNG

Navigation:

  • Create OP plug in view of source  component
  • Create OP plug in Window of source  component
  • Create IP plug in Window of Target Component
  • Create Component Interface for the Target component
  • Add the context node to the interface controller of the Target Component
  • Create the Component usage in the Source Component
  • Create the Navigation link in the source component

       i.e OP plug of source main window

            IP plug  of target main window.

 

4.PNG

Context Node Binding:

Source Component – Component Controller

Redefine the below method- To establish the connection between two context nodes.

 

5.PNG

Demo:

Source component will have 2 fields:

  • Contact ID
  • Contact Name

 

There will the Copy Icon- On clicking on this Icon, we will navigate to the target component

With source component data.

Create the copy button in the source component,

6.PNG

 

Test Results:

Source Component:

7.PNG

Dynamic Title descriptions in Assignment Blocks

$
0
0

2015-10-29_17h22_27.png

 

 

 

The requirement is to adopt the Title text with the number of entries in the table as shown above

 

Techincal Developments:

 

In the Overview page add the below code:



 

 

Method "Update Title" has no parameters

Method "Update_View" :

untitled1.png

 

Code :

Method : "UPDATE_TITLE"

   DATA:
      lr_view_area       TYPE REF TO bsp_dlc_ovw_assgnm,
      lv_text_element_id TYPE char70,
      lv_title           TYPE string,
      lv_hit_count       TYPE string,
      lv_ui_object_type  TYPE string,
      ui_object_type     TYPE bsp_dlc_object_type,
      lv_tmp             TYPE string,
      ls_view_area_orig  TYPE ls_view_area_orig.

   DATA: lv_viewarea TYPE string.
   DATA: lv_binding_error TYPE abap_bool.

   DATA: lr_view       TYPE REF TO cl_bsp_wd_view_controller.
   DATA: lr_sub_view   TYPE REF TO cl_bsp_wd_view_controller.
* Get component controller
*  DATA: component_controller TYPE REF TO cl_crm_es_u_bspwdcomponen_impl.
*  component_controller ?= me->comp_controller.

   FIELD-SYMBOLS: <gv_hit_count> TYPE string.
   DATA: lv_string TYPE string.

   LOOP AT me->view_area REFERENCE INTO lr_view_area.

*    IF lr_view_area->traymode = space.

     TRY.
         lr_view ?= me->get_subcontroller_by_viewname( iv_viewname = lr_view_area->appl_viewname  ).
       CATCH cx_root.
     ENDTRY.

     IF lr_view IS NOT BOUND.
       lv_viewarea = lr_view_area->sequence.


      lv_binding_error = me->update_view( iv_viewid   = lr_view_area->appl_viewname
                                            iv_viewarea = lv_viewarea
                                            iv_viewname = lr_view_area->viewname ).
       IF lv_binding_error IS INITIAL.
         TRY.
             lr_view ?= me->get_subcontroller_by_viewname( iv_viewname = lr_view_area->appl_viewname  ).
           CATCH cx_root.
         ENDTRY.
       ENDIF.
     ENDIF.

     IF lr_view IS BOUND.

       lv_string = 'lr_sub_view->GV_HITCOUNT'.


       FIELD-SYMBOLS: <current_viewarea> TYPE ltype_va_content.

       LOOP AT lr_view->viewarea_cont ASSIGNING <current_viewarea>.

         lr_sub_view ?= <current_viewarea>-current-controller.
         IF lr_sub_view IS BOUND.
           ASSIGN (lv_string) TO <gv_hit_count>.
           IF <gv_hit_count> IS ASSIGNED.
             EXIT.
           ENDIF.
         ENDIF.

       ENDLOOP.


     ENDIF.

     IF <gv_hit_count> IS ASSIGNED.
       lv_text_element_id = lr_view_area->title_ref.

       lv_title = configuration_descr->get_custom_text( lv_text_element_id ).
       IF lv_title IS INITIAL.
         lv_title = lr_view_area->title_ref.
       ENDIF.
       IF lv_title CA '()'.
         SPLIT lv_title AT ' (' INTO lv_title lr_view_area->title_ref .
       ENDIF.

       CONCATENATE  lv_title ' ( ' <gv_hit_count>  text-003 ')' INTO lr_view_area->title_ref.
       UNASSIGN <gv_hit_count>.
     ENDIF.
*    ELSEIF  lr_view_area->traymode = abap_true.
*
*      IF lr_view_area->title_ref CA '()'.
*
*
*        lv_text_element_id = lr_view_area->title_ref.
*
*        lv_title = configuration_descr->get_custom_text( lv_text_element_id ).
*        IF lv_title IS INITIAL.
*          lv_title = lr_view_area->title_ref .
*        ENDIF.
*        SPLIT lv_title AT '(' INTO lr_view_area->title_ref  lv_title.
*      ENDIF.
*    ENDIF.

     CLEAR lv_title.
   ENDLOOP.

 

 

Method UPDATE_VIEW:

 

    DATA lr_rep_view TYPE REF TO cl_bsp_wd_rep_view_ovw.
   DATA lr_rep TYPE REF TO cl_bsp_wd_repository.
   DATA lr_addview_rep_view TYPE REF TO cl_bsp_wd_rep_view.
   DATA lv_viewarea TYPE string.
   DATA lv_usg_descr TYPE bsp_wd_cmp_usage_descr.
   DATA lr_exception TYPE REF TO cx_bsp_wd_incorrect_implement.
   DATA lv_usage TYPE string.
   DATA lv_dummy TYPE string.
   DATA lv_error TYPE string.
   DATA lr_exc TYPE REF TO cx_bsp_wd_incorrect_implement.
   DATA lv_viewname TYPE string.

   lr_rep_view ?= me->get_repository_view( ).
   lr_rep = lr_rep_view->get_repository( ).
   lv_viewname = iv_viewname.

* check for component usage and view: If switched off, ignore this assignment block.
* Improve this: Don't even return switched off assignment blocks from configuration
   TRY.
       IF iv_viewid CS '.'.
         SPLIT iv_viewid AT '.' INTO lv_usage lv_dummy.
         TRY.
             lv_usg_descr = lr_rep->get_cmp_usage_def( lv_usage ).
           CATCH cx_bsp_wd_incorrect_implement INTO lr_exc.
             IF lr_exc->textid <> cx_bsp_wd_incorrect_implement=>access_2_inactive_element.
               RAISE EXCEPTION lr_exc.
             ELSE.
               rv_error = abap_true.
               RETURN.
             ENDIF.
         ENDTRY.
       ELSE.
         CASE lr_rep->check_va_assignment_defined(
          iv_rep_view      = rep_view
          iv_viewarea      = cl_bsp_dlc_config_list_based=>c_overviewarea_id
          iv_assigned_view = iv_viewid ).

           WHEN abap_false.
             RAISE EXCEPTION TYPE cx_bsp_wd_incorrect_implement
               EXPORTING
                 textid     = cx_bsp_wd_incorrect_implement=>undefined_controller
                 controller = lv_viewname
                 name       = me->view_id.
           WHEN cl_webcuif_switch=>co_reaction_hide.
             rv_error = abap_true.
             RETURN.
         ENDCASE.
       ENDIF.

     CATCH cx_bsp_wd_incorrect_implement INTO lr_exception.

       rv_error = abap_true.
       RETURN.
   ENDTRY.
   TRY.
       lr_addview_rep_view = lr_rep->get_view( iv_viewid ).
       IF  lr_addview_rep_view IS INITIAL.
         lr_addview_rep_view = lr_rep->create_by_name( iv_viewid ).
       ENDIF.
       bind_view( rep_view = lr_addview_rep_view
                   viewarea = iv_viewarea ).
       rv_error = abap_false.
     CATCH cx_bsp_wd_incorrect_implement INTO lr_exception.

       rv_error = abap_true.
       RETURN.
   ENDTRY.

 

Call update_title method in Do_prepare_output Method of overview page.

Create a instance attribute "GV_HITCOUNT" and fill in the on_new_focus of the resulting context node in the which Title has to be updated with the Counts.

Deadlocks on the DB table SUSAGE

$
0
0

In SM66 you noticed high number of processes active with Report SAPLSUSAGE_LOGGING performign DB updates on table SUSAGE. From Oracel session monitor you see several sessions with evet "enq:TX-row lock contention" running in parallel and performing database UPDATE on same table SUSAGE.

 

The work processes are locked. There are database terminations during the update. High load or parallel processing of processes that write data to the table SUSAGE may result in two processes blocking each other. As a result after some time, all work processes are blocked by write processes on this table.

SUSAGE.png

Oracle session Monitor:

 

Oracle session.png

ST22 Runtime errors:

ST22 dumps.png

The above issue should be resolved by Implementing the abap code corrections provided with SAP Note 2182269 - DB deadlock on table SUSAGE blocks all work processes.

Integration of Document Management System with SAP CRM 7

$
0
0

In this document I will discuss about the steps which needs to be done to integrate a Document Management System (Content Server) with CRM 7.

 

At first the Content Server needs to be defined which would be compatible with SAP. We have used Open Text Document Access 10.0.

 

The Content Server has to be integrated with CRM in transaction OAC0:

OAC0.PNG

Once the content server has been defined then we need to decide the document types under which we will be storing the documents. These document types will be created as folders in the content server. This configuration is done in OAC2:

 

OAC2.PNG

 

The document types is now assigned to business objects in transaction OAC3. In this transaction we decide which business objects will require the functionality of storing the documents. This configuration stores the combination of Business object, Document type and the content repository.

 

OAC3.PNG

 

In addition a new external alias needs to be defined in the content repository service in SICF transaction as shown below:

 

DMS alias.PNG

 

With all the above mentioned settings the documents can be uploaded and viewed in the attachments assignment block in the respective object as shown below:

Attachments.PNG

Attachments 2.PNG

 

Hope the information shared helps the community.


SAP Quote Header & item status Change document

$
0
0

This document will elaborate to change Quote /order /contract status in Header & item as well.

Below are the details..

 

Go to se37  --> FM CRM_STATUS_UPDATE


After run FM need to choose JEST_UPD. Next






 

 



Please the above steps need to perform when user not able to change status's then use above FM & set right status's.


Thanks,

sanjeevb

Display all Schema(s) which have assigned particular Transaction Type

$
0
0

Summary

Aim of this document is to provide technical developers with some basic code and tool to traverse from Transaction Type to Schema(s), which have the type assigned. Then it lists a list of all Categories, for which it is valid.

 

Author(s):    Pavel Duchac

Company:    Fujitsu

Created on:  26/02/2015

 

profile-image-display.png

Author Bio

Pavel is a freelance CRM Consultant, currently working with Fujitsu Australia. He has worked on multiple SAP CRM implementations across Europe and Pacific region.

 

Background

 

Multilevel Categorization in SAP CRM for Service Requests is used to display and save hierarchy (of categories), which semantically refers to a certain aspect of business object or business process.

 

This allows us to capture the attributes in a systematic manner:

Untitled2.png

 

You can link schemas with applications either via Subject Profile or via combination of Transaction Type/Catalog Category.

Untitled.png

 

We needed to get all the schemas, which had a particular Transaction Type assigned. Then we needed to get all the categories for all the Schemas we were able to find.

 

SAP provides functionality which returns all the Application Areas assigned to particular Schema. You can use class CL_FSSC_RDS_CATEGO_DATA_PRO.

 

To retrieve the information in reverse is more difficult and there is no standard mean.

 

Following code shows one way how this can be achieved.

 

REPORT zucs_crm_cat_schema01.
* Structures
DATA: lv_object_ext_key TYPE crm_erms_cat_ob_extkey,      ls_cate_data      TYPE fssc_rds_s_catego_category,      es_schema_data    TYPE crmt_erms_cat_as_buf.
* Tables
DATA: lt_tab       TYPE TABLE OF crmc_erms_cat_sp,      lt_guids     TYPE TABLE OF guid,      lt_olink     TYPE crmt_erms_cat_ob_update_ttype,      lt_link      TYPE crmt_erms_cat_ln_update_ttype,      lt_cate_data TYPE fssc_rds_t_catego_category.
* Objects
DATA: gr_file_server   TYPE REF TO cl_fssc_rds_catego_file_srv,      lr_schema        TYPE REF TO if_crm_erms_catego_aspect,      mr_data_provider TYPE REF TO cl_fssc_rds_catego_data_pro.
FIELD-SYMBOLS <ls_guid> TYPE guid.
SELECTION-SCREEN BEGIN OF BLOCK one WITH FRAME TITLE text-001.
PARAMETERS: p_ptype TYPE crmt_process_type DEFAULT 'ZFIA'.
SELECTION-SCREEN END OF BLOCK one.
CREATE OBJECT gr_file_server.
* Get a subset of tx types / cat types and subj profiles
SELECT * FROM crmc_erms_cat_sp INTO TABLE lt_tab.
LOOP AT lt_tab ASSIGNING FIELD-SYMBOL(<ls_tab>).  IF <ls_tab>-scheme_val(4) EQ p_ptype.    APPEND INITIAL LINE TO lt_guids ASSIGNING <ls_guid>.    MOVE <ls_tab>-scheme_guid TO <ls_guid>.  ENDIF.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM lt_guids.
* Get Object IDs from OBJ_EXT_KEY
IF lt_guids IS NOT INITIAL.  LOOP AT lt_guids INTO <ls_guid>.    MOVE <ls_guid> TO lv_object_ext_key.    CALL METHOD cl_crm_erms_cat_ob_db=>get_object_links      EXPORTING
*       iv_object_guid            =        iv_object_extkey          = lv_object_ext_key      IMPORTING        et_object_links           = lt_olink
*       es_object_link            =      EXCEPTIONS        object_link_not_found     = 1        invalid_search_parameters = 2        OTHERS                    = 3.    IF sy-subrc <> 0.
*   Implement suitable error handling here    ELSE.
*     Filter all ASP IDs by their status - we want active Categorization schemas only ('V')      LOOP AT lt_olink ASSIGNING FIELD-SYMBOL(<ls_olink>).        CALL METHOD cl_crm_erms_cat_ln_db=>get_category_links          EXPORTING            iv_obj_guid               = <ls_olink>-obj_guid          IMPORTING            et_link                   = lt_link
*           es_link                   =
*           et_obj                    =          EXCEPTIONS            invalid_search_parameters = 1            OTHERS                    = 2.        LOOP AT lt_link ASSIGNING FIELD-SYMBOL(<ls_link>).
*         Get CRM categorization schema data.          CREATE OBJECT mr_data_provider            EXPORTING              iv_schema_guid = <ls_link>-cat_guid.          lr_schema = mr_data_provider->get_schema_inst( ).          IF lr_schema IS  BOUND.            CALL METHOD mr_data_provider->get_schema_detail              IMPORTING                es_schema = es_schema_data.            CHECK es_schema_data-asp-asp_state EQ 'V'. "Active Schema only            CALL METHOD gr_file_server->prepare_data_for_export              EXPORTING                iv_schema_guid = es_schema_data-asp-asp_guid                iv_with_attr   = 'X'              IMPORTING                et_cate_data   = lt_cate_data.
*           Result output            WRITE: 'Categories:'.            LOOP AT lt_cate_data ASSIGNING FIELD-SYMBOL(<ls_cate_data>).              WRITE:/ <ls_cate_data>-cat_id.            ENDLOOP.          ENDIF.        ENDLOOP.      ENDLOOP.    ENDIF.  ENDLOOP.
ENDIF.

Enterprise Search in SAP CRM EHP3 7.0

$
0
0

The following document is regarding Enterprise search functionality for Trex concentrating on deletion and creation of connectors for All account,contacts and employee and finally carrying out indexing let us start doing this in step by step process to get to know more in detail.

 

Step By step Process :


1.STC01 - Delete and create connectors and run a report to SAP_ESH_CREATE_INDEX_SC

 

2.ESH_COCKPIT - Indexing the connectors for account,contacts and employee

 

1.STC01 - Delete and create connectors and run a report to SAP_ESH_CREATE_INDEX_SC :


STC01 Transaction code is used for deletion and creation of connectors for All account,contacts and employees.Here previously we used to run a report ESH_ADM_INDEX_ALL_SC till SAP CRM EHP1 7.0 version which has become obsolete now and currently in SAP CRM EHP3 7.0 it is SAP_ESH_CREATE_INDEX_SC replaced.

Untitled10.png


Go to Tcode STC01 give SAP_ESH_CREATE_INDEX_SC for Task List and click on execute system will ask to maintain task list parameters here need to make sure to tick mark under execute section for following task description except for e option below remaining needs to selected.


Untitled.png

a.Check if the Client is Configured

b.Delete Connectors

c.Select Software Component and Included Models

d.Create and Index Connectors

e.Set Parameters for Consolidating Connector Status

f.Consolidate Connector Status

Untitled1.png

In the option c "Select Software Component and Included Models" we have to maintain under fill parameters select software component as BBPCRM and select models manually here need to select object type CRM_ACCOUNT,CRM_CONTACT and CRM_EMPLOYEE as a variant and click execute.

It will ask for back ground execution of job and make sure the job runs successfully in SM37.

Untitled2.png

Untitled3.png

Untitled4.png

2.ESH_COCKPIT - Indexing the connectors for account,contacts and employee :


On successful completion of job in ESH_COCKPIT we can able to see connectors for account,contact and employee gets created after deletion and the status will keep changing from scheduled for indexing ,prepared and finally active.

 

After that we need to maintain the settings as follows  ACCOUNT- ACTIONS- SCHEDULE INDEXING- START DATE IMMEDIATELY- REAL TIME INDEXING, SELECT ALL, COPY SETTINGS and clicked OK

Untitled6.png

Untitled7.png


Untitled8.png

Untitled9.png

Untitled11.png

Note : We need to implement correction from SAP NOTE 2051372 to over come the above mentioned error "Exception at 'JOB_SUBMIT': INVALID_JOBDATA"


Happy Learning!!!


 


Schedule recurring background job - CRM_TERRMAN_PROC_REL

$
0
0

Introduction to Business Requirement:

 

I felt this need while working on SAP CRM upgrade project where the customer was making use of territory management and they were making changes to the customer <-> territory relationships very frequently. In CRM 7 where the territory solution is rule based, making changes to the customer assignment in territory on web UI and updating this relationship in table CRMD_TERR_ACCREL are two different steps. You cannot expect the right territory manager to be determined while creating an order before both steps are executed. Step 2 is executing report CRM_TERRMAN_PROC_REL in background. According to SAP best practices you should be scheduling this report to execute in background at regular interval (of say 3 hours) but what happens to the orders which are created after a change is made to the customer assignment to territory and before program CRM_TERRMAN_PROC_REL executed in background as per the schedule?

 

Here comes the need for scheduling this report program to execute in background forever.

 

I wanted to achieve this by configuration (it’s a best practice) so I started a discussion on SCN for this where I got a satisfactory answer but it landed me into another issue. Below is the link to that discussion:

http://scn.sap.com/thread/3884326

 

Conclusion: There are different ways of achieving this

 

Solution 1: By configuration (as answered in the discussion/thread above)

  1. Create a custom event using SM62
  2. Schedule a job using SM36. It should be a two-step periodic job
    1. Step 1: the main program which needs to run as background job
    2. Step 2: the program BTC_EVENT_RAISE to raise the custom event
  3. Raise the custom event manually once by executing BTC_EVENT_RAISE (in background or foreground)

Pros:

  1. It doesn’t need any coding

Cons:

  1. Event created for this purpose can only be used for execution of one program. For more than one program more events needs to be created.
  2. If the report execution in background takes very small time then it is very difficult to stop the job execution. It keeps executing in background forever

 

Solution 2: Write a custom program which keeps executing main program in background

Pros:

  1. This single program can be used to schedule different programs’ execution in background
  2. The recurrence can easily be controlled by stopping execution of custom program in SM37

Cons:

  1. It needs a custom program

 

Program code:

*&---------------------------------------------------------------------*
*& Report  ZSCHEDULE_RECURRING_JOB
*&---------------------------------------------------------------------*

REPORT zschedule_recurring_job.

DATA: lv_jname          TYPE btcjob,
lv_jcnt          
TYPE btcjobcnt,
ls_prn_param     
TYPE pri_params,
lt_joblist       
TYPE TABLE OF tbtcjob,
lv_active        
TYPE boolean.

PARAMETERS: p_pause     TYPE i DEFAULT 10,      " Pause between execution of two instances
p_prog     
TYPE PROGNAME DEFAULT 'CRM_TERRMAN_PROC_REL',
p_var      
TYPE BTCVARIANT DEFAULT 'INITIAL'.

DO.

IF lv_active EQ abap_false.

WAIT UP TO p_pause SECONDS.

* Prepare job name
lv_jname
= p_prog.

* Job open
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname         
= lv_jname
IMPORTING
jobcount        
= lv_jcnt
EXCEPTIONS
cant_create_job 
= 1
invalid_job_data
= 2
jobname_missing 
= 3
OTHERS           = 4.
IF sy-subrc = 0.

* Submit the report to execute in background
SUBMIT (p_prog) USING SELECTION-SET P_VAR TO SAP-SPOOL
SPOOL
PARAMETERS ls_prn_param
WITHOUT SPOOL
DYNPRO
VIA JOB lv_jname
NUMBER lv_jcnt
AND RETURN.

IF sy-subrc = 0.

* Job close
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount            
= lv_jcnt
jobname             
= lv_jname
strtimmed           
= 'X'
EXCEPTIONS
cant_start_immediate
= 1
invalid_startdate   
= 2
jobname_missing     
= 3
job_close_failed    
= 4
job_nosteps         
= 5
job_notex           
= 6
lock_failed         
= 7
OTHERS               = 8.
ENDIF.

ENDIF.

ENDIF.

lv_active
= abap_true.
CLEAR lt_joblist.

CALL FUNCTION 'BP_FIND_JOBS_WITH_PROGRAM'
EXPORTING
abap_program_name            
= p_prog
status                       
= 'R'                             " Running
TABLES
joblist                      
= lt_joblist
EXCEPTIONS
no_jobs_found                
= 1
program_specification_missing
= 2
invalid_dialog_type          
= 3
job_find_canceled            
= 4
OTHERS                        = 5.

IF lt_joblist IS INITIAL.
lv_active
= abap_false.
ELSE.
WAIT UP TO 2 SECONDS.
ENDIF.

ENDDO.

Enterprise Search - Using Search API programmatically

$
0
0

Objective: Search a text string programmatically using Enterprise Search API. Business scenario is to input text and search account and contacts in relation.

 

We would be exploring the standard classes to check the connection with ESH & get desired search results.

  • Connection details are obtained from table esh_adm_sc_main.
  • Class CL_ESH_IF_SEARCH_REQUEST is used for search request.
  • Class CL_ESH_IF_SEARCH_RESPONSES is used for search responses.
  • Class CL_ESH_IF_SEARCH_CONNECT for search response of connectors.


 

Class CL_ESH_IF_SEARCH_REQUEST is the prime API for using Enterprise Search. Important methods for the class are SET_SEARCH_TEXT, SET_SEARCH_SCOPE, SET_START_INDEX.


The Technical Object can be designed to accept a String(Text) as an input and the Number of hits(Hits), the values returned(Values) and the return message(Msg) as output.


CODE SNIPPET

 

DATA:    ls_esh_admin     TYPE                 esh_adm_sc_main,
              lr_req                  TYPE REF TO   cl_esh_if_search_request,
              lv_text                 TYPE                 string,
              lv_flag                 TYPE                 char01,
              lr_resp                TYPE REF TO   cl_esh_if_search_responses,
              lr_connect          TYPE REF TO   cl_esh_if_search_resp_connect,
              lv_resp_no        TYPE                 i,

              lt_partner            TYPE                zesh_search_account_res,

              lr_cx                    TYPE REF TO  cx_esh_if_engine.

 

TYPES: BEGIN OF     ty_final,
            connector_id         TYPE        esh_e_if_search_connector_id,
            request_type_id    TYPE        esh_e_if_request_type_id,
            data                      TYPE REF TO data,
            hits                       TYPE         i,
            all_hits                  TYPE         i,
            time                      TYPE         i,
            error                    TYPE         string,
              END OF        ty_final.

 

  DATA: lt_final TYPE ty_final.


   FIELD-SYMBOLS:  <fs_result>     TYPE          ty_final.
   FIELD-SYMBOLS:  <ft_data>        TYPE ANY TABLE.
   FIELD-SYMBOLS:  <fs_wa>          TYPE         any.
   FIELD-SYMBOLS: <fs_temp>.

 

  Getting the connection details for Accounts

  SELECT SINGLE * FROM esh_adm_sc_main INTO ls_esh_admin
     WHERE template_id EQ 'BBPCRM~STANDARD~CRM_ACCOUNT~' .

   IF sy-subrc EQ 0.

  Instantiating the Class instance for Search

     CREATE OBJECT lr_req.
     MOVE text TO lv_text.
     lr_req->set_search_text  ( iv_text = lv_text ).

  Add Search scope to search for Accounts

     lr_req->add_search_scope  ( EXPORTING    iv_connector_id     =  ls_esh_admin-sc_id
                                                                             iv_request_type_id = 'CRM_ACCOUNT'
                                                    EXCEPTIONS  not_searchable     = 1
                                                    ).

   Initiating the search
     lr_resp = lr_req->search(  ).

    Getting number of responses

     lv_resp_no = lr_resp->get_number_of_responses(  ).

     WHILE lr_resp->has_next_response( ) = abap_true.
     APPEND INITIAL LINE TO lt_results ASSIGNING <fs_result>.

 

       TRY.
         lr_connect ?= lr_resp->get_next_response( ).

       ENDTRY.

       lr_connect->get_scope( IMPORTING ev_connector_id    = <fs_result>-connector_id
                                             ev_request_type_id = <fs_result>-request_type_id ).

       TRY.
           lr_connect->get_exception( ) .
       ENDTRY.
      Getting the results in Raw format
       lr_connect->get_results_data_raw( IMPORTING er_raw_data = <fs_result>-data ).
       CHECK <fs_result>-data IS BOUND.
       ASSIGN: <fs_result>-data->* TO <ft_data>.
       CHECK <ft_data> IS ASSIGNED.
       DESCRIBE TABLE <ft_data> LINES <fs_result>-hits.
       <fs_result>-all_hits = lr_connect->get_number_of_total_results( ).

     ENDWHILE.
     ENDIF.

   DESCRIBE TABLE <ft_data> LINES <fs_result>-hits.
   <fs_result>-all_hits = lr_connect->get_number_of_total_results( ).

   Hits = <fs_result>-all_hits.
   if return_hits ne 0.
   LOOP AT <ft_data> ASSIGNING <fs_wa>.

     ASSIGN COMPONENT 'BP_NUMBER' OF STRUCTURE <fs_wa> TO <fs_temp>.
     lt_partner-bp_partner = <fs_temp>.
     UNASSIGN <fs_temp>.
     ASSIGN COMPONENT 'ACCOUNT_NAME' OF STRUCTURE <fs_wa> TO <fs_temp>.
     lt_partner-account_name = <fs_temp>.
     UNASSIGN <fs_temp>.
     APPEND lt_partner TO Values.
   ENDLOOP.
   else.
     return_message = 'No Results'.
     endif.


Viewing all 252 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>