cancel
Showing results for 
Search instead for 
Did you mean: 

Calling IPC RFC from custom PriceCalculatorCRMIPC BO

Former Member
0 Kudos

Experts,

I'm running into some strange issues when attempting to call IPC RFC from a custom PriceCalculatorCRMIPC Business Object.

I'm attempting to call the SPC_PERF_GET_PRICING_CONDITION function module. The JCO call appears to be sending correctly as I'm not getting any exceptions, but upon inspecting the ET_CONDITION Table that is returned it's always blank. I'm also looking at the MESSAGE table in the ES_PROFILE structure, but no error messages are returned.

I'm curious if anyone has had success making RFC calls to IPC before and if I could get some example code or a description on how to do this. I'm also curious to know exactly how IPC processes calls. I know that you have to pass a document ID when making calls, but is that IPC document persisted in IPC for the life of the user's session, or do I need to recreate the IPC document(and items) every time I want to call for IPC information?

Thanks in advance!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Brian,

To make a successful call, the right pricing document guid needs to be passed with the other mandatory parameters like IV_INCL_SUBTOTALS and IV_FOR_PRINTING ( X). I am sure in pricingcalculator java class you have pricing document guid available. But you need to see if you are getting IV_INC_SUBTOTALS field value.

If your goal is to just get the conditions then there could be alternate ways to do that. for example even CRM_ORDER_REad FM also returns you all the pricing conditions and every pricing details.

Thanks and regards,

Dipender Singh

Former Member
0 Kudos

Dipender,

Thank you for the response. I already knew that those fields are required and therefore must be populated. I found the problem and was able to work around it.

The issue that I was having is that I wanted to display all pricing scales for a particular product on a product page. These products wouldn't be added to the shopping cart, so the idea of using CRM order related function modules will not work. I should have been more clear in explaining what I was trying to accomplish.

It seems that the IPC related function modules have rather poor error messages, if they exist at all. There are only certain cases where you will get an error message returned when using SPC_* function modules. Invalid IPC item and IPC document guids will end up triggering messages in the ES_PROFILE -> MESSAGES table. The issue that I had is that I was passing in an invalid step number into IV_STEP_NUMBER. The step number I was looking for was 30, but I was passing 030. IPC was unable to locate step but didn't return any error messages. The result is that when I debugged the code I had written all tables would return with blank values, and there would be no messages in the ES_PROFILE -> MESSAGES table.

A couple of other quick points for anyone that references this post in the future.

"I am sure in pricingcalculator java class you have pricing document guid available." - This is correct. When your session starts you web channel will create an IPC document which will last the life of your session or until you destory it.

Please note that when you go to call pricing for an item in web channel you will need to create an IPC item within IPC. This is already done via the getDynamicPrices() method in the price calculator object. You can also use the SPC_CREATE_ITEMS function module. Another interesting point is it seems that the out of the box SAP code keeps creating items on the IPC document even if a particular item already exists. This can be viewed by viewing SPC_GET_DOCUMENT_INFO which is responsible for retrieving pricing data. I haven't studied any performance effects that could exist if the IPC document grows to a large size, but I haven't seen any place where SPC_REMOVE_ITEMS is implemented.

Hopefully this helps.