Professional Documents
Culture Documents
IPC TechnicalConsultingTips
IPC TechnicalConsultingTips
This document may discuss sample coding or other information that does not include SAP official interfaces
and therefore is not supported by SAP. Changes made based on this information are not supported and can
be overwritten during an upgrade.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods
suggested in this document, and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of
this technical article or code sample, including any liability resulting from incompatibility between the content
within this document and the materials and services offered by SAP. You agree that you will not hold, or seek
to hold, SAP responsible or liable with respect to the content of this document.
Applies To:
The IPC (Internet Pricing and Configurator). The IPC is versioned to match CRM. The current version is 4.0
SP9.
Summary
This document is an accelerator for developers using the IPC in a CRM Enterprise or Internet Sales project. It
may also be useful for SRM or other IPC scenarios (e.g. IS-Auto).
Table of Contents
Applies To:........................................................................................................................................2
Summary ..........................................................................................................................................2
Introduction.......................................................................................................................................4
Installation.....................................................................................................................................5
Eclipse IDE................................................................................................................................7
Local IPC...................................................................................................................................7
Coding...........................................................................................................................................8
Texts ...........................................................................................................................................13
Installation...................................................................................................................................13
Upgrade ......................................................................................................................................14
Author Bio.......................................................................................................................................16
Introduction
This document is an accelerator for CRM consultants using the IPC in a CRM Enterprise or Internet Sales
project. It may also be useful for SRM or other IPC scenarios (e.g. IS-Auto). It is written at a point in time and
may not be kept up to date.
The IPC is the ‘Internet Pricing and Configurator’. It is a Java-based client-server package. It provides R/3
pricing and R/3 product configuration outside of an R/3 system.
The Product Modeling Environment, or PME (relates to R/3 Variant Configuration master data)
In addition, it has Java Server Page (JSP) front ends and a Java UI. The JSP front ends are integrated into
the different CRM scenarios (telesales, internet sales, mobile sales, etc). You can deploy them normally on
your J2EE stack.
Short answer: to enable consistent pricing and configuration through all sales channels, without needing an
online R/3 system, whilst still maintaining pricing and configuration data in one place.
The IPC is typically used in a CRM scenario, using the CRM database (for Telesales and Internet Sales). It
uses its own database for other scenarios.
The IPC can integrate with an R/3 system using its own database (>4.0B). In this case, you use the IPC
Dataloader to take data from the R/3 system via qRFC. The IPC converts the data to the CRM data model.
IS-Auto Vehicle Management System uses it this way.
The Product Modeling Environment can be used in mySAP ERP 2004 on a project basis. It is used as a front-
end to variant configuration master data maintenance. Object dependencies are much easier to write.
You can install it on any of several major operating systems (Linux, AIX, W2K, HP-UX, Solaris).
It is a relatively small footprint installation – you can install it on your notebook for development and
education purposes (but it can use a lot of resources depending on how the calling applications use
it)
You can scale it separately to the other components, i.e. have lots of IPC servers if you are doing lots
of pricing and configuration.
You should get the installation file from the ‘Patches’ section of the SAP Service Marketplace so that
you always have the latest version.
You must install the same service pack level (and patch) as the CRM system.
You can now upgrade the service pack level rather than reinstalling.
OSS note code corrections are installed via the IPC patch. Patch files are available from the ‘OS
Independent’ section. Click on ‘info’ to see which notes are included. Read note 486061. Sometimes
a note involves ABAP corrections AND Java corrections.
Web Applications
You need to install IPC Web Applications on your J2EE Engine in order to use IPC features like
Pricing Analysis or Configuration. You should have a J2EE Engine available as part of your CRM
installation (3.0 and up).
You need to be familiar with the Extended Configuration Management (XCM) of SAP web
applications in order to set up some of the web applications. Follow the install guide carefully. This is
simply a replacement for the old web.xml approach that allows for multiple configurations of one
deployment, and separates SAP and customer settings.
The CRM middleware R/3 Adapter has functions for downloading R/3 pricing configuration and converting to
the CRM data model.
Read the documentation carefully. Not all R/3 functions are supported by the CRM system.
The documentation can be found at http://help.sap.com . Navigate to the CRM help. Follow the path:
Application Services Æ Application Engines Æ Pricing Æ Conditions Æ Data Exchange for Conditions Æ
Data Transfer from the R/3 system (Download) Æ Transferring Customizing Data.
Once the download and generation of customizing data is complete, you can download condition records
(master data). For custom condition tables, you will have to create your own download objects using the
delivered ones as a template.
Often condition tables were created in the R/3 system with new ‘Z’ fields. These will not be generated in the
CRM system until a relevant data element is added to the CRM field catalog and a mapping entry made. Then
the customizing download and generation can take place successfully.
Add the data element to the CRM field catalog (transaction CTFC_CRM) and generate it. This adds
the field to the appropriate structures.
Create a mapping entry by maintaining table CND_MAPM_CNV_FLM (use SM30 and view
V_CND_MAP_CNVFLD ). If necessary, use a BAdi to translate the field values (eg from R/3 partner
number to CRM GUID). The table CND_MAPC_CNV_FLM shows the SAP function modules that you
can use.
Run the customizing download and generation and make sure the table is generated OK.
To fill the field in the communication structure at run time, you will need to implement the BAdi
CRM_COND_COM_BADI .
Note that if you fill all attributes in the communication structure, and keep your routines as simple as possible,
then the process of mapping R/3 pricing to CRM pricing is much easier. Routines that read the database are
very hard to rewrite in Java (see next section).
Application Services Æ Application Engines Æ Pricing Æ Conditions Æ Data Exchange for Conditions Æ
Data Transfer from the R/3 system (Download) Æ Transferring Master Data.
This section will help you set up a development environment to do so. Although only one of several possible
options, it is probably the easiest and cheapest.
Eclipse IDE
Local IPC
Download the same Support Pack level of the IPC to match your CRM system and install it. You should
choose the version for your local operating system.
You do not need to connect it to the CRM system - it is needed for compiling your new code as certain IPC
libraries must be included.
You can however connect and run it locally to test your own code (see later section).
Project setup
You need to set up a new Java project in Eclipse to manage your development. This project should include
the IPC code libraries so that your code will compile correctly, and so that you can use the advanced features
of the IDE.
1. Start Eclipse.
2. Start the ‘Create new Project’ wizard ( File > New > Project ).
3. Choose ‘Java project’ and click on ‘Next’.
4. Give the project a name (eg IPC) and click on ‘Next’.
5. Click on the ‘Libraries’ tab.
6. Click on ‘Add External JARs’.
7. Add all the JAR files from the \ipc\lib\ folder in your local IPC installation:
"IPCClient.jar" "IPCPatch.jar" "SAP_IPC.jar" "thirdParty.jar"
8. Click ‘Finish’.
The IPC routines will be contained in a package called userexits. You need to create this.
1. Start the ‘Create new package’ wizard ( File > New > Package ).
2. Enter the name ‘userexits’.
3. Click ‘Finish’.
The code template for your routines is supplied in the IPC installation. Import this file into your package.
1. Start the ‘Import’ wizard ( File > Import ) or right click on the new package.
2. Select ‘File system’ and click on ‘Next’.
3. Browse to the <local IPC>\ipc\lib\userexits folder and click on ‘OK’.
4. Select the PricingUserExits.java file in the right window and click on ‘Finish’.
You can now expand out the userexits package to see the PricingUserExits class source code and
the methods contained in it.
Î Eclipse tip: You can navigate to each method in the source code by double clicking on its name in the
Package Explorer on the left rather than scrolling and searching.
Coding
There are many coding scenarios which may occur. In this document I provide some basic tips that relate to
creating a pricing routine (similar to using menu VOFM in R/3). It is assumed that you are familiar with pricing
logic and routines (requirements, formulas) in general.
Î The provided source code for the standard SAP routines is a valuable reference. You can access this in
your local IPC installation at \ipc\lib\userexits\CRMStandardExits.java.txt . It provides many
examples of how you can code your own routines.
You will normally have to enter code in three different methods for each routine that you want to add:
1. The relevant ‘getNumbers’ method which the pricing engine needs so that it knows which routines to
call (for example, getConditionValueFormulaNumbers).
2. The relevant ‘determineRelevantAttributes’ method which the pricing engine needs so that it know
which custom attributes are required from the document (for example,
determineRelevantAttributesForValueFormula ).
3. The actual routine method that performs the pricing logic (for example,
overwriteConditionValue, ).
These methods are described in the following three sections, using an example where we are creating a
couple of new condition value formulas.
Example of ‘getConditionValueFormulaNumbers’
Simply change the code to return the numbers of your new routines. New routines should not be numbered
below 600, as this is in the SAP reserved namespace.
For example, if you have two new routines 601 and 701, then change the line as follows:
Change this:
To this:
Example of ‘determineRelevantAttributesForValueFormula’
The IPC requires that required attributes are registered here (attributes are not automatically provided for
performance reasons). The code required is relatively simple – depending on whether we are pricing at
header or item level, and the actual routine number, we provide a list of relevant attribute names.
New attributes need to be added to the field catalog via the IMG and populated via a BAdi.
The code within the method could look something like this:
// Header?
if (headerAttributes) {
// KOMK fields
switch(valueFormulaNo) {
case 601:
break;
case 701:
break;
// Item
else {
// KOMP fields
switch(valueFormulaNo) {
case 601:
break;
case 701:
break;
return relevantAttributes;
Î Note that the delivered SAP attributes do not always have the same name as the field in the field
catalog. It is best to choose them using the IDE inline help. To do this, first include the relevant library
where they are declared by placing the following line at the top of your code with the other includes.
import com.sap.spe.condmgnt.customizing.application.CustomizingConstants;
Then you can declare attributes using inline help rather than literals:
There are many more import’s that you can use in order to reuse delivered IPC code.
Example of ‘overwriteConditionValue’
The actual routine logic is of course dependent on the routine number, so there is a switch:
switch (valueFormNo) {
Below this we put our code. In this hypothetical example, for routine 601, if the transaction type is ‘ZDOM’,
then this condition value is 100.
case 601:
try {
String ordType =
prItem.getItemAttributeValue(
CustomizingConstants.AttributeNames.bus_proc_type).getValue().
trim();
if (ordType.equals("ZDOM")) {
return PricingConstants.HUNDRED;
else {
return PricingConstants.ZERO;
catch (UnsuppliedAttributeException e) {
return PricingConstants.ZERO;
Of course, any logic could go here. It is probably better to send attributes here via the communication
structure rather than performing a JCo call to a backend system (CRM, R/3, etc) to get the information you
require.
This is documented in the IMG under Customer Relationship Management Æ Basic Functions Æ Pricing Æ
User-Defined Fields.
Texts
In order that others may know what your routines do, you should maintain a text for them so that a text is
displayed in trace files and from the drop-down in pricing Customizing.
CRMPR_CNDVAL_601=Price by Color
CRMPR_CNDVAL_701=Price by Size
Installation
Once you have finished your coding, you compile your Java class by saving the project, which performs an
automatic build and syntax check. When your code is ready for testing, you need to move it onto the IPC
server.
Replacing the existing \ipc\lib\text\userexits_en.properties file with your new one. You
may wish to back up the old file.
In a landscape with multiple IPC installations (eg one for Telesales and one for Internet sales) you must of
course install them on each one.
If you want to do some serious development, it is probably best to use your local IPC installation for testing.
This saves on moving your files onto the ‘real’ IPC every time you want to unit test, and then restarting it. You
can simply drop your files in the right place locally, and restart your own IPC. Once you are happy, you can
get the files installed on the ‘real’ IPC.
Follow the IPC installation instructions, creating separate RFC destinations for your local installation.
To force the use of your IPC so that you can test it, set your user parameter IPC_RFC_DESTINATION to the
RFC destination name of your local dispatcher (eg IPC_RFC_DISPATCHER_DEV ).
Upgrade
When applying a new support pack to the IPC, you will need to take the userexit.java file from the new
support pack and insert your previous custom code and then recompile. The linked SAP libraries will have
changed. You cannot use the previous compiled userexits as it may (for example) cause IPC connection
problems that are difficult to diagnose. Please see OSS note 670000.
The IPC web applications are J2EE applications that talk to the IPC and provide an HTML user interface. The
calling application launches the web page (or sub-frame) with the IPC session ID in the URL, and the
application calls the IPC, retrieves the session information, and presents it to the user.
The installation guide ‘IPC 4.0 Web Applications Installation Guide’ explains this. You would normally simply
install the web application on the J2EE Engine that is part of the Basis layer.
Once the web application is installed, configure the pricing analysis as per the IPC Server Installation guide.
For example, for CRM 4.0 SP04 you do the following:
2. To activate pricing analysis, you have to set the user parameter PRC_TRACE to value X in the CRM
system.
This is also accessible in the IMG under Customer Relationship Management Æ Basic Functions Æ
Configuration Engine Æ Define URLs.
In earlier versions of CRM, the analysis was dependent on creating a dummy RFC destination which held the
URL parameters.
Setting your parameter ID as above triggers your IPC pricing session to create a trace file.
Calling the pricing trace generates an URL pointing to the web application, with parameters in the
URL representing your IPC session. The web application retrieves the pricing trace for your session
from the IPC and formats it nicely as an interactive web page.
The most important thing to remember is that you must manage your IPC sessions – opening and,
importantly, closing them. If you do not close them, the IPC must manage them and this can mean that the
IPC struggles under many orphaned sessions. If your ABAP program ends in any way, this does not
automatically close your IPC session!
There is a delivered ABAP program IPC_TEST_ORDER that shows how to use the IPC for pricing and
configuration. Other programs exist in package COM_IPC_TOOLS_ORDER.
Do not be daunted by using IPC pricing in your custom ABAP – it is probably simpler than using R/3 pricing.
Author Bio
Dom Padden is a Solution Architect at SAP Australia. He has been working with SAP software since 1994.
Since 2001 he has focused on SAP’s CRM products.