Escolar Documentos
Profissional Documentos
Cultura Documentos
of EMI
Narinder Hartala
Document Details
Name Objective Audience Version Description
Implementing IPC CRM 1.0 Implementing IPC Java user
Java user exit to exit to calculate EMI
calculate EMI
Change Log
Version Date Author Description Approved By
1.0 October 14, 2010 Narinder Hartala Implementing IPC
Java user exit to
calculate EMI
This document will walk through the process of developing pricing userexit in general and will cater to
one specific customer requirement explained below.
Some companies provide after sales services and sells contracts to customers. Generally these contracts
have an annual price agreed to and client wants to bill periodically an equal amount to the customer.
In the standard system, for yearly prices, pricing calculates proportional periods based on days. As a
result, the billing amounts vary, for example in monthly settlement, according to the different
numbers of days in a month.
Example:
Yearly price: 12000 INR for a rental contract. Settlement should be carried out quarterly.
Settled: Required:
SAP has suggested a workaround for the above requirement. See OSS Note 882075
https://service.sap.com/sap/support/notes/882075
Download both attachments and read the pricing userexit manual thoroughly. Follow the steps
mentioned in Section 2 of pricing user exit manual or section 3 of this document. In case you facing any
problems please take help from local IT to setup the Java development environment. Pricing userexit
manual and prepared Eclipse project are attached in the last section of this document also.
Create an empty folder which will be used as workspace folder for NWDS e.g.
D:\NWDS_WORKSPACE
Unpack the ZIP file attached to the note 809820 into the empty folder created in step 1. Then a
sub directory with the name PRC_UE_CUSTOMER should appear containing the project files. See
snapshot
Launch SAP GUI, type /n/SAPCND/UE_DEV in the command field and hit enter
Select the Download option and activate the option Libraries. Enter the newly created subfolder
in the Target Directory and hit the execute button. Two folders lib_api and lib_src will be
created in the existing subfolder PRC_UE_CUSTOMER
Note: In situations where exits have already been implemented, and we need to do
changes in an exit, we need to do the following.
Select the Userexits radio button, give the name of the package where the userexits are
stored previously and the target directory created earlier and folder SRC
A userexit folder should appear under PRC_UE_CUSTOMER folder
Start NWDS installed on your machine and set the folder created in step 1 as the workspace
Import already prepared File->Import, select Existing Project into Workspace, ( In eclipse,
Select General, then Existing Project into Workspace )and click Next in the pop-up. Now use
browse button, select existing folder PRC_UE_CUSTOMER in workspace as the root directory
and hit OK. NWDS should show the PRC_UE_CUSTOMER as Project name.
Now the JRE System Libraries have to be added to build path of the NWDS/Eclipse. Right click on
the project folder and select Properties. In the resulting popup choose Java Build Path, tab
Libraries and button Add Library. Then choose library type JRE System Library and use a 1.4.x
version
Prepare the API source and build the HTML documentation. Right click on build_api_doc.xml
and select Run As->Ant Build. Ignore the error message thrown during this process.
Refresh the NWDS project by right clicking on the project and choose refresh.
Now the default project is ready to be used for custom developments. Java Documentation for all API
classes is available and can be viewed by NWDS auto completion help or by opening the file
PRC_UE_CUSTOMER/api_doc/index.html
As the development environment is ready now we can go ahead and do the required JAVA
development. In case you new to Java please search for Java basis tutorials on internet.
Src: folder should contain the customer developments. It is recommended to use also in java some
naming convention to better distinguish standard coding and own developments. We can use concept of
package in java to achieve that.
OSS Note 92655 and 882075 would be useful to write the desired java code.
Upload the developed userexit to the CRM database. It is done with the same
transaction which is used to download the initial API libraries. Create a workbench
request beforehand to record the userexit upload. Execute transaction
/SAPCND/UE_DEV, select upload, input Transport Request, ABAP Package, Jar File path
and click execute(F8)
For each ABAP package only one jar file can be uploaded. We can see already uploaded
jar files using transaction SM53
5. Userexit administration and configurations
Customer pricing userexit has to be known to the runtime. Each implementation is loaded during
runtime and controlled by configuration available through transaction /SAPCND/UEASS. Follow below
steps:
VMC reset: Execute transaction SM52. Choose menu Virtual Machine Contatiner ->
Reset
Refresh Pricing buffer by executing FM IPC_DET_CLEAR_CUST_BUFFER passing
parameter value CRM and PR.
Now test it with the Function Consultant by creating a service transaction which uses the
Pricing Procedure where you have included the newly created Condition Base Formula to
which userexit is assigned.
Troubleshooting
Sometimes system doesnt behave as we want it to for such cases we have to troubleshoot. We
have two methods to achieve it.
Java debugger
VMC Log Files
Create a transaction and enter an item, before pressing enter, write /h and then press enter
Breakpoint at statement->RFC
Breakpoint at FM PRC_INT_PRICING_PROCEDURE_INFO
In eclipse, go to debug, and then remote java applications, give the port name and host name as
displayed in the FM earlier
Host name could be taken from the sap GUI, by pressing the system and pressing on change item
After you enter the values, you might have to press F8 few times, before you get into eclipse
debugger
***end****
You can execute SM52 and see the VMC work process
Now in the NDWS/Eclipse open menu Run ->Debug and create a new Remote
Java Application Configuration.
Enter Host(FQDN) and port which is shown in the popup and SM52
Click button Debug available in the bottom system will break to ABAP debugger
session
If you see any missing file in SM53 i.e either .java or .class file is missing then it is
highly likely compilation issue. Follow the steps under B.2 to resolve them.
First things first. Try compiling any Routine and Requirements with minimal coding.
That is just RETURN TRUE. Compile the package and upload the jar file as usual. Test
Run the IPC .
B.1) Now if the IPC works it means there is SYNTAX error or the LOGICAL errors. Please
check out the METHOD parameters and the signatures of the used method. They have to be
exactly like the SAP guidelines. Also check out that the java code you have written is compiled
without errors in the code. Remove any errors present and then compile and upload again and
check again.
B.2) If still the IPC doesnt work with the minimal coding then we need to ensure that the the
JRE used is in compilation with SAP. Download the JRE/JDK 1.4.2_09 from the Oracle
Website which is available as a free download and install them . Now we will have two versions
of java installed on our system.Do remember the path where we have installed the Java JRE/JDK
1.4.2_09 which will be used later in the ECLIPSE.
Once we have installed the JRE 1.4.2_09 we will compile our source code from the eclipse. It is
better if we download the older version of Eclipse i.e the same one used in this document to
describe the process.
Now follow the process as described before to develop your source code and while compilation ensure
the following steps.
Right Click on PRC_UE_CUSTOMER >Build Path>Configure Build Path and ensure that the JRE 1.4.X is
present there.If not then please add them.
Secondly ensure that the JDK compliance level is set to 1.4.X. as shown in the below screenshot.
And we can try that the 2 ANTBUILD is set for JRE 1.4.X as shown below .
Also after ANT Build you can have a look at the compilation path shown in the CONSOLE window. It shall
show JRE 1.4.X under Ant Build Path as we are expecting that.
IPC_DET_CLEAR_CUST_BUFFER