To support all this complexity, SAP CRM uses condition techniques similar to SAP ECC, but leaves the actual calculation to a - for most people - black box... The Internet Pricing and Configurator (IPC). After reading this blog you no longer belong to 'most people'.
We will be showing how to take a peek inside the IPC.
As the IPC is a JAVA based component, you cannot debug the processes inside the IPC with a normal SAP ABAP debugger.
To debug the IPC, a couple of prerequisites are required as described in the pricing userexit manual in note 809820.
Install softwareIn short, the following steps are required to set up your programming environment:
- Install JAVA SE ( preferred 6 or 7 ) from http://www.oracle.com/technetwork/java/javase/downloads/index.html
- Install an eclipse version from: http://www.eclipse.org/downloads (Version: 4.3.2 is confirmed to be working)
Setup EclipseAn Eclipse project must be set up according to the following steps:
- Create an empty folder where all relevant data is stored (e.g. C:\DEV). This folder will be the workspace folder for eclipse.
- Unpack the ZIP file attached to the SAP note 809820 into that empty directory. A subdirectory with the name PRC_UE_CUSTOMER should appear, containing the project files.
- Start your SAP GUI on the same machine, login into the system and start transaction /SAPCND/UE_DEV (enter /n/SAPCND/UE_DEV).
- Select the Download option and activate the option Libraries.
- Enter as path the newly created subfolder PRC_UE_CUSTOMER (e.g. C:\DEV\ PRC_UE_CUSTOMER) and hit the execute button. The downloading will take a few minutes and create some subfolder in the PRC_UE_CUSTOMER directory containing some API jars and some source jars
- Start eclipse and select as workspace the manual created folder (C:\DEV). Eclipse will create the meta data for an empty workspace. Select File --> Import... and "Import an Existing Project into Workspace". Now select the PRC_UE_CUSTOMER folder as root directory. Eclipse should show the PRC_UE_CUSTOMER as project name. Now the JRE System Libraries have to be added to the build path of eclipse. Activate the context menu on the project (right mouse click) and select Build Path --> Add Libraries. Select JRE System Library and use the one currently used on your system. Check in your SAP system on which java version the VMC is running.
- Prepare the API source and build the HTML documentation. Activate the context menu (right mouse click) on build_api_doc.xml and select Run As --> Ant Build. . If you receive an error please make sure that you use JDK instead of JRE. And make sure that the configured installed JRE is used in the ANT Build configuration.
- Refresh the eclipse Project by right mouse clicking on the project and selecting Refresh (F5) in the context menu.
Your Eclipse environment is now ready for IPC programming and debugging.
DebuggingIn order to debug the code running on the VMC using your Eclipse environment, the following steps can be followed:
- Ensure the local java code is the same as the Java code running on the IPC.
- Activate breakpoints in the Java formula you wish to debug
- Set user parameter PRC_RFC = X
- Create a document with pricing in the webclient, we're not picking up debugging from there. Just save the document, so we can go ahead with debugging.
- Now open this document in the SAP Gui transaction CRMD_ORDER Go to the item details and then to the Conditions tab.
- SAP should now open an ABAP debugging window. Step into the function SPC_GET_PRICING_PROCEDURE_INFO using F5.
- Doing this, triggers a pop-up, which shows you on which port you can connect to the debugger.
- Now go into Eclipse and setup a debugging configuration.
- In Eclipse the debugging window now shows the following:
- The ABAP debugger now also opens again. Now just pass through all the break points on SAP side using F8 (there is no need to debug there)
- Once all break points in SAP are passed, the break points in Eclipse will be picked up.
- In Eclipse, you can step though the code just like in ABAP and see the value of attributes.