cancel
Showing results for 
Search instead for 
Did you mean: 

IPC : Access to other items in Valueform

Former Member
0 Kudos
168

Hello,

We have a pricing condition which require to read sub-items of a certain type in order to add subtotals.

I don't know how I can access to other items data in the method "overwriteConditionValue".

I tried the method "getSubPricingItemsUserExitRecursive()" of Interface "IPricingItemUserExit" but I don't really know how it works...

Could someone help me ?

Thanks,

Benoî

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Benoît

This method returns all of the subitems as an array. You can then iterate over the array and read each one.

Eg:


// Get the sub-items
IPricingItemUserExit[] prSubItems = prItem.getSubPricingItemsUserExitRecursive();

// Now you have all the sub-items in array prSubItems.
// Let's loop through them:

            for (int j = 0; j < prSubItems.length; j++) {

//    Add up the sub-items Subtotal
//    need some Java addition logic here...
prSubItems[j].getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_1);

            }

In the delivered SAP standard routines, there is a condition value routine 36 that uses the method. Have a look.

Check in file CRMStandardExits.java.txt .

Good Luck

Dom

Former Member
0 Kudos

Hello Dom,

I saw routine 36 and I did iterate the array, but something did not work and I don't know what, I had some "null exception" when trying to read CRM_ITEM_GUID or PRED_ITEM_GUID...

It returns all subitems even if the condition is not structured or cumulative type ?

Thanks anyway,

Benoî

Answers (2)

Answers (2)

Former Member
0 Kudos

have you put it into here:

public int[] getConditionValueFormulaNumbers() {

return new int[] { 927 };

}

Former Member
0 Kudos

Hello Dom,

I solved my problem, in fact I was using CRM_ITEM_GUID and PRED_ITEM_GUID but they were null so it's why I had exceptions.

Now everything works like I want,

Thanks,

Benoî

Former Member
0 Kudos

Now I have a message that said that my routine (N° 927) is not implemented in the module PricingStandardExits...

I don't undertand what happened,

Thakns for help,

Benoî