cancel
Showing results for 
Search instead for 
Did you mean: 

Read custom attributes on Java user exits IPC -

Former Member
0 Kudos

Hi Friends,

I am on 2007 and have one issue on Pricing.

We have B2b Webshops + Java user exits, CRM_COND_COM_BADI (implemented to fill custom attributes)

We have user exit, where im doing item.getAttributValue("custom attr1"), in my java user exit.

This is all working fine when i create order in GUI, Shopping basket.

But we need to read these values in the java exit when browsing product catalogs for pricing.

I read note : 1004533, and implemented BADI: CRM_ISA_HDR_PRICING similarly.

Now in my java user exit: i m doing item.getAttributeValue("custom attr1"), here when i browse PC, this value in exit is getting nothing, but when i debug the badi.. the value is getting filled.

How to retrieve the custom attr1 value filled in badi CRM_ISA_HDR_PRICING ??

I need this to do, otherwise all my rounding/discount calculations in java user exit will differ and this is a problem.

I would be glad to here some inputs which is highly appreciated.

thanks ,

RD

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

CRM_COND_COM_BADI is still called when you create the orders from the web (using ISA). This is the place where you transfer the "custom attr1" from the transaction to the "pricing variables". So, it is the question of getting the "custom attr1" put in the right place from the ISA into the transaction.

If "custom attr1" is something of a custom value in the transaction given as an user input then you your enhance the ISA application. But if this is something you can determine from the transaction, then you should do so in the CRM_COND_COM_BADI.

The trick could be to get the "pricing" triggered at a time you want!

Easwar Ram

http://www.parxlns.com

Former Member
0 Kudos

Hi Easwer Ram,

You are very true. COND_COM_BADI, will trigger for transaction/order both from isa and gui. this is fine.

But when i browser product catalog on ISA< this wont trigger.... but my java user exits gets triggered and java code expects the attributes which are set in cond_com_badi which are extended with new fields in field catalog.

When browsing product catalog, how to pass these attributes to exits as we know cond_com badi doenst trigger, so i followed that note...

Not sure what is faulty im doing here.

any thoughts or valuable points?

RD

Former Member
0 Kudos

The pricing in catalog depends on IPC alone for data and doesn't "go" to the CRM system. It is possible that you have already explored these notes. However, I am giving them for your reference. Some of the notes below are old but yet relevant to understand the issues.

[Note 957798 - Unexpected pricing result|https://service.sap.com/sap/support/notes/957798] - Start here and see the attached document to the note ([Pricing Attributes.zip|https://service.sap.com/~sapidb/012003146900000554022006E/PricingAttributes.zip]). The document explains why the price is different in the catalog.

[Note 1004533 - Pricing in Web catalog SAP ECO 5.0 for mySAP CRM|https://service.sap.com/sap/support/notes/1004533] - Gives you development tips to use PricingCalculator and to send additional parameters to IPC.

[Note 528073 - sending more data to IPC when having wrong price/cfg in cat|https://service.sap.com/sap/support/notes/528073]

[Note 514011 - Prices in catalog is incorrect - Run Price Analysis|https://service.sap.com/sap/support/notes/514011]

Easwar Ram

http://www.parxlns.com

Former Member
0 Kudos

In CRM non IPC scenario, if I populate extra name value pairs(Zfields). Is the attribute mapping mandatory in /sapcnd/ueass. I don't see these Z fields list while assigning the attributes as the list comes from the CRM field catalog. Can you please share your thoughts here.

Thanks!

Surya.

Former Member
0 Kudos

You have to extend the field catalog with new Z fields. Then only they are available in item/header structure.

RD

Former Member
0 Kudos

Hi RD,

Try to do a select (system.print) of that custom attribute in Java coding to the logs prior to executing item.getAttributValue("custom attr1"). See if that custom attribute value gets printed to the logs. If its being fetched in the logs it should get to further coding.

Answers (1)

Answers (1)

Former Member
0 Kudos

>

> Hi Friends,

> I am on 2007 and have one issue on Pricing.

> We have B2b Webshops + Java user exits, CRM_COND_COM_BADI (implemented to fill custom attributes)

>

> We have user exit, where im doing item.getAttributValue("custom attr1"), in my java user exit.

> This is all working fine when i create order in GUI, Shopping basket.

> But we need to read these values in the java exit when browsing product catalogs for pricing.

>

> I read note : 1004533, and implemented BADI: CRM_ISA_HDR_PRICING similarly.

>

> Now in my java user exit: i m doing item.getAttributeValue("custom attr1"), here when i browse PC, this value in exit is getting nothing, but when i debug the badi.. the value is getting filled.

>

> How to retrieve the custom attr1 value filled in badi CRM_ISA_HDR_PRICING ??

> I need this to do, otherwise all my rounding/discount calculations in java user exit will differ and this is a problem.

>

> I would be glad to here some inputs which is highly appreciated.

>

> thanks ,

> RD

Hey RD,

The custom attribute which ur are talking about should be populated to header attribute of field catalog.

Try using the document object and fetch the value.Hope it helps.

Warm Regards,

Sumit

Please vote its ur right

Former Member
0 Kudos

Hi Sumit,

DO you mean to populate to NEW_VALUES_READ method of this badi????

And what do you mean by fetch the value by document object ?

RD

Former Member
0 Kudos

Hey RD,

For header attributes header.getattribute("") does not work , so the work around is to use document.getattribute("").

Warm Regards,

Sumit

Former Member
0 Kudos

Hey RD,

I am facing exactly the same problem in the Product Catalog, but in case you have resolved the issue, your guidance can really help me in here.

Awaiting your response. Thanks.

Former Member
0 Kudos

Hi Vartika,

Its still the same, i couldnt yet solve the issue.

in badi im passing the attribute name and its value in HDR_pricing badi, but after that in user exit, where i am reading item.getattribute(" custom attr name") its not picking this value..

pls respond if u got this solved, same i wll do.

RD

Former Member
0 Kudos

Hi RD,

For the Product Catalog, when debugged, there was an error occuring in the Java layer when reading item attributes for Product Catalog, SAP has developed a correction note for the same which is sapnote_0001346856.

For the User exits, it is not yet solved.

Regards,

Vartika

Former Member
0 Kudos

yes that OSS raised by us and SAP gave a patch to replace a jar file. but it still the same issue we have..

basically from java layer, the FM's called CRM_ISA_PRICING_ITMDATA_GET and SPC_CREATE_ITEMS.

Now FM CRM_ISA_PRICING_ITMDATA_GET returns et_itemattributes which has got standard attr + custom ones' + their values.

after that , i debugged in front end, and that attributes are not getting sent to SPc_create_items, It emans

IPC doenst has a scope fo tthese vlaues.

we are still working on it. if solved i will udpate u, pls do the same.

RD

Former Member
0 Kudos

Hi RD,

Thanks for this information. Actually we are still in the process of upgrading our Support Package to SP003. As recommended by the note the Support package should be SP004 and then the required patch level.

Want to know which Support PAckage are you using and which patch have you actually applied. Thanks for the help.

Regards,

Vartika

Former Member
0 Kudos

we are on SP004 and applied that patch. but seems that still didnt solve the issue.

basically if u see that code - it is setting headerattributes and not the itemattributes in pricecalculatorCRMIPC, which i feel it shud be setitemattribtues.

RD

Former Member
0 Kudos

Hi RD,

No great news from my end though.

But in my case, when debugged, the custom item attributes are being captured by SPC_CREATE_ITEMS and SPC_CHANGE_ITEMS. But these values are still not being read by the Product Catalog. Still in process of applying Patch Level 14. Will have to wait for the results till then.

Coming to the second issue of User Exits, the custom item attributes are being read by the custom User Exits also except in one case: The item attribute (standard & custom) values are not being read by the custom user exit when once the item is rejected. These values are still being passed to vmc structure of SPC_CHANGE_ITEMS FM.

Any pointers on that?

Regards,

Vartika.

Former Member
0 Kudos

that BADI is working. solved