cancel
Showing results for 
Search instead for 
Did you mean: 

IPC:How to get ITM_TYPE val in java PricingExit?

Former Member
0 Kudos

hi friends,

I have to write a requirement formula in the pricingexit of IPC. I need the value of item type (Item Category) of a CRM document. However i can't find any methods like

"getItemType" or something like that.

Does anybody know how to get the value of item category of an item of a CRM document ?

Or as an alternative way of reaching the same item type value :

does anybody know the way to add new attributes coming from CRM to IPC? i may add a new field in pricing (ZZITM_TYPE)and fill it in the pricing BADIs of CRM system. After that, I may read the value of ZZITM_TYPE in the IPC pricingexit under

public boolean checkRequirement(IConditionFindingManagerUserExit item,

IStep step, int reqNo) {

switch (reqNo) {

case 911:

// how to read the value of item category of

// an item of a CRM document(bussiness transaction)

// right here ??

.......

thanks in advance for your interest and valuable help.

Mehmet Karasu

Arista Consulting

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mehmet,

You have to declare the field you are going to use in your pricing routines as Dom has written. The standard field for item category is ITM_TYPE.

Then in your check requirment just add something like this:

case 911:

if (item.getItemAttributeValue("ITM_TYPE").equals("ZFEB"))

return true;

else

return false;

Where ZFEB is your Item category value, true is for making it valid while false means its invalid and will not be applied. You will also need to put a try, catch statement around this code to handle unsupplied values. Using eclipse will do this for you.

Cheers

Andrew

Former Member
0 Kudos

Dom, you're the IPC expert, thanks for all your very valuable replies. Tiest

Former Member
0 Kudos

Thanks Tiest! however, Mehmet, Andrew has the correct solution.

ITM_TYPE is already there, of course. No config or ABAP needed, Java only.

Cheers

Dom

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks Andrew Findlay. I used standart field ITM_TYPE value. Also thanks to Dom Padden for his showing the way adding a new attribute which can be read in IPC. I needed a header completed status value in my IPC check requirement routine and added a new field (ZHDRRELSTAT) to the field catalogue and then got its value in IPC routine.

Thank you very much all of you interested.

Mehmet Karasu

Former Member
0 Kudos

Hi Mehmet

You are right with your "alternative".

All attributes needed for pricing should be added to the field catalog (and thus the communication structure). You can fill the communication structure value via the BAdi CRM_COND_COM_BADI.

Once you have done this and checked it in the ABAP debugger, you need to explicitly provide that attribute to your routines:


	public String[] determineRelevantAttributesForScaleBaseFormula(boolean headerAttributes,
					 			   int scaleBaseFormulaNo) {
		
//		 Header?
		if (headerAttributes) {
			// KOMK fields
			return new String[] { };			
		}			
//		 Item
		else {		
			return new String[] { "ZZITM_TYPE" };
		}
	}

And then you can read it like any other attribute in your routine 911:


String itemCategory = prItem.getItemAttributeValue("ZZITM_TYPE").getValue();

Cheers

Dom

More info here: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/107adc1a-0501...