cancel
Showing results for 
Search instead for 
Did you mean: 

customerExit using factoy-config.xml

Ash_ok
Contributor
0 Kudos

Hi !

I am trying to overwrite the method customerExitParseRequest in Action class MaintainShipToAction with my own implementation, but the control doesn't seem to be going to the newly created implementation in spite of creating an entry in factory-config.xml.

Would anyone have used the customerExits provided in the ISA using factory-config.xml ? If so, can one provide steps / directions on how to get this going ?

Cheers,

Ashok.

Accepted Solutions (0)

Answers (2)

Answers (2)

Ash_ok
Contributor
0 Kudos

.

Former Member
0 Kudos

Hi Ashok,

Have you made appropriate changes in config.xml file to add your Z_MaintainShipToAction class.

Please check your config.xml entry may be you have not done it. AS you have written that your control is not going in written java code.

eCommerce Developer.

Ash_ok
Contributor
0 Kudos

Hi eCommerce Developer,

As I understand it, config.xml is only for Struts actions. In my case, customerExitParseRequest is a method in com.sap.isa.isacore.action.MaintainShipToAction that I'd like to overwrite. My customised Java class holding the new implementation for method customerExitParseRequest is not a new Action. Where and how would I add it on config.xml ?

Ashok.

Former Member
0 Kudos

Hi Ashok,

If you are working on B2B then you can find below 2 entry in your config.xml file regarding MaintainShipToAction


<action path="/b2b/maintainshipto" type="com.sap.isa.isacore.action.MaintainShipToAction">

and


<action path="/b2b/ordermaintainshipto" type="com.sap.isa.isacore.action.MaintainShipToAction">

MaintainShipToAction is a Action class and if you extend it to implement customerExitParseRequest method in your custom side Java class then it is a New Action Java class and you have to make an entry in config.xml file like below.


<action path="/b2b/maintainshipto" type="com.xxx.isa.isacore.action.Z_MaintainShipToAction">

and


<action path="/b2b/ordermaintainshipto" type="com.xxx.isa.isacore.action.Z_MaintainShipToAction">

without making an entry of your custom Java action class in config.xml you will never enter into your custom implementation of customerExitParseRequest method and every time your ISA application will call standard MaintainShipToAction class instead of your custom Z_MaintainShipToAction because in config.xml you have not make an entry as I have written above.

I hope this information will help you.

eCommerce Developer

Ash_ok
Contributor
0 Kudos

Hi eCommerce Developer,

What you have explained is what one would normally do, if one wants to extend any particular method of a Struts Action Java class. For such a solution, one doesn't need to make any changes in factory-config.xml. However, on reading Extension Demo 7 on pages 78 / 79 of ECommerce70_DevAndExtGuide_Tutorials.pdf, I think one can get away without adding an entry in config.xml. I reproduce below the comments in com.sap.isa.backend.r3lrd.WrapperIsaR3LrdCustomerExit.java


/**
 * Provides customer exit methods for the R3LRD remote function calls.
 * 
 * <p>Before and after every remote function call in the WrapperIsaR3Lrd classes, a customer method is called. By
 * default the methods are doing nothing, that means, they have an empty implementation. To implement single 
 * customer methods, the <code>WrapperIsaR3LrdCustomerExit</code> class has to be subclassed and the desired 
 * methods have to be overwritten.</p>
 * 
 * <p>To activate the customer exit, an entry has to be changed in the <code>factory-config.xml</code> configuration file. 
 * The <code>className</code> attribute has to be changed, so that it contains the name of the subclass, mentioned above.</p>
 * <pre><code>
 * <factoryClass name = "WrapperCustomerExitR3LRD" 
       singleton     = "false"
       reuseInstance = "true"
       className     = "com.sap.isa.backend.r3lrd.WrapperIsaR3LrdCustomerExit" />   
 * </code></pre>
 * 
 * The <code>reuseInstance</code> attribute makes sure, that a once created instance of the customer exit class is 
 * reused in every call (lean singleton).
 */

Ashok.

Former Member
0 Kudos

Hi Ashok,

In your initial question you were talking about MaintainShipToAction which is Action class and Action class is not suppose to a communicate with Back end (CRM-ERP). You were talking about method customerExitParseRequest of class MaintainShipToAction

If you want to extend or implement method customerExitParseRequest of class MaintainShipToAction you must have to follow the step as you know and I have described in my previous reply.

In your last reply you were now talking about WrapperIsaR3LrdCustomerExit which is not action class. it is Back End Object (BEO). Java Classes in your both reply and example belongs to different layer of ISA structure.

You cannot implement example given in your last reply on Action class extension. If you are extending or implementing customer exit method of any Backe End Object then you can follow your last reply technique but you cannot use it for action class.

I hope this information will clear your confusion.

Let me know if you have any question.

eCommerce Developer.

Ash_ok
Contributor
0 Kudos

You wouldn't think it strange that SAP has provided the empty method customerExitParseRequest in Action class MaintainShipToAction itself and then expect MaintainShipToAction to be 'Z' cloned to overwrite the method ? Why then would SAP provide an empty method customerExitParseRequest in Action class MaintainShipToAction in the first place ??

Former Member
0 Kudos

Hi Ashok,

Reason for Customer Exit in Action or Backend Object class is Some Actiont classes already provide user exits in the form of predefined, in most cases empty, methods. For extensions only the existing methods have to be implemented or extended in a new Action class derived from the standard Action class. The advantage of predefined user exits is that extensions or changes in the standard Action classes by SAP within support packages or future releases are aware of these user exits:

User Exit or Customer exit gives you freedom to extend, Add new logic for business or enhance current implementation of Action class and for that you have to extend standard action class in your custom "Z" class and then replace appropriate entry in config file to call your enhanced or modified Action class which is derived from Standard Action class.

eCommerce Developer.

Ash_ok
Contributor
0 Kudos

Hi !

It doesn't make sense to clone a standard SAP Action class, put in some new code in the customerExit and replace the standard SAP Action class with the cloned Action class in config.xml, when one could very well have put in bespoke code to the cloned Action class minus the customerExit. Also, how would SAP know of any new implementation in the customerExit unless it's told to look in another class, for example let's say in the factory-config.xml ? The explanation doesn't sound convincing, though there may be some truth to it.

Can someone from SAP throw some light on this ? Mark Foley ??

Cheers,

Ashok.

Former Member
0 Kudos

Hi,

Can you post the changes you made to factory-config.xml file. May be some issue with that.

Also can you point to the location from where guide 7.0 can be downloaded.

Cheers,

Subbu.

Ash_ok
Contributor
0 Kudos

Hi Subbu,

The eCommerce Development and Extension Guide is available in Link: [Installation & Upgrade Guides / SAP Business Suite Applications / SAP CRM 7.0|https://websmp208.sap-ag.de/instguides].

Cheers,

Ashok.

Former Member
0 Kudos

Hi Ahsok,

Please refer to Page 176/312 of SAP_ISA70_DevAndExtGuide or page 171/303 of SAP_ISA50_DevAndExtGuide which has the flow chart of 'how to transfer additional input data from the http request'. It clearly states even if you have implemented the user exit method of action class it must be registered in the congfiguration (Step 4).

<b> with respect to your comment </b>

<i> &nbsp;&nbsp;&nbsp;&nbsp; "It doesn't make sense to clone a standard SAP Action class, put in some new code in the customerExit and replace the standard SAP Action class with the cloned Action class in config.xml, when one could very well have put in bespoke code to the cloned Action class minus the customerExit" </i>

<b> answer is </b>

<i> &nbsp;&nbsp;&nbsp;&nbsp; If you modify the existing code - say doPerform - then during upgradation if the logic of doPerform has been changed by SAP then again you need to find out the appropriate place in the new logic to fit in your custom code. Where as if it is in Customer exit then you need not bother about whether the logic of doPerform has been changed or not. You just copy paste the code from previous implementation to the new implementation </i>

<b> With respect to your comparision on 'WrapperIsaR3LrdCustomerExit' with factory-config.xml </b>

<i> &nbsp;&nbsp;&nbsp;&nbsp;Please note that ISA logic of how Action class and backend class are configured and processed differs. For action class when it looks into config.xml for backend it is looking into factory-config.xml. </i>

Hope now you are clear

Cheers,

Subbu.

Former Member
0 Kudos

Hello eCommerce Developer,

Can you shed more light on this changes? I have enhanced and created the custom class - Z_MaintainShipToAction and changed the config.xml file. But what ever changes I put in they are not working. My requirement is to add an additional field street 2 which I am saving it to strsuppl1 field in the address structure.

I can see in debug that the custom code is getting executed, the request parser is able to read the custom field street 2 on shiptodetails page and get the value . I also set the street 2 value in the strsuppl1 field but it doesn't get saved in the backend. do you have a sample code of what to put in in the Z class?

I have checked the thread -

but the sample in there doesn't work.

Thanks,

Kumar

Ash_ok
Contributor
0 Kudos

Hi Kumar,

There are quite a lot of changes that need to be made to include additional lines of address on the webshop to be reflected in the backend system.

As explained in this thread and in the other thread referred by you, one should start by making the needed change in the JSP. It should be followed by changes to the action that is triggered when the 'Save' button is clicked. This then has to go through all the layers including the business object layer and the backend object layers before it can be included in the fields that need to be updated using a BAPI / FM in the backend object.

Of what I have seen, CRM BAPIs / FM handles all the address fields from the Java stack. However, ECC BAPIs / FM do not handle all the address fields and one would have to enhance them to include those additional fields.

The ShipTo address details are linked to the Java basket object.

HTH,

Ashok.