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

Configuration Sales Order Confirmation Adobeform in CRM Server

$
0
0

Configuration Sales Order Confirmation Adobeform in CRM Server


E-mail message informing a customer that an order has been confirmed. It is triggered in CRM. Need to configure the Adobeform in SPRO for Sales Order Confirmation.


Go to Transaction SPRO

 

Customer Relationship Management->Basic Functions->Actions->Actions in Transaction->Create Actions with Wizard


1.jpg


2.jpg

Click Continue


3.jpg

Click Continue


4.jpg

Click Continue

5.jpg

Processing Time - Processing When Saving Document

Click Continue

6.jpg

Enter Partner Function – 00000001 (Sold-to-Party)

Click Continue

7.jpg

Click External Communication and then Continue


8.jpg

Form Name - <Name of the Adobeform>

Form Type – PDF-Based Forms

Format – <Filter name of the BADI 'DOC_PERSONALIZE_BCS’>


Click Continue

9.jpg

Click Continue

10.jpg

Click Continue


11.jpg

Click Continue

12.jpg

Click Complete


Need to implement BADI ‘DOC_PERSONALIZE_BCS’ and enter in Format. It is a filtered BADI.

13.jpg

Need to implement the logic to trigger the Adobeform in the IF_EX_DOC_PERSONALIZE_BCS~PERSONALIZE_PDF_DOC_PDFIF


14.jpg

So from transaction CRMD_ORDER, for any Sales Order when saving any data, an email will be send to the Sold-to-Party email id set in BP.


16.jpg



Enhancement for IBASE level up button - note 2008482

$
0
0

I am responsible for CRM IBASE application( software component CRM-MD-INB) and recently we received a customer tickets complaining the behavior of Level up button. Let's use an example to demonstrate:

 

Issue description

 

Suppose I have three IBASEs with external ID JERRY_IB1, JERRY_IB2 and JERRY_IB3.

 

JERRY_IB3 is included in both JERRY_IB1 and JERRY_IB2.

clipboard1.png


JERRY_IB3 contains one object component. When focus is kept on object component, we can click Level up button so that the focus is automatically switched to its parent, JERRY_IB3 instead. All the assignment blocks in the right part are displaying data of JERRY_IB3 now.

clipboard2.png

However, now focus is set on JERRY_IB3 and Level up button is disabled, since we are already in the root node of the current IBASE tree. But considering the global IBASE hierarchy, customer expects that they can set focus on JERRY_IB3 and click level up button, so that they could navigate to either JERRY_IB1 or JERRY_IB2. Currently this function is not available, the button id disabled.

clipboard3.png

Enhancement to fix the gap

 

Our PO considered this as an issue, so our team has released a note 2008482 to enhance the behavior of Level up button.

 

After enhancement, the level up button would be enabled for any IBASE which has a parent IBASE. In our case it works for JERRY_IB3. Once clicked, a pop up window will appear which lists all parent IBASEs and allows customer to specify which parent IBASE they could like to navigate to.

 

clipboard4.png

The detail about enhancement could be found in note and here just list them briefly:

 

1. enhance method GET_BUTTON of CL_IBHIER_TREE_IMPL to add the logic that if the current IBASE has parent IBASEs assigned, enable the level up button. The hierarchy is got via function module CRM_IBASE_COMP_FIND_MULTI. Since this getter would be called during earch roundtrip, for performance reasons the result is buffered in internal table gt_ibase_map. The buffer will be cleared when user navigates away from the tree view ( done in method DO_CLEANUP_CONTEXT ).

 

2. enhance method EH_ONLEVEL_UP of CL_IBHIER_TREE_IMPL: if selected IBASE has only one parent, navigate to it directly without popup displayed. For multiple parent case, the navigation is launched after user choose one from the popup window. The navigation is implemented via dynamic navigation.

 

For technical detail how to achieve dynamic navigation you can refer to document from Nawal Kishore.

 

3. develop a new view for popup display: CRMCMP_IBSEARCH/IBParentsListForLevelUp.

 

In case you have any question for this note or any other general questions regarding IBASE, feel free to discuss with me

Top 10 viewed SAP KBAs for April 2014

$
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 April 2014.

Overview

Below are the top 10 most viewed SAP KBAs for CRM.
KBA NumberKBA Title
How to analyse problems related to session loss or logoff in CRM WebUI
The ASSERT condition was violated
1846041
How to analyze why an ERMS inbound E-Mail is not found in the agent inbox
1836437
How to step up an IC Agent role - technical prequequisites from customizing point of view to prevent errors
1866327
How to identify root cause of a session in SM04 when working with a CRM IC business role and steps for resolving in case of errors
1866138VM_STACK_TRACE dumps in CRM
1778276Short Dump occurs in CF_ASIT_INTERNAL==============CP when opening the Change History assignment block in an Opportunity
Transaction launcher trouble shooting and how to identify if the problem is related to ITS or transaction launcher itself?
1637445CRM Web UI with Interaction Center business role hangs after logon
1849381How to debug CRM WebUI using Conditional Breakpoints
Please note, in order to view the contents of the SAP KBAs, you will need to be logged into Service Marketplace.

Related Content

MarchAprilMay
Top 10 viewed KBAs for April 2014Top 10 viewed KBAs for May 2014

SAMPLE DOCUMENT FOR EDIT ROWS IN DYNAMIC RESULT TABLE VIEW

$
0
0

Recently i have found some posts like how to edit the dynamic result list in search/result view because of that I made this document.


Create search and result view by using this link.


SAP CRM OneOrder Advanced Search WebUI Component - part1

 

CRM 7.0 How to --5E Search View and Search Result


step1 :  For edit the table fields go to do_init_context method in result view.


Double click on that method ( do not redefine the method ) and change the selmode_single to selmode_multiedit.


rr.JPG

  typed_context->RESULTCN->set_selection_mode(

IV_SELECTION_MODE = CL_BSP_WD_CONTEXT_NODE_TV=>selmode_multiedit

).

Step 2 :  Go to the result view and generate getter and setter methods for the result fields.


getter_setter.JPG


In this scenario I want to display partner field editable and rest of the fields are in disabled mode because of that i generate getter and setter methods for PARTNER .  Using Get_I method you can make your field as grade out based up on any condition.


IF  CURRENT->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'PARTNER' ) IS  INITIAL.
RV_DISABLED =
'TRUE'.
ELSE.
RV_DISABLED =
'FALSE'.
ENDIF.


Step 3: In result view redefine the method do_prepare_output.

do_prepare.JPG

view_group_context->SET_VIEW_EDITABLE( iv_view_controller =  me ).


Step 4: In result view .htm check whether displaymode attribute field is available or not if not attach tag attribute displaymode in .htm


rhtml.JPG



Step 5 : redefine SET_VIEW_GROUP_CONTEXT in window controller.


win.JPG

write the below logic..

if you want to know more about why we need this method go through this link..


SAP CRM WEB UI : 47.UNDERSTANDING VIEW GROUP CONTEXT


IF ME->VIEW_GROUP_CONTEXT isnotboundand IV_FIRST_TIME = ABAP_TRUE.

IF IV_PARENT_CONTEXT ISINITIAL.

CREATEOBJECT VIEW_GROUP_CONTEXT TYPE CL_BSP_WD_VIEW_GROUP_CONTEXT.

ENDIF.
ENDIF.


This is the final output.


resu.JPG



Thanks & Regards

Srinivask

Featured Content for CRM

$
0
0

2014 SAP CRM Insider Event

 

Join us on 14-16 May at the Nice Acropolis Convention Center. The premier event for SAP® sales, marketing, e-commerce, service, and interaction center management

 

Join your peers and the top experts in SAP Customer Relationship Management (CRM) technology for this event on 14 -16 May, which is loaded with practical content and actionable advice.

 

In these seven comprehensive tracks, you will learn about new strategies, in-depth education, and critical updates on SAP CRM technology:

  • CRM Strategies
  • Sales
  • Marketing
  • Customer Service
  • Mobile and Cloud Technologies
  • Technical Infrastructure and Data Management
  • Implementations, Upgrades and Enhancement Package Projects

 

CRM 2014is co-located with Logistics & SCM, PLM, Manufacturing, and Procurement 2014. Registration at one conference admits you to all events at no additional cost.

Don't miss this important educational and networking opportunity.

 

Register now !

 

 

Desktop Connection with iCRM Is Now GA

Combine the power of SAP CRM with the familiarity of Microsoft Outlook. SAP’s Desktop Connection is the tool that helps you achieve this goal. It has moved out of restricted Ramp-Up and is now available to all customers.

Create Webservice enabled word document in attachment assignment block

$
0
0


In CRM webclient ui there is a reuse assignment block "Attachment" which are available for most of CRM application.


clipboard1.png

There is a button "With Template" which allows you to create word document whose content will automatically be filled by the web service created by you via web service tool in CRM. This document explains how to archive this step by step and illustrate the technical detail behind it.

 

 

This feature is especially useful if you need to fulfill the scenario to create lots of documents for business transaction like Sales order and the document content consists of both static text and dynamic values like Order ID, Order description etc. Then you just need to create a single document template with all static text, and those dynamic values could be filled by web service in the runtime.

 

 

In this document I will create such word document for Product as example. The logic is exactly the same if you could like to create web service enabled document for others such as Sales Order, Service order, Opportunities etc.

 

1. Create your own web service which will be consumed by your word document.

 

As Arjun Pawar has already written an excellent document All about Web services - Web Service Tool, I will not repeat the detailed creation steps, but just include the productive web service I created:

 

There are some important attributes which we can write down for later usage:

 

a. I specify BOR type BUS1178 for my web service

b. The genil component PROD is assigned to my web service together with its root node "Product"

c. I have only enabled "Read" operation for my web service

d. There is one function group automatically generated: /CRMOST/JERRY_PROD_WS_FCT. We will discuss it later.

 

clipboard2.png

2. Download the word plugin "SAP Data Panel" from service market place. This wiki could guide you how to download and install in your computer.


If you encounter any problems, feel free to contact me.

 

After successful installation, create a new word document and you will see a new menu "SAP":

clipboard3.png


It should appear in Active Application Add-ins in your Word option.

clipboard4.png

3. Create a new word template.

 

Work center "Service Operation",

clipboard5.png


Fill all mandatory fields like below and click "Start Designer" button:

clipboard6.png

click Open in new popup:

clipboard7.png

Then a new empty word document is opened. In the right part, the "SAP Data Panel" addin will display all fields available in root node Product of Genil component PROD as a tree, the root node is named "JerryProdWs", which is just the web service we created in step1.

 

Now you can edit this word template by adding the static part like header, footer, field label. Just select the field in the SAP Data Panel, drag it into the left part and drop.

clipboard8.png


This is the final version of my word document. If you put the mouse over the dynamic fields which are dragged from SAP Data Panel, it will be marked with a grey rectangle as a hint that it is dynamic.


clipboard9.png

Once click, the technical name will be displayed on top of it.

clipboard10.png

Now since I already finish the template edit, I could directly close the word application.

 

4. Go to Product application, click "With Template" button:

clipboard11.png

in popup choose the template created in previous step:

clipboard12.png

Then the word application is automatically launched with all dynamic data filled as expected:

clipboard13.png

Close the word application and then this document will be saved and appear in the attachment assignment block:

clipboard14.png

Automatically generated Artifacts after web service creation

 

In step1 after web service creation we write down the function group name /CRMOST/JERRY_PROD_WS_FCT.

 

In fact there are other artifacts automatically generated by system which are necessary for web service runtime processing:

 

You will find the function group in package $WS_BOL_GEN ( all function group for other web service are also put here )

 

Since I have only enabled Read Operation during web service creation step, so within this generated function group there is only one generated function module which will delegate the web service call to the method GET_OBJECTS of Genil implementation class CL_CRM_PRODIL of genil component PROD.

clipboard15.png


also the generated DDIC structure for web service input & output parameter:

clipboard16.png

Query table VEPFUNCST with VEPNAME = my web service name, I can find one generated simple transformation:

clipboard17.png

we can view its content via tcode STRANS:

clipboard18.png

How to debug the web service call

 

In case your word document content is not correctly filled by web service, you have to configure out whether it is caused by any issue of the web service provider implementation itself ( in my example it is CL_CRM_PRODIL method GET_OBJECTS ) , or there is another possiblity that the data is correctly returned by the service provider, but lost or conrupt during web service framework processing for example output parameter mapping. You can debug to find the root cause.

 

The entry point is the Office integration handler class CL_OI_HANDLER to handle with the http request:

clipboard19.png


You can set breakpoint on the generated read function module to check whether the call is successfully delegated to the service provider - Genil component implementation class' GET_OBJECTS method:

clipboard20.png

Then check whether the response returned by service provider is correctly processed by framework via transformation:

clipboard21.png

clipboard22.png

Enhance the value assignment via BAdI Implementation


Sometimes the standard processing of Web service framework might not work exactly as what you expect. Take product application for example,

 

Suppose you drag the field UPNAME into word document, and through debugging you can confirm that its content is correctly returned by Genil implementation class, but discarded by framework in method clear_attributes in line 49:

 

clipboarda1.png


Since the Product application marks field UPNAME as HIDDEN field, so it will be cleared in the final web service output structure:

clipboarda2.png

However if your business scenario does need all hidden fields to be also filled, you can create a BAdI implementation based on enhancement spot CRM_WST_RT_ENHANCEMENT. Specify your web service name as Filter value for SERVICE_NAME.

clipboarda3.png

The BAdI implementation is called AFTER framework processing, so now you have the chance to fill any empty fields all by yourself, since all relevant context are available in changing parameter OUTBOUND.

clipboarda4.png

Create Webservice enabled Adobe PDF attachment in CRM Application

$
0
0

In my previous document Create Webservice enabled word document in attachment assignment block,

the use case and detailed steps to use web service enabled word document in CRM Attachment assignment block are illustrated.

 

Since there are two alternative document types, this document will explain how to create web service enabled PDF attachment for CRM application.

 

Prerequisites

 

1. You should have Adobe Livecycle Designer installed so that you can use it to develop your adobe form template.

 

2. The ADS ( Adobe Document Service ) web service should correctly be configured in your application server. Run the health check report FP_PDF_TEST_00 and ensure the version information is successfully returned. The ADS will be used to render your adobe form template into PDF format in the runtime.

clipboard1.png

 

3. You should have an available web service created in CRM web client UI via web service tool. For detailed steps please refer to my previous document.

 

In this document I will use the Webservice ZJERRY_PROD_WS where the READ operation is defined on BOR type BUS1178 ( Product ).

 

 

Step by step processes

 

 

1. Create an Adobe form template like below. Maintain the web service you have created before.

clipboard2.png

Click the Download button first for "Download Schema", a pop up dialog will appear, save it locally.

clipboard3.png

The Schema is itself a xml file which describes the meta structure of your web service and will be confused by your adobe form template in next steps.

 

2. Click button "Start Designer", then the Adobe designer installed in your laptop will be opened automatically. Then Choose menu File->New to create a new form template.

clipboard4.png

if the open fails, check whether you have enabled the corresponding Active Control settings in your browser with reference to note 1018674.

 

In my opinion it is not a must to launch Adobe Designer via ActiveX, since you could manually start it at any time.

 

3. load the xsd schema file you stored locally in step1. Switch to tab "Data View" and choose "New Data Connection" from context menu,

 

clipboard5.png


Choose "XML Schema":

clipboard6.png

Load the local xsd schema file with default settings unchanged and click Finish button:

clipboard7.png

Now in Data View tab, you should see the hierarchy tree which has exactly the same appearance as what you have see in SAP Data panel in document Create Webservice enabled word document in attachment assignment block

clipboard8.png

4. Now you can start to develop the layout of adobe form template. Create a new text field and bind it to the field ProductId in Data connection tree which you generate in step3 by importing xsd schema. Data binding means in the runtime, this text field will be filled with the actual transaction data of ProductId, which will be returned by service provider. The binding could be started by clicking the small triangle below:


clipboard9.png

Follow the path Use "DataConnection"->Output->ZjerryProdWs->ProductId:

clipboard10.png

After binding the binding property for the text field should look like below. In the DataConnection tree view, there is a new icon which indicates the field ProductId is bound to a certain UI element in the template.

clipboard11.png

Finish the template layout design by adding several other fields and bind them to other fields in Data Connection.

clipboard11.png

5. Save the templage as xdp form via "Save as" menu in Adobe Designer, then upload it back to CRM via Upload button.

clipboard12.png

6. Now go to CRM product application, create a new attachment for a given product, select you form template in popup:

clipboard13.png

And ADS will render it as a PDF document for you:

clipboard14.png

Trouble shooting

 

The idea of trouble shooting is exactly the same as those explained in Create Webservice enabled word document in attachment assignment block.

 



How to resolve Unauthorized error message when defining external web service for document template

$
0
0

Previously I have written two documents about how to create document template with Word or Adobe PDF format which support web service created by Web service tool available in CRM Web client UI:

 


Besides that you could still use external web service from third party or created from a remote function module via tcode SOAMANAGER in ABAP system.

 

However when you paste the URL of your WSDL as below and press enter key, you meet with the error message "Unauthorized".

 

clipboard1.png

Before we start to trouble shooting, we'd better quickly go through this document how to create and consume web service in ABAP systemto have a basic idea about web service creation and consumption in ABAP system.


Why we will see this Unauthorized error message

 

 

The position of this error message could easily be found via the tip described in my blog How to quickly locate the source code where raises a given message in webclient UI:

 

The WSDL URL we input is used to initialize one instance of cl_http_client and then cl_http_client~send and cl_http_client~receive are called to get the content of this WSDL.


clipboard2.png

Then we get expected 401 Unauthorized error, since we didn't specify any credentials in this generic code.

clipboard3.png

go to tcode SICF and find the ICF node /default_host/sap/bc/ ( which is the parent node of the ICF service generated for our web service), the logon procedure for it is set as "Standard".

clipboard4.png

According to SAP help, Standard logon procedure means the framework will do authentication check based on the following orders until one avalid credential found. In our case, none of the seven attempts succeed, so finally we see 401 Unauthorized error.

clipboard5.png

How to resolve the error

 

 

According to SAP help, after I add the following code to enable HTTP Basic Authentication, the error is gone.

 

clipboard6.png

Of course this could not be used in productive code, we need to find a more generic solution.

 

Go outer callstack of 401 error, I find there is another way to initialize http client instance by RFC destination instead ( line 49 ).

Doing a where used list on class attribute mv_destination and soon I found there is a BAdI definition which could allow us to specify a HTTP destination for the external web service being used:

 

clipboard7.png

So the solution would be:

 

 

1. Create a HTTP destination in tcode SM59

 

Maintain "Target Host", "Service No."( that is port number ) and paste the left part of WSDL URL to "Path Prefix".

 

clipboard8.png


Maintain user and password:

clipboard9.png

2. Create a BAdI implementation on BAdI definition CRM_OI_WEBSERVICE_BADI

 

 

Implement the method GET_SERVICE_DESTINATION. fill the changing parameter cv_destination. You could do filtering based on the importing WSDL URL and Operation, in this example I just hard code the name of RFC destination created in step one.

 

clipboard10.png


Now this destination will be used to create http client instance and the 401 error message is then resolved.

clipboard11.png

clipboard12.png


SAP CRM MAIL FORMS Simplified (Author : Prasun Roy Chowdhury )

$
0
0


    SAP CRM MAIL FORMS SIMPLIFIED

Author
Prasun Roy Chowdhury

 

 

  1. Login to SAP CRM Web UI with MARKETINGPRO

 

1.jpg

 

2. choose ‘Marketing - > Mail Forms

2.jpg

 

3.jpg

 

3. . Click on new button.jpgto create a new Mail Form

4.jpg

 

4. Fill the General Data section

4.jpg

 

Enter Mail Form ID, Description, Language, Usage.

The attribute context for ERMS mail forms should always be ’Email Response Management’, otherwise the ERMS related attributes will not be
available for the mail form.

 

5. Enter the text that you want to display on the Email

6.jpg

 

6. Use button Insert Pic button.jpg(insert picture) to select a graphic you like to include in the form. Be sure to have
your cursor positioned where you like to insert the graphic.

6.jpg

 

Choose the file from your computer

27.jpg

 

Click the  Insert Pic button.jpgbutton. The Image is now been added to your mailform.

 

7. To add a hyperlink to your email, we need to follow the below steps.

A hyperlink can be added in two ways. You could simply type the URL in the text or you could use the Hyperlink button.jpg   button
and enter the required data in the hyperlink screen.

 

The link will be added to the mail form when you click Insert. Be sure to have your cursor positioned where you like to insert the hyperlink.

10.jpg

 

Once the Mail Form is completed press save button.jpgto save the Mail Form 


8. To preview your email click preview button.jpgbutton. You will now get the following screen

 

13.jpg

 

9. Adding attributes to your email

 

Click the  attribute button.jpgbutton to insert attributes. Then you can dynamically enter the attributes from your SAP CRM database.

14.jpg

 

15.jpg

 

16.jpg

 

The attributes will be now visible in the e-mail text.

17.jpg

 

 

10. Enter the Sender and the Receiver email id

18.jpg

 

11. Add the Business partner number, the attributes data will be picked up from the master data of this business partner

19.jpg

 

20.jpg

 

Click the preview button.jpgbutton now to see the final preview of the email that will be send. As you can see the Salutation and Name have picked up from the Master data of Business Partner automatically.

21.jpg

 

12. Send the email. In Tcode SOST, you can check the email that’s been send.

 

Click the send test button.jpgbutton to send the email to the customer  i.e. prasun@test.com

 

22.jpg

23.jpg

 

13. Finally the email arrives in the Customers mail Inbox. Bingo!!!!

24.jpg

 

I hope this article will help all aspirants who want to learn SAP CRM Mail Forms.

 

 

Warm Regards,

Prasun Roy Chowdhury

BADI's to extend One Order Transaction in SAP CRM ( Author: Prasun Roy Chowdhury )

$
0
0

BADI's to extend One Order Transaction in SAP CRM

 

Author : Prasun Roy Chowdhury

 

BADI (Business Add-In) is a SAP OOP enhancement technique which is used to add custom business functionality to the existing SAP standard
functionality.

 

A number of BADIs are available for One Order Business Transactions in SAP CRM.

They are as follows:

 

1. CRM_COPY BADI

 

Copy control for One Order Documents. It can be used to enhance or customize creation of Follow-up Transactions in CRM

CRM_COPY_BADI.JPG

 

 

2. CRM_ORDER_INDEX_BADI

 

This BADI can be used to update the Order Index in table CRMD_ORDER_INDEX

CRM_ORDER_INDEX_BADI.JPG

3. CRM_ORDER_FIELDCHECK

 

This BADI can be used to perform fieldcheck during transaction processing

CRM_ORDER_FIELDCHECK.JPG

 

 

4. CRM_UPLOAD_BEA_FILL

 

This BADI can be used to map the fields of the billing engine

 

CRM_UPLOAD_BEA_FILL.JPG

 

5. COM_PAYCARD_BADI

 

This BADI can be used to extend structure for communication with clearing house.

COM_PAYCARD_BADI.JPG

 

6. COM_PARTNER_BADI

 

This BADI can be used to add custom logic can be implemented for Partner Processing in Business Transactions

COM_PARTNER_BADI.JPG

7. ORDER_SAVE

 

This BADI can be used to check the data and manipulate it as per custom requirement before the order is saved.

ORDER_SAVE.JPG

 

 

 

8. CRM_COND_COM_BADI

 

This BADI can be used to extend the communication structure in Pricing

CRM_COND_COM_BADI.JPG

 

 

 

 

9. CRM_DATAEXCHG_BADI

 

This BADI can be used to exchange data with SAP R/3

CRM_DATAEXCHG_BADI.JPG

 

 

 

10. CRM_30A_USER_EXITS


This  BADI can be used to exchange data with Mobile Clients.

CRM_30A_USER_EXITS.JPG

 

11. CRM_ORDER_STATUS

This  BADI can be used to control the events when the specific status is set.

CRM_ORDER_STATUS.JPG

Create word attachment which consumes external web service

$
0
0


In these two documents below, I have demonstrated the steps how to create word or pdf document as attachments which could consume web service created via CRM web service tool.


Create Webservice enabled Adobe PDF attachment in CRM Application

Create Webservice enabled word document in attachment assignment block


As we could find in document template creation UI, there is a third option which allows us to assign a WSDL URL of an external webservice to a document template. So this document will explain how to create a word template which could consume your own web service, instead of the one created via CRM web service tool.

clipboard1.png


Ensure you have a working web service

 

for simplicity I just create a simple function module which do the add operation and expose it into web service with tcode SOAMANAGER.

clipboard2.png

In order to consume it, An ABAP proxy is needed.

 

Test the ABAP consumer proxy in ABAP workbench and make it work, since it will be used later:

clipboard3.png

clipboard4.png

You could use this document as reference about how to expose a function module into web service via SOAMANAGER and the necessary configuration to consume it in ABAP.


Create word template and assign your webservice WSDL to it


In document creation UI, choose radio box "Own WSDL URL", paste your web service WSDL URL to input field and press entry key, then your web service operation will appear in dropdown list automatically. Choose your operation and click button "Start Designer".

 

If you meet with 401 unauthorization error message after enter key is pressed, refer to this document about solution:

 

How to resolve Unauthorized error message when defining external web service for document template

clipboard5.png

Now a new word document is opened. You could drag the output variable EV_RESULT from SAP Data panel to your word body area.

Its content will be filled by your web service in the runtime. Finish the template development.

clipboard6.png

Implement BAdI to consume the web service

 

Create a BAdI implementation via the customizing activity below:

clipboard7.png

You could refer to my implementation code below:

 

 

DATA: lo_proxy            TYPE REF TO co_zweb_add_21,

            ls_input            TYPE zweb_add_operation,

            ls_output           TYPE zweb_add_operationresponse,

            lo_payload_protocol TYPE REF TO if_wsprotocol_payload,

            lo_payload          TYPE REF TO if_ws_payload,

            lo_payload_handler  TYPE REF TO if_ws_payload_handler,

            lt_request_data     TYPE prx_t_param,

            ls_request_data     TYPE prx_s_param,

            lv_valid_from       TYPE comt_valid_from.

 

 

 

line 17: Create an instance of ABAP consumer proxy class.

 

line 21: The current business object instance GUID is included in importing parameter IS_OBJECT-INSTID.

Since my word template is created based on BOR type BUS1178, so I could directly query product database table COMM_PRODUCT to

find the corresponding product record.

 

line 24 ~ 27: I just fetch the valid from timestamp of current product and pass the date value to the first importing parameter of web service call. The second importing parameter is assigned with 0, so in the final word document we will see the valid from date of current product.

 

line 28: execute web service call, the result is included in parameter ls_output.

 

line 38 and 39: pass out the web service response payload to changing parameter, which will be used by Office integration framework to merge with word template.

clipboard8.png

Test in UI

 

Now you could create attachment based on your word template by clicking button "With Template". Choose the word template you have just developed from pop up window:

clipboard9.png

you could still set breakpoint in your BAdI implementation and the function module exposed as web service to observe how they are consumed in the runtime:

clipboard10.png

clipboard11.png

Finally the web service calculation result is displayed in the word document.

clipboard12.png

Actions assignment block in Interaction record.

$
0
0

Hi,

 

Requirement : Enhancement in which  Actions are needed to build in Interaction record in UTIL_IC agent.

 

Design  :

 

UI Component :  GSACTIONS

View :  GSACTIONS/Actions

 

 

 

Enhance this view in your enhancement set. redefine the method set_view_group_context and add the code

 

 

IF IV_PARENT_CONTEXT IS INITIAL.
      CREATE OBJECT ME->VIEW_GROUP_CONTEXT TYPE CL_BSP_WD_VIEW_GROUP_CONTEXT.

      VIEW_GROUP_CONTEXT->SET_VIEW_EDITABLE( ME ).
    ELSE.
      ME->VIEW_GROUP_CONTEXT = IV_PARENT_CONTEXT.
    ENDIF.

 

now got to component ICCMP_BT_ACT.

create a component usage for the GSACTIONS/Actions. Please note standard have already exposed the required view in GSACTIONS. once you have created the component usage go to component structure browser and create an overview page. I created an overpage because action AB contains some important fields in it view and all ae required to be visible completely on view. Adding it in ICCMP_BT_ACT/ActViewSet would have added it to the area between notes and notes log which would have not displayed all fields.

So create an overview page. Assign the ICCMP_BT_ACT/ActViewSet and component usage view

Now build one custom controller with model nodes for BTadmiH and ACIActionContext and bind the first one with component controller.

Create the ON_NEW_FOCUS for ACIACTIONCONTEXT and add the code


 

entity ?= focus_bo.
    TRY.
        lv_collection = entity->get_related_entities(
               iv_relation_name = 'BTHeaderAction' ).

      CATCH cx_crm_genil_model_error.
*       should never happen
        EXIT.
      CATCH cx_sy_ref_is_initial.
    ENDTRY.
    me->collection_wrapper->set_collection( lv_collection ).
BTHeaderAction relation is used to get the object id.

 

Now go to your component controller and redefine it and in wd_usage_initialize bind the nodes with usage name with the code

 

 

WHEN 'ScheduledActions'.

        IV_USAGE->BIND_CONTEXT_NODE(
                    IV_CONTROLLER_TYPE  = CL_BSP_WD_CONTROLLER=>CO_TYPE_CUSTOM
                    IV_TARGET_NODE_NAME = 'ACIACTIONCONTEXT' "#EC NOTEXT
                    IV_NAME             = '/PES/ICCMP_BT_ACT/CuActionCuco' "#EC NOTEXT
                    IV_NODE_2_BIND      = 'ACTIONCONTEXT' ). "#EC NOTEXT

        IV_USAGE->BIND_CONTEXT_NODE(
                    IV_CONTROLLER_TYPE  = CL_BSP_WD_CONTROLLER=>CO_TYPE_CUSTOM
                    IV_TARGET_NODE_NAME = 'BTADMINH'        "#EC NOTEXT
                    IV_NAME             = '/PES/ICCMP_BT_ACT/CuActionCuco' "#EC NOTEXT
                    IV_NODE_2_BIND      = 'PARENTNODE' ).   "#EC NOTEXT
here we need to understand that we are taking into consideration custom controller so for GSACTIONS also we have to take the same. once nodes are bound,
in connect_nodes of CTXT class , create the handler fro focus_bo.

 

COLL_WRAPPER = ME->BTADMINH->GET_COLLECTION_WRAPPER( ).
    SET HANDLER ME->ACIACTIONCONTEXT->ON_NEW_FOCUS
                FOR COLL_WRAPPER ACTIVATION IV_ACTIVATE.
After this in order to rename your overview page add the code :

 

LR_ENTITY = ME->TYPED_CONTEXT->BTADMINH->COLLECTION_WRAPPER->GET_CURRENT( ).
    CHECK LR_ENTITY IS BOUND.
    OBJECT_ID = LR_ENTITY->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'OBJECT_ID').
    PROCESS_TYPE = LR_ENTITY->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'PROC_TYPE_DESCR').
    CONCATENATE PROCESS_TYPE ':' OBJECT_ID INTO TITLE.

    IF OBJECT_ID IS INITIAL.

      DESCRIPTION = CL_CRM_UIU_BT_TOOLS=>GET_TITLE_HEADER( LR_ENTITY ).
    ELSE.
      DESCRIPTION = TITLE.
    ENDIF.

 

You will be getting your desired result as shown below :
scn.png

Thank you.

 

Regards,

Vishal

Marketing Attributes & Identification in IC Business Partner view

$
0
0

Hi guys,

 

Recently I worked on a requirement where we were needed to build marketing attributes and identification assignment block in IC business partner view.

 

Scenraio : when a user in UTIL_IC busineess role, search a BP , he gets an option MORE FIELD. when he clicks on it he gets something shown in screenshot below

 

mktAtt.png

 

Here as per the requirement, along with telephone, fax and email, Marketing attribute and identification tab was also required.

 

Solution :

1. go to the component ICCMP_BP_DETAIL , enhance it , add component usage BP_DATA for these two views are there in this standard component.( BP_DATA/MarketingAttributesEOVP and BP_DATA/AccountIDNumberList  ).

2. Now in ICCMP_BP_DETAIL, under ViewSet ICCMP_BP_DETAIL/CommunicationVS  in runtime rep add this component usage along with the view.

3.now go to the BP_DATA component and enhance both the view. after enhancing, redefine the set_view_group_context. now here view group context need to be set as you will not get the parent entity initially. add these code of lines :

 

 

IF IV_PARENT_CONTEXT IS INITIAL.
      CREATE OBJECT ME->VIEW_GROUP_CONTEXT TYPE CL_BSP_WD_VIEW_GROUP_CONTEXT.

      view_group_context->set_view_editable( me ).
    ELSE.
      ME->VIEW_GROUP_CONTEXT = IV_PARENT_CONTEXT.
    ENDIF..


view is also set editable here with the same view_group_context attribute . This will be triggering on click of the edit button on IC agent. locking is being takn care in insert event code so u need not to worry on that part.

4.then go to .htm page and make the noHeader = "FALSE" , personalizable = 'TRUE' ( if u need personalizable icon too ) that you can get the header with button inseta and  personalizable icon


5. do the binding in component controller of iccmp component with follwoing code


 

 

CASE IV_USAGE->USAGE_NAME.

      WHEN 'BP_DATA'.
        IV_USAGE->BIND_CONTEXT_NODE( IV_CONTROLLER_TYPE  =CL_BSP_WD_CONTROLLER=>CO_TYPE_COMPONENT
                                     IV_TARGET_NODE_NAME = 'CUSTOMER'
                                     IV_NODE_2_BIND      = 'PARTNER' ).

 

 


activate your code and test

 

 

you will get the resiult as stated below.

 

correct.png

 

 

Hope this helps you all.

 

Regards,

Vishal

Create new customizing-path in IMG

$
0
0

Hello,

This is a short document on how to create a new customizing-path in IMG.

Best regards,

Thomas Wagner

 

---

Update:

 

I mave made some changes: I have added the screenshots as pictures.

 

Step 1:

Create a maintenance view for your customizinh table.

 

Step2:

Create a new transaction for the view-maintenance.

1.png

 

Step2:

In this new transaction declare that you want to call transaction SM30 with the parameter VIEWNAME = your view and UPDATE = X.

 

2.png

Step4:

GO to transaction SIMGH and select the IMG-structure where you want to add your maintenance transaction.

3.png

 

Step5:

Modify the substructures by adding new activities.

4.png

 

Step6:

Maintain the settings for your activity. I have done it like that:

5.png

 

Step7:

In the tab "Maint. objects" add your new transaction created above.

6.png

 

Good luck when implementing.

 

Best regards,

 

Thomas Wagner

Enterprise Search - Use additional fields in CRM 7.0 EHP 1 with contact person search as example

$
0
0


Task:

We want to use additonal fields in the enterprise search for contact persons and we have CRM 7.0 EHP1.

 

Step 1: Create new template set.

Use the same component set as teh original, e.g. BP_APPL for contact persons.

Transaction CRM_ES_WB.

1.png

Step 2: Copy template CRM_CONTACT in this newly created template set.

 

2.png

The target template ID has to start with Z.

 

Step 3: Adjust "Search", "Result" and "Select"-Flags for the attributes

 

3.png

 

Step 4: Transfer templates

 

4.png

We used BBPCRM.

 

Step 5: Configure extraction user for indexing.

We used DDIC.

 

5.png

 

Step 6: Create new search object connector

 

Transaction ESH_COCKPIT.

 

6.png

 

Step 7: Schedule indexing

 

Delete previous content.

 

7.png

 

Step 8: If errors happend, start indexing in GUI.

 

Report ESH_IX_CRT_INDEX_OBJECT_TYPE.

 

8.png

 

Step 9: Test connector

 

Program ESH_TEST_SEARCH.

The new atttributes should be available now.

 

9.png

Step 10: Set namespace /1CRMES/ as changeable

 

10.png

 

Step 11: Create search-query-structures

 

Report CRM_ES_STRUC_GEN

 

11.png

Step 12: Test query in BOL-browser

 

Transaction: GENIL_BOL_BROWSER

 

Step 13: Add new query in customizing for enterprise search

 

SPRO: CRM - UI Framework - Technical Role Definition - Define Central Search

 

13.png

Step 14: Clear cache of central search

 

Class CL_CRM_CENTRAL_SEARCH

Execute method CLEAR_CACHE

 

14.png

Finished.

 

Good luck when implementing.

 

Thomas Wagner


Change date format in web service response for CRM attachments

$
0
0


In this document Create Webservice enabled word document in attachment assignment block the steps to create attachments based on word template whose content would be filled by web service are demonstrated.


However, one customer complains that in the generated word document, the date format is not displayed as they expected.

They hope the date is displayed as "2012.11.28" instead.

 

clipboard1.png


Why the date is always displayed as YYYY-MM-DD


In the previous documentthe architecture about the web service call in document scenario is briefing introduced. The function module generated by office integration framework will be called and the web service response to be merged into word document is contained in importing parameter output of the function module.


clipboard2.png

The date field in response structure has ABAP type D(8). Although there is available BAdI definition which enables customer to change the content of web service response, this BAdI does not work for this very case, since the field displayed in below screenshot will not be directly used to merge with the document template.

clipboard3.png

Instead, it is the serialized xml string ( handled by another automatically generated simple transformation ) which will be merged into the word document and finally displayed to end user.

clipboard4.png

After transformation, we could observe the value of ABAP type D(8), 20121128, has been transformed to 2012-11-28.


according to sap help, this is working as designed:

clipboard6.png

How to change date format according to customer need

 

 

Since there is no such BAdI definition provided by SAP which could allow changes on the transformed xml payload, it is necessary to put the adaptation on the response stream into a proper place with the modification-free approach.

 

 

1. use SE24 to open class CL_CRM_OI_RT, click Class->Enhance:

clipboard7.png


Create a new class enhancement implementation:

clipboard8.png

select method CALL_WS and insert a new post-method for it:

clipboard9.png

Once done, you could observe a tab in column "PostExit" for method CALL_WS. Click on it and you will navigate to source code editor.

clipboard10.png

2. Implement the post-exit method.

 

 

The signature of method CALL_WS contains three changing parameters:

 

 

ev_data: the string format of xml response. We need to change the date format there.

 

er_payload: the reference pointing to ABAP response. We do not need to change it.

 

ex_payload: the xstring format of xml response. We need to change the date format there.

clipboard10.png

the complete source code of transformation could be found in attachment.

 

Here just some important codes:

clipboard11.png

 

Here I develop a simple transformation ztime_convert to do the time format transformation:

 

  • line13: detect the xml node whose name equal to ValfromDate, as I would like to only transform Valid from Date as example.
  • line15: define a local variable in this simple transformation, with its value filled by the content of xml node ValfromDate, which has format YYYY-MM-DD.
  • line16: call ABAP class method ZCL_JERRY_TOOL=>GET_NEW_DATE. This method must be defined as public and static.
  • line17: the simple transformation variable lv_old works as importing parameter IV_OLD_DATE of ABAP method in line 16.
  • line18: ABAP method returns the transformed date to returning parameter and fill the content to a new variable lv_new_date.
  • line20: write the content of variable lv_new_date back to xml node ValfromDate.

 

 

The implementation of GET_NEW_DATE is very simple:

clipboard12.png


After that we could test in the runtime and observed the post exit get called, once the execution of CALL_WS method finishes:

clipboard13.png

And in the final merged word document, the format is now YYYY.MM.DD:

clipboard14.png

 

Advantage of this solution

 

 

If the default transformation rule listed in screenshot above with title "Value Representation in XML" is not expected by you, you could change the transformed field content with this solution. We didn't do any modifications on standard code, so the change will survive after system upgrade or patch applied.

 

 

Although in theory it is possible to change the implementation of automatically generated transformation which could fulfill the same result,

 

clipboard15.png

However it is always not recommended to do manual changes on any stuff which are automatically generated.

clipboard16.png

Analysis chats in crm by using htmlb:charts

$
0
0

This is all about my requirement.

I wondered how can I implement analysis chats without bi/bo integration.  Even I didn’t till I got this kind of requirement.

Usually  SAP CRM Analytics provides business users with access to unified information  for confident decision making

and alignment across people and teams.

If they want to know there company profit, product costs, campaign costs, lead etc.. For that this analysis chats procedure

is helpful we can implement analysis chats in sap crm itself.

 

I will give a brief about my requirement.


Sales executives will create leads, opportunities, quotations, sales orders based on that I want to know how many leads,

opportunities..etc they are created in particular span of time. This details i need to display like graphical charts.


This is one kind of score card.


scorecard1.JPG

This is standard analysis chart.

Same as this i need to display Sales Executive analysis chart.

 

If you observe the above chart table data is displayed when you click on business role home screen.

 

Based on the table data chart data will vary.

 

Now coming to my requirement how can we implement like that.

 

first of all we have to think about how to display data dynamically when we open any business role home screen.

Like this.

 

saleshome.JPG

 

Step 1. I will give you a brief idea about how to display data dynamically when we log in into web ui

 

In my requirement I have created one custom model. model code i have attached below.

If you want to fetch your own data then you have to Create custom model otherwise you can use standard model like ONEORDER,BP,BP_APPL etc..


Custom model creation.

http://scn.sap.com/community/crm/webclient-ui-framework/blog/2012/08/06/creating-a-genilbol-object-model

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

 

I created a custom GenIL object model to fetch the data based on search object.


Then I going to create bsp component and I am using this genil component into my component.


Step 2. Creating bsp component.


  •      Open a Transaction BSP_WD_CMPWB.
  • Enter Component name as ZSALESX_GRAPH and click on create.

bspcomp.JPG

  • once bsp component is created then click on display
  • Go to runtime Repository EditorRight Click on Model -> Add Model

model add.JPG

  • Add Component Set name as  ZSALES_GRAPH which you had created while creating Genil Model.

addmodel.JPG

  • You can see the Component Structure Browser , expanding Model will show your

        Root Object Customer , Key Structure , Attribute Structure.Step 3.

  • Now we have to write the code in DO_INIT_INITIALIZATION or  DO_PREPARE_OUT method.
  • Before that we have to declare static variable in table view implementation class because that variable holds the count of

        individual fields like opportuntity,lead,quotation,fallowup...etc.

  • I will use this fields in GRAPH method.

addmodel.JPG

  • Now we will write the code in  do_init_initialization or do_prepare_output Because when ever I login into my home screen
  • I need to display last three months data. So Redefine the method Do_Prepare_Output .
  • Write the logic.

addmodel.JPG

  • i have added this code in below attachments.

Step 4 .

  • Here i have created one method which is like GRAPH.
  • In This graph method I have implemented logic to display graph values.
  • Procedure Go to implementation class..

addmodel.JPG

  • Create one method graph.

addmodel.JPG

  • Here We have a structure like igs_data,igs_data_tab this structure holds graphical data in run time.
  • These are the fields which is there in that structure.

addmodel.JPG

  • we may confuse what is groupid,x,y,z..etc use to suggest. Here i have given the technical details of each field.
Technical NameExplanation resemble
groupidName of the data series. The chart element can display several datasets at the same time, thus enabling production statistics of different plants to be compared, for example. Every dataset must be given a unique name.
xColumn with the x values or categories
yColumn with the y values
zColumn with optional z values
colorAlternative color. By default, the chart element represents the categories that were selected from a series of predefined color schemes in different colors.
extensionAlternative extension.
datalabelAlternative label for the data
  • double click on the method GRAPH write the logic here.
  • i have attached graph logic below attachment.

Step 5.

  • Right now we have a Sales Executive data but how to display that data into graphical format.
  • In .HTM there is a Tag htmlb:charts. by using this tag we can display our data into analysis format.
  • Go to .HTM page. Here there is standard table code already exists.
  • Click on Edit button. Below after table code write the logic like this.

 


<htmlb:chart
id                  = "AREA_3D"
             
data                = "<%= controller->gv_data %>"   " this will give you the graph data what we are getting from the do_perpare_output.
             
width               = "500"
             
height              = "200"
              titleCategories     =
"Process Types"
              titleValues         =
"No Of Records"
             
title               = "Sales Report"
              chartType           =
"AREA_3D"
              visible             =
"X"
              displayObjectValues =
"X"
              legendPosition      =
"EAST"
              colorOrder          =
"STRAIGHT" />


this is the final output in the home screen.

addmodel.JPG

thanks Arjun Pawar

after searching of all i got your answer based on this blog i implemented this requirement.

 

How to add a chart (line chart) in crm WebUI?


Thanks & Regards,

Srinivask.


SAP CRM Important Periodic Jobs

$
0
0

The following jobs need to be scheduled to ensure smooth operation of your SAP CRM server.

 

Job: GN_GENERATE_CHECK

The report updates generation status information. If this report is not scheduled to run daily, the general status information displayed in the CRM middleware monitoring cockpit (transaction SMWP) is not up to date.

SAP Best Practice:Schedule the GN_GENERATE_CHECK report with period "daily"

 

How you do it ?

Call transaction SMWP. Select "Background Jobs". Use the secondary mouse button to click "Check Generation Status of Objects" and select "Show Suggested Action". Choose "Action".

 

Tip: Make sure that you run this job before job GN_WORKLIST_GENERATE because job GN_GENERATE_CHECK creates the worklist with objects and the objects created in worklist are generated by job GN_WORKLIST_GENERATE.

 

 

Job: GN_WORKLIST_GENERATE

This report generates the objects in the worklist created before by GN_GENERATE_CHECK report. When new or changed BDOCs are imported to the system, function modules must be generated. After import, the module inserts the objects to be generated into a worklist. The report takes the objects from this list and generates the function modules for them.

 

SAP Best Practice:Schedule the GN_WORKLIST_GENERATE report with period "daily"

 

How you do it ?

Call transaction SMWP and select 'Background Jobs'. Right-click "Periodical Background Generation" and select "Show suggested action".

 

Tip:Please make sure that there is a reasonable time frame availble between the GN_GENERATE_CHECK and GN_WORKLIST_GENERATE program runs.

 

 

Job SMO6_REORG2

SMO6_REORG2 is responsible for reorganizing tables that hold statistical data in CRM Middleware.

Related tables: SMW0REL, SRRELROLES, SMW3_BDOC,  SMW3_BDOC1,SMW3_BDOC2,SMW3_BDOC4, SMW3_BDOC5,

Please note the job SM06_REORG2 only deletes fully processed BDOC´s. Not "Intermediate" or "error" ones. BDocs in the error state are stored in the

system for the correction of the problem. After the relevant BDoc-Mesage are set to "green" status the job / report reorg. the relevant tables.

Object links between mBdoc messages and mBdoc/sBdoc messages are held for 21 days in the standard job variant. If a business process is completed successfully, object link entries are no longer required. In our experience, a value of seven days is usually sufficient. If this is the case, set "Reorganize for object links (BDocs) days to hold" to seven days in your variant.

 

SAP Best Practice:Schedule SMO6_REORG2 to run in every production client on a daily basis.

 

Known issue & Fix

SAP Note 1789869 - SMO6_REORG2 terminates with SAPSQL_INVALID_TABLENAME short dump

SMO6_REORG report is taking time due to huge number of records.

Entries in table SMW0REL are high and the number of entries in table SRRELROLES of object type MIDMESSAGE is very high.

SAP Note 503002 - Performance problems during BDoc processing

SAP Note 493156 - Performance of BDoc message related object links

SAP Note 206439 - Reorganization of tables in CRM Middleware

Make sure you have created secondary indexes on table SRRELROLES and also for IDOCREL or SMW0REL as per SAP Note 707820 - Performance: Object links and RSRLDREL

Generally, you should schedule the report RSRLDREL periodically to prevent the link tables from filling up. Otherwise, the runtimes of all the programs that access links will increase.

 


JOB: HRBCI_ATTRIBUTES_BUFFER_UPDATE

This report buffers the organization management structures in the INDX cluster table, which can cause significant performance improvements in nearly all CRM scenarios.

If the job is not executed, significant time is spent searching the attributes of organizational management or determining a responsible organizational unit, which has a direct influence on all business transactions in the CRM system.

The buffering indicator must be configured in the OOATTRCUST transaction for the scenario you use in CRM.

 

SAP Best Practice:Execute the HRBCI_ATTRIBUTES_BUFFER_UPDATE report after midnight on a daily basis with variant SAP&CRM.

Known issue & Fix

If the HRBCI_ATTRIBUTES_BUFFER_UPDATE report is scheduled regularly and runs successfully, there is no need to update daily changes online. To avoid the exclusive lock on the organizational buffer and performance degradation of your system, deactivate the BAdI HRBAS00INFTY implementation CRM_ORGMAN_ATTR_BUFF, which is active by default.


926540 - Missing Organizational units

896128 - HRBCI_ATTRIBUTES_BUFFER_UPDATE: selection screen not correct

934441 - Missing service in the SMOMITAREA table

 

HRBCI_ATTRIBUTES_BUFFER_UPDATE cancel due to memory errors TSV_TNEW_PAGE_ALLOC_FAILED or TSV_TNEW_BLOCKS_NO_ROLL_MEMORYJob cancle.jpg

Error details

Memory error.jpg

Implement SAP Note 1812579 - Performance issues with report HRBCI_ATTRIBUTES_BUFFER_UPDATE

Make sure that the distribution to mobile client is 'OFF' as you do not use mobile, when running the report

Make sure that your system does not have unrelated objects. For example if you have created several positions without assigning to any org unit, which does not make any business sense. As these objects are not useful in the business transactions it is required to delete by using the report RHRHDL00 which in turn improves the performance


Job HRBCI_ATTRIBUTES_BUFFER_UPDATE takes long time or cancelling due to program error

Make sure that you have implemented SAP Note 2006166 - CRM ORG:Performance improvement in the hrbci_attributes_buffer_update report



JOB: BSP_CLEAN_UP_SERVER_COOKIES

This background job deletes expired server-side cookies from database table SSCOOKIE. If this job does not run, the table SSCOOKIE grows significantly and may lead to performance when it is accessed. The job deletes COOKIES older than the current date. All cookies can be displayed with the job called BSP_SHOW_SERVER_COOKIES


SAP Best Practice: Schedule job BSP_CLEAN_UP_SERVER_COOKIES to run on a regular basis, ideally daily during a non-operational time frame (for details, see SAP Note 1080518).

This job deletes expired cookies in the SSCOOKIE table that are older than the current date.

Rebuild the indexes of the SSCOOKIE table periodically.

 

 

JOB:SMWP_BATCH

This background job refreshes flow definition information for the middleware generation.

If this report is not scheduled periodically, information displayed in the CRM Middleware Monitoring Cockpit (transaction SMWP) is not up to date.

 

How you do it ?

Call transaction SMWP. Select "Background Jobs". Right-click "Collector for Monitoring Cockpit" and select "Show suggested action". Choose "Action".


SAP Best Practice:Schedule the "Collector for Monitoring Cockpit" job on daily basis.

Pricing in CRM using IPC

$
0
0

Pricing in Business Transactions

Pricing is used to describe the calculation of prices and costs in a business transaction. Pricing enables to determine relevant price information in all types of business transactions such as sales or service orders, contracts, quotations or campaigns.

Different kinds of condition groups – for example, prices, discounts, surcharges, freight or taxes – can be determined. The system uses the condition technique for pricing, to determine relevant pricing information from condition records for a business transaction. Using condition technique the system answers the search queries of different applications by searching in existing condition records for valid results using certain search criteria.

SAP Pricing Fundamentals

ConditionTechnique in Pricing

 

The condition technique refers to the method by which the system determines prices from information stored in condition records. The various elements used in the condition technique are set up and controlled in customizing.  During  the processing of a business transaction, the system uses the condition technique to determine a variety of  important  pricing information.

For example, the system automatically determines which gross price the customer should be charged and which discounts and surcharges are relevant given the conditions that apply.

         

Elements in the condition technique

 

  • Condition Types: Define condition types different components that make up a price of a   product (base price, discounts, and surcharges)
  • Condition Tables: To store and retrieve condition records for each of the different condition types
  • Access sequences: Strategy to enable the system to find valid condition records
  • Pricing Procedure: Grouping of condition types in a particular sequence

 


Process Flow for condition determination

      • The determination of pricing procedure is determined based on the data in the application.
      • The pricing procedure has several condition types in sequence; the system reads the first condition type of the search procedure and determines the access sequence.
      • The access sequence is read with the condition tables which are also read in a sequence. The condition tables determine the condition records. The condition tables have key field combinations based on which the system determines the condition records.
      • As soon as the system has found a valid condition record for a condition table, it makes the result value for a results field available to the application.
      • When the determination procedure condition more than one condition type, the system repeats the search for condition records for each condition type.

                    1.png

Condition Types

 

In order to translate the receipt below in CRM, the system uses “condition types” to differentiate between  different   price  components. Condition types may be defined for base price, freight charges, taxes, discounts, net price,  etc. The  calculation can be based on the amount or weight or volume of the product. It can be based on a number or  can be  “%” based or can vary depending on a scale.

                    2.png

            Access sequences

Pricing depends on a host of factors. For example, a discount may be applied only may only on a particular
customer or the customer group. It may depend on the region or the product being or it may be applicable for only certain duration. There are many such complex scenarios in real world and in order to determine the prices according
to these conditions, the system makes use of access sequences.

Access sequence is a search strategy used in pricing to determine the best value that meets the required conditions in an iterative manner. For example, if a certain tax % should be waived off particular customer group for a sales office, then the system searches for this combination via access sequence. The access sequence contains
a list of condition tables having condition records which are accessed in aniterative fashion to get the best possible match.

                    3.png

            Condition Tables & Condition Records

 

          A condition table defines the combination of fields that identifies a unique condition record. Specific data           about   the  conditions is stored in the condition tables as condition records. For example, condition records           can   be   used  to   maintain a product price or special discount for privileged customer or a special price is           applicable for a  certain period.
          Values in condition records can also be scale based.
5.gif4.gif
Note : The fundamental pricing concepts explained above are
applicable equally for SAP CRM as SAP SD.

Pricing in CRM

Pricing in CRM is also governed by condition types which in turn forms a sequence in pricing procedure. The
pricing procedure in CRM is determined based on the following factors:
      • Sales Organization
      • Distribution Channel
      • Document Pricing Procedure (can be assigned to a
        sales transaction, on the third level)
      • Customer Pricing Procedure (assignment in business
        partner master)
1.png

 

            Path in customizing
SAP Customizing Implementation Guide->Customer Relationship Management->Basic Functions->Pricing->Pricing in the Business Transaction->Determine Pricing Procedures
1.png
The customizing data for the condition technique and pricing is first downloaded from R/3 into the CRM
system. This is done via initial load in CRM via transaction R3AS.
In the standard system there are the following objects for transferring:
      • DNL_CUST_CNDALL (all data for condition
        technique and pricing)
      • DNL_CUST_CND (condition technique data without
        the cross-client data)
      • DNL_CUST_PRC (Pricing data)

Internet Pricing and Configurator (IPC)

The Internet Pricing and Configurator is the pricing and configuration tool for CRM Online and CRM Internet Sales. SAP
CRM uses IPC (Internet Pricing and Configurator) to determine pricing information when creating a business transaction, such as a quotation, sales order, service process or a contract in a web based environment. It allows to configure price and products in a web environment, using master data that is downloaded from SAP R/3 system. It combines the functions of the Sales Configuration Engine (SCE) and the Sales Pricing Engine (SPE) with a standardized Web interface.
IPC is the core part of pricing in CRM. The IPC ensures integrated price calculation, regardless of whether prices are calculated for a business transaction in CRM Enterprise, in Telesales, or in SAP E-Commerce. It is a Java-based client-server package. It provides R/3 pricing and R/3 product configuration outside of an R/3 system. It can access both the customizing data as well as the condition records. It does not need an online R/3 system whilst still maintaining pricing and configuration data in one place.
Pricing Routines
Routines for pricing are maintained in R/3 system using  transaction VOFM. These are then entered in the pricing procedure or the condition type. The standard routines in R/3 are mapped to IPC user exits in CRM.  The pricing routines or user-exits in IPC are developed in Java.
In an SAP R/3-CRM set-up, where the pricing related customization can be downloaded from the source, R/3 to CRM, the standard pricing runs fine on CRM. However, in cases where we have custom pricing routines developed in R/3, they will not get downloaded to CRM as the translation between ABAP and Java is not automatically performed.  Hence, in order to maintain consistency between the custom routines in R/3 and CRM, they should be coded in IPC. In case of a vice versa arrangement where the source of the pricing routine is CRM, the same routine needs to be implemented in ABAP in R/3. In the next sections we will see how these user exits are developed.

            Pricing Communication Structure in CRM

          The CRM applications communicate with IPC using pricing communication structure for data transfer. This           communication structure is called the pricing communication structure or the field catalog. All the fields in the access sequence will be maintained in the field catalog.
Path in customizing
SAP Customizing Implementation Guide->Customer Relationship Management->Basic Functions->Pricing->
Define Settings for Pricing->Define Settings for Pricing

1.png

 

More often than not, we have a requirement to customize the pricing, for example, to determine pricing based on some custom fields on the business transaction. In order to do so, we need to add these custom fields during pricing process. For example, we need to determine price according to product hierarchy which is not contained in the standard communication structure. In this case, we need to do some enhancement to pass custom field to the communication structure.

            Pricing Business Add-in (BADI)

          Any custom fields that need to be accessed to determine pricing should be present in this pricing communication structure. The structure will hold the value in run time via a pricing related BADI. In order to process the custom fields in pricing communication structure and to pass it back to the communication structure, SAP provides a BADI
CRM_COND_COM_BADI.

 

1.png

 

     If any field is added at header level of the field catalog, that will available in the changing parameter of the method
     HEADER_COMMUNICATION_STRUCTURE.
     If any field is added at item level of the field catalog, that will available in the changing parameter of the
     method ITEM_COMMUNICATION_STRUCTURE.

            Development Environment

 

         The pricing user-exits will be compiled with the J2SE 1.4.x or a compatible java compiler of version 1.4.x. Also                     the   used libraries must be compatible with J2SE 1.4.x.  An IDE like Eclipse, 3.1 and above is recommended for
          development of the routines.
Note:      It is important that the compiled class files are compatible to a JDK 1.4 version as well as the standard library used isonly JDK 1.4. The VMC java environment of SAP BASIS 7.00 does only support 1.4 class files and libraries.

         

 

 

             Important related SAP notes

 

               1.png

Development Steps of Pricing Routine

 

In order to implement a routine in IPC, we first import an existing project into workspace. We take this existing
project from a zip file attached in an SAP provided note, 809820, for this purpose. This helps is accelerating the development.
Here are the steps.
      1. Download and unzip the ZIP file attached in SAP Note 809820 into a directory, say C:\DEV. This folder is the workspace folder for eclipse.
      2. Enter into transaction /n/SAPCND/UE_DEV. API JAR files and some source JARs from the system will be downloaded in a subfolder in the above directory upon executing the transaction as shown in screenshot below.

1.png

                    The development of the pricing routine will be done in an IDE, say eclipse. Hereprepare an eclipse project using                     the folder in step 1 which will act as a workspace in eclipse.

1.png
                   Customer implementations will be created in the src directory. After implementing the customer exits, the user exit
                    classes need to be uploaded back into the system. For this, the java sources and the compiled classes must be                     error                     free. Then prepare a JAR file from the SAP delivered configuration file                ‘create_PRC_UE_CUSTOMER_jar.jardesc’ in                     the SAP note.
                    We will see shortly how the user exit accesses the application data and determine the pricing.
        1. The developed user exit will then be uploaded into the system using the same transaction /n/SAPCND/UE_DEV. For one ABAP package, only one JAR file can be used. Uploading will over-write an existing JAR file if present, however the new coding is not taken automatically. We need to reset the VMC in transaction SM52.

 

1.png

 

            Uploaded user exits

 

                   The uploaded user exits can be seen in transaction SM53.
          The transaction SM53 contains also a browser to see the installed and uploaded java modules along with           the  user   exit files.
        1. Select in the Navigation tree the element Application.
        2. Browse the Installation tree down to the shown level 0/SAP/IPC -> Modules.
        3. All modules ending with _SAPCND_UE are customer uploaded modules equals jar files.
        4. Select the folder for /0CUST/ZSD_DEV_SAPCND_UE and we can see the uploaded jar files.

 

1.png

 

            Configuration of uploaded user-exits

                      Theuploaded java routine is configured in transaction  /n/SAPCND/UEASS.
                 
                         Give application as CRM.
                         Enter usage as Pricing, PR, and execute.
1.png
                     The next screen the various types of standard user exits.

 

2.png

 

            Register a user-exit

 

              In order to create a custom implementation, it first needs to be registered under the appropriate user exit type.
          Registering a user-exit is a cross client customizing and can be done by creating a new entry. Provide a user-exit           name which is a symbolic or short description of the functionality. The customer namespace starts with Y or Z.
          As an example below, user exit type “VAL” has two custom implementations registered under it. Select
          the “Implementations” folder in the left pane of the transaction as shown in the screenshot below after having           selected the appropriate user exit type in the above screenshot.

 


1.png

 

                    Double-click on the implementation name and then enter the name of the implementation class compiled for this                     routine. There is no restriction on the name but it should be different from com.sap*. Give a description to the exit.
1.png

 

Attributes in exits

          If the user exit needs access to some attributes on the application data, then these attributes should be defined in the
          “Attributes” section of the user exit. This attribute is only a symbolic name which will be mapped later to a field from           the pricing communication structure. This name of the attribute will be referenced in the user exit implementation.
          As shown in example below, the user-exit Z1156 has three attributes maintained against it.
        • ZDENOMINATOR
        • ZNUMERATOR
        • ZSOLDCAPACITY

 

1.png

 

             Formula number assignment

           The next step is to assign a formula number to the implementation. This formula number will be assigned to the 
          relevant condition type in pricing.
Number range of formulas
          Allowed number range for different types of user exits can be seen in transaction /n/SAPCND/UERNG.
          For exit of type VAL, the customer number range is within 600-999.

 


1.png1

 

Double–click on the “Formulas” folder in the left panel of the transaction and create a new formula number, say, 900, configured for Z1156, our custom user-exit.

 

1.png

 

Select “Attributes” double click on it

 

1.png

 

               Now, these characteristics that appear in the column “Field Name” of this screenshot are required to be                maintained in the pricing communication structure.

 

1.png

 


                         These fields in the pricing communication structure will be populated via the pricing BADI, by implementing either                     of the header or the item methods, depending on which level this pricing is maintained and required for.
                    The custom fields may be present on the application data or may be derived via some other attributes on the                     application data. In our case, these attributes are linked to configuration characteristics at item level for a product on                     a business transaction.
                    The last step within CRM after registration and assignment of the user-exit formula must be to upload before it can be                     assigned to any pricing.procedure or other configuration. As the configuration is buffered for one day (default setting)                     the changes will only become immediately active with a restart of the VMC or the application server.
Note: While testing different configuration in a test or development system also the function module, IPC_DET_CLEAR_CUST_BUFFER can be executed.

         

               Virtual Machine Container

 

                      The VirtualMachine Container (in short VM Container or VMC) is a component integrated into  the  SAP Web AS                ABAP that enables Java functions that comply with the Java Standard J2SE 1.4 to be executed in AS ABAP. The VMC                is optimized for applications that use functions implemented in ABAP as well as in Java, and that have to communicate                quickly and reliably with one another.

               Logs in Virtual Machine Container

 

          In the transaction SM53, on the left side we can see Log Administration, in that we also see the Log Configuration.           We can specify the various severity levels like at the package or class level.
        1. Info
        2. Warning
        3. Error
        4. Fatal
        5. Debug
          Logs can now be viewed in SM53 itself. Theycan also be filtered by different criteria such as severity, log name,or user.

1.png
          The creation of the logs will be required to be done in the user exit itself. The class com.sap.spe.base.logging.UserexitLogger implements two methods for logging debug messages or error messages.
An example coding is shown below from a sample user exit in the note.

 


1.png

 

Classes to be inherited for different types of user exits


               1.png

 

 

Related Content

 

 

  1. http://help.sap.com
  2. http://scn.sap.com
  3. http://service.sap.com
    ( For reference to SAP notes)

 

 

 

 







Send E-mail using Mail forms & create follow up activity for order.

$
0
0

Following declaration will be useful.

 

DATA: p_form TYPE crmt_pml_id,

  lr_ref TYPE REF TO cl_crm_pml_mail_form_exec,

  lv_subject TYPE xstring,

  lt_personalized_mail TYPE crmt_pml_txtsubj_exec_tab,

  lt_picture_key TYPE crmt_pml_exec_pic_key_tab,

  lt_attachment_key TYPE skwf_ios,

  lt_messages TYPE bapiret2_t,

  lv_pers_mail_type TYPE crmt_pml_type,

  lv_date TYPE bcos_tstmp,

  lt_bo TYPE sibflporbt,

  ls_bo TYPE sibflporb,

  lt_return TYPE bapiret2_t,

  ls_activity TYPE bapibus20001_object_id,

  lv_activity_guid TYPE guid_32,

  lt_activity TYPE cmst_bapibus20001_object_id_t,

  lv_guid TYPE crmt_object_guid,

  l_error TYPE c,

  lr_document TYPE REF TO cl_document_bcs,

  ls_adsmptp TYPE bapiadsmtp,

  lt_adsmptp TYPE TABLE OF bapiadsmtp,

  lr_send_request TYPE REF TO cl_bcs,

  ls_variable TYPE crmt_pml_name_value,

  lt_attr_variable TYPE crmt_pml_name_value_tab,

  lt_variable TYPE crmt_pml_name_value_tab.

 

Step1. First of all get the reference of Mail form that you have created.

 

p_form = 'MAILFORM001'.      "" Mail form ID


CREATE OBJECT lr_ref

  EXPORTING

            iv_mail_id = p_form            

  EXCEPTIONS

       mail_not_found = 1

       OTHERS = 2.


Step 2.  Fetch placeholders that you have created in mail form.

 

CALL METHOD lr_ref->get_variables

  RECEIVING

  rt_variable = lt_variable.

 

lt_variable will contain all the placeholders that you have created in your mail form.

 

Step3. Pass values to the placeholders in mail form

LOOP AT lt_variable INTO ls_variable.  

CASE ls_variable-name.

       WHEN 'BAPIBUS1006_CENTRAL_PERSON-FULLNAME'.

                 ls_variable-value = 'ABC'.   

       WHEN 'BAPIBUS1006_HEAD-BPARTNER'.

                 ls_variable-value = '400024'.        

  ENDCASE.

 

  INSERT ls_variable INTO TABLE lt_attr_variable.

ENDLOOP.

 

In my case i have just used two placeholders.

Step4. Create your mail template using function module 'CRM_IM_CREATE_PERS_MAIL'. Pass your variables table, language of mail and your mail form object reference. The received parameters will be used in sending mail in step 6.

 

CALL FUNCTION 'CRM_IM_CREATE_PERS_MAIL'

  EXPORTING

       it_attribute_values = lt_attr_variable

       iv_langu = 'E'    

       ir_exec_service = lr_ref    

  IMPORTING

       ev_subject = lv_subject

       et_personalized_mail = lt_personalized_mail

       et_picture_key = lt_picture_key

       et_attachment_key = lt_attachment_key

       et_messages = lt_messages

       ev_pers_mail_type = lv_pers_mail_type

  EXCEPTIONS

       mail_empty = 1

       OTHERS = 2.


Step5. Create an activity to which the mail will get attached. The activity will then be visible in the Interaction history of the order for which you                  were sending mail.  Use method 'create_activity' of utility class 'cl_crm_email_utility'.

 

GET TIME STAMP FIELD lv_date.

 

lv_guid = 'XXXXXXXXXXXXX'.               ""Enter guid of order for which you want to create follow up activity


ls_bo-instid = lv_guid.

ls_bo-typeid = 'BUS2000120'.            "" Business object for complaints

ls_bo-catid = 'BO'.

INSERT ls_bo INTO TABLE lt_bo.


CALL METHOD cl_crm_email_utility=>create_activity

  EXPORTING

       iv_process_type = '0005'

       iv_description = 'Created using mail form'

       iv_start_date = lv_date

       it_link_bo = lt_bo

       iv_direction = '1'

       iv_status_process = 'FINI'

  IMPORTING

       et_return = lt_return

       et_activities = lt_activity.


READ TABLE lt_activity INTO ls_activity INDEX 1.

lv_activity_guid = ls_activity-guid.


Step6. Activity for mail and mail template has been created. Now we have to attach both and Send mail using function module  'CRM_IM_SEND_PERSONALIZED_MAIL'. Enter the receiver's email address, sender email address, reply-to email address,

mail form id and other mail form template variables.


ls_adsmptp-e_mail = 'test@tcs.com'.                  ""  Receiver mail address

ls_adsmptp-std_no = 'X'.

INSERT ls_adsmptp INTO TABLE lt_adsmptp.


CALL FUNCTION 'CRM_IM_SEND_PERSONALIZED_MAIL'

  EXPORTING

       iv_device = 'MAIL'

       iv_sender = 'abc@tcs.com'                       "" sender email address

       iv_reply = 'reply@tcs.com'

       iv_mailform = 'MAILFORM001'

       iv_activity_guid = lv_activity_guid

       iv_pers_mail_type = lv_pers_mail_type

       it_picture_keys = lt_picture_key

       iv_subject = lv_subject

       it_personalized_mail = lt_personalized_mail

       it_attachment_key = lt_attachment_key

  IMPORTING

       er_document = lr_document

       er_send_request = lr_send_request

  TABLES

       it_smtp = lt_adsmptp

  CHANGING

       cv_error = l_error.

 
Step 7. 'COMMIT WORK' is important as the mail will not be sent untill this is executed.

   

  COMMIT WORK.

Viewing all 252 articles
Browse latest View live


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