cancel
Showing results for 
Search instead for 
Did you mean: 

Extending WebCatItem object in CRM ISA B2B

Former Member
0 Kudos

Hi,

I need to extend the WebCatItem business object to include some extra custom data (basically, just three boolean values at this stage.) I've previously created a completely custom business object, backend manager and business object manager which calls a custom BAPI I've written on the CRM system to retrieve data but I can't figure out how to do the same to extend an existing business object.

I specifically want to add an extra column to the ProductsISA.jsp page. I believe I need to create a BAPI to determine my custom data, use the addExtensionData method of the WebCatItem object - is this correct? The two topics in the development guide that seem applicable are "Storing Additional Data - Extension Mechanism" and "Extending Existing Busines Objects". I believe I need to extend the object but how?!

The section relating to this in the development and extension guide is not very clear to me!

Could someone please give me some pointers or even better some sample code with guidance?

Thanks in advance.

Gareth Ryan.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Where is the data coming from that you need to add? TREX or CRM? This will determine the best way to retrieve the data.

Former Member
0 Kudos

Hi Stephen,

It's coming from a custom RFC BAPI I wrote on the CRM system.

Thanks,

Gareth Ryan.

Former Member
0 Kudos

Hi Gareth

My understanding is that you want to store some extra attribute for items in your CRM catalog and want to display that extra attribute in the list page ei ProductISA.jsp. If this is all you need to do, then good thing is you dont need to make any changes to any business object class.

Define a custom attribute in CRM catalog and assign its value. You may need to republish the catalog once you've done this.

On the Java side to access this extra attribute you can use the following code.

WebCatItem item = (WebCatItem) lstItems.get(nCount);

String strOrderCD = item.getAttribute("ZORDERCODE");

getAttribute() method reads the value of any custom parameter you may define in your CRM catalog. In case you want to send some extra data to CRM, you'll need to use the addExtensionData() method and would need to handle this extra info in the corresponding BADI.

Cheers

PB

Former Member
0 Kudos

Hi PB,

Thanks for your reply - I know how to use the attributes but unfortunately in this case this isn't an option as the values of the data need to be resolved based on some logic on the CRM system, not just using straight values out of attributes.

Essentially, I wanted to extend the constructor of a given WebCatItem so that when it retrieved all of its data for the item I could add a couple of extra methods to call some custom BAPI's to retrieve data based on some logic.

In the end, I added an action into the process flow that called my BAPI's and added the correct data into the objects using the addExtensionData() method and this works great. I just wasn't convinced this was the best approach!

Thanks,

Gareth.

Former Member
0 Kudos

Hi Gareth

I believe that extending the isa-core business objects is not a very good idea as I tried to do so and it created a mess.

So, now once you have the object of WebCatItem you are again sending a request to fetch extra information using a BAPI call. Instead of this, I suppose you can extend an Event Listener which is called before and after a call to a functional module is made. Once you have the excuted the function module and received the webcatitem object, you can execute within the same request another call to BAPI and get extra information, and add this data to the object using addextensiondata() method.

Please do let me know if you try this method and if it works.

Cheers

PB