Skip to Content

<body><p>In this blog, I will describe how simple R/3 routine written in JAVA for CRM3.x/4.0 and upgraded to  CRM5.X/CRM7.0.</p><p>Most CRM projects replicate the R/3 pricing configuration (if not stand along CRM system) using CRM middleware, as orders will go through R/3 fulfillment process.</p><p>Once the download of customization and condition loads are done, R/3 custom pricing routines in VOFM needs to be re-written in JAVA.</p><p>As of SAP CRM 5.0, the previously separate Internet Pricing and Configurator (IPC) functionality for pricing has been integrated in the Virtual Machine Container (VMC) of SAP NetWeaver 7.0. With the move from IPCs  server technology to the VMC, SAP also changed the technique of pricing user exit to allow customer to add the coding to the existing functionality in pricing.</p><p>While upgrading CRM 3.x and 4.0  to CRM5.x/CRM7.0, pricing user exits need to be upgraded to the new  AP7.0 architecture. Until IPC4.0 all custom exits used to written in single class <IPC> \ipc\lib\userexits\PricingUserExits.java.</p><p>Details:

1. Following is the simple VOFM  custom Requirement routine 600 in R/3 that need to rewrite in CRM using java.

FORM KOBED_600

   sy-subrc = 4.

  if komp-kposn ne 0.

  check: komp-prsfd ca ‘BX’ and

        komp-pstyv <> ‘ZAAA’ and komp-pstyv <> ‘ZBBB’ .  

 check: komp-kznep = space.

  endif.

  sy-subrc = 0.

ENDFORM.

FORM KOBEV_600.

2. For CRM3.X/4.0:Corresponding JAVA code implemented in method checkRequirement of PricingUserExits class .

public boolean checkRequirement(IConditionFindingManagerUserExit item,

                                                      IStep step,

                                                      int reqNo) {

            IPricingItemUserExit pricingItem = (IPricingItemUserExit) item;

            IPricingDocumentUserExit pricingDocument = pricingItem.getUserExitDocument();

            IMessageObjMgr messageManager = pricingDocument.getMessageManager();

            String language = pricingDocument.getLanguage();

            switch (reqNo) {

                  case 600: String itemId = prCond.getItemId( );

                            if(itemId.equalsIgnoreCase(“0”))

                            {

                                    try {

                                    if ((item.getItemAttributeValue(PricingConstants.AttributeNames.pricingIndicator).equals(“X”))

                                        && (item.getItemAttributeValue(“ITEM_TYPE”).equals(“ZAAA”))&& (item.getItemAttributeValue(“ITEM_TYPE”).equals(“ZBBB”)))

                                         {

                                         return true;

                                         }

                                      else

                                         return false;

                                   }

                              catch (UnsuppliedAttributeException e)

                                  {

                                    throw new SXERuntimeException(messageManager.getMessage(language, PricingConstants.PRICING_MESSAGE_AREA_NEW, 164, new Integer(reqNo).toString(), e.getMessage()));

                                  }

                            }

                            return false;

3. For CRM5.X/7.0: As of AP700 each user exit formula is implemented in a separate java class which must be registered in the system separately.

     a)Create separate Java class for 600 routine which inherit from relevant adapter class.

 package com.mouritech.pricing.userexits;

import com.sap.spe.condmgnt.finding.userexit.RequirementAdapter;

import com.sap.spe.base.logging.UserexitLogger;

import com.sap.spe.condmgnt.customizing.IAccess;

import com.sap.spe.condmgnt.customizing.IStep;

import com.sap.spe.condmgnt.finding.userexit.IConditionFindingManagerUserExit;

public class ZNotCategory extends RequirementAdapter {

                private static UserexitLogger uelogger = new UserexitLogger(ZNotCategory.class);

                public boolean checkRequirement(IConditionFindingManagerUserExit item, IStep step, IAccess access) {

                                String strValue = item.getAttributeValue(“ITEM_TYPE”);

                                String priceIndicator = item.getAttributeValue(“PRICING_INDICATOR”);

                                if (priceIndicator.equals(“X”) && !strValue.equals(“ZAAA”) && !strValue.equals(“ZBBB”)) {

                                                uelogger.writeLogDebug(“Item category NOT equals ZAAA and ZBBB – “strValue);</p><p>                                                return true;</p><p>                                }</p><p>                                uelogger.writeLogError(“Item category equals “strValue);

                                return false;

                }

}

b).Create the jar file using Eclipse or NWDS with above file and upload it to VMC using transaction /SAPCND/UE_DEV. It requires ABAP package and workbench request to upload.

image

c). Using transaction SM53(VMC admin),you can browse through the uploaded user exit classes.

image

d).Using transaction /n/SAPCND/UEASS ,register the implementation under REQ user exit type.In the field user exit class ,write fully qualified class name .

image

e). Maintain the attributes that we used in the code to implementation.

image

f). Assign the formula number to user exit implementation and also map relevant attributes to pricing catalog fields.

!https://weblogs.sdn.sap.com/weblogs/images/252026693/image5.jpg|height=229|alt=image|width=628|src=https://weblogs.sdn.sap.com/weblogs/images/252026693/image5.jpg|border=0!</body>

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Glenn Michaels
    If your ECC pricing requires a condition formula for a statistical condition, that is not used in calculating the actual net price, do you recommend still creating the exit in CRM? even if the java statement is just = false since no calculation is required in the CRM price?  We always did that in 5.0 but wondering if we should continue in 7.0.  Any thoughts appreciated.
    (0) 
    1. Dheeram Kallem Post author
      Thank you Glenn . Pricing design changed from CRM5.0 onwards to integrate IPC with VMC. As per my knowledge nothing much changed b/w CRM 5.0 to CRM 7.0.  If your CRM pricing procedure replicated from ECC and it has some condition formula that may not required in CRM, It’s better to always maintain at least dummy routine (with out logic ,return either true or false) in CRM to avoid pricing errors  and to maintain consistency across the systems.
      (0) 

Leave a Reply