cancel
Showing results for 
Search instead for 
Did you mean: 

SD user exit not working properly

Former Member
0 Kudos

Hello!

I have a problem with the implementation of user exit. My requirement is to get the value of the default PR00 condition type

public class ZPricing905 extends ValueFormulaAdapter {

  private static UserexitLogger userexitlogger = new UserexitLogger(

  ZPricing05.class);

  public BigDecimal overwriteConditionValue(IPricingItemUserExit item,

  IPricingConditionUserExit condition) {

  userexitlogger.writeLogDebug("user exit 905");

  String manualValue905 = item.getAttributeValue("PR00");

  if (manualValue905 != null && manualValue905 != "") {

  userexitlogger.writeLogDebug("condition: " + manualValue905);

  return new BigDecimal(manualValue905);

  }else{

  userexitlogger.writeLogDebug("no pricing");

  }

  userexitlogger.writeLogDebug("exit UE 905");

  return null;

  }

}

1.This is my Java code. After this I generate a .jar file and export it. Then I go to /n/SAPCND/UE_DEV and upload my .jar file.

2. I restart the VMC

3. I go to  /N/SAPCND/UEASS on type I choose VAL, on Implementation I've created a new User Exit with Name Z905 and have assigned the user exit class to it. (no .class extension, as the document says)

4. Now I have a question. When I press on attributes, on Relevant Attribute Name I've typed PR00 with the proper description, is that the way it should be? I've tried both with empty attribute and with "PR00" but the result is the same.
5. I go to formulas and when asked for application, I've got two working for me - the first one is S (SD) and the second one is PRT (some kind of test app) - do you know what is the difference and which one should I use to assign the formula? All the documents on internet are for CRM and not for SD so I'm having a problem here.

6. However, I choose the S application and assign my user exit Z905 to my formula 905, and then when it comes to the formula attributes, what should i do ? I've tried typing on both places PR00 (relevant attribute name and field name) and no result. I've also tried with empty fields

The next thing I do is go to the pricing procedure and assign my formula 905 to the PR00 condition type. Then I restart the VMC and once I go to the webshop all prices are 0.00. Do you have any clue how to fix that? When I remove 905 from PR00, everything works fine, but I need this user exit so I can get the value.

One more thing. When I log to the VMC adminisration panel I don't see anything in the log...

Any help will be appreciated! Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

Jelena
Active Contributor
0 Kudos

Could you elaborate on what exactly your requirements are? I've never heard of anyone writing an SD user exit in Java...

There are very well documented user exits in pricing and also VOFM routines, so I'm quite confused what is the purpose here.

Thank you.

Former Member
0 Kudos

Hello. My requirement is to get the PR00 value via user exit and return it. I've created a formula via VOFM and then followed the above described steps and something seems to be wrong.

As for the title of the topic, I may have made mistake by writing SD user exit, it is just a normal formula routine written in java and implemented in the VMC.

Jelena
Active Contributor
0 Kudos

I've googled 'ValueFormulaAdapter' and most of the posts seem to point to the CRM system. This forum is for the SD module, there is a different space for CRM and also different space for Java.

Please post discussions in the right space (refer to Getting Started section on the home page). I've alerted the moderators to move this post.