Variant Configuration – Simplify your Dependencies

Home / Blog / Variant Configuration – Simplify your Dependencies

Now today’s post is just  simple reminder to keep your variant configuration dependencies simple.  Lately I’ve seen a lot of dependencies that work just fine, but the logic is more complex than needed.  So here’s a couple of pointers I’ve noticed lately that should help to simplify your dependency code.

1.  If you’re using SET_PRICING_FACTOR, and it should be applied if the condition exists (for example, it’s always a factor of 2 or 4 if the condition exist), don’t add any additional logic beyond that.  The pricing factor can only be applied if the condition exists in the configuration.  You don’t need an if statement unless the pricing factor doesn’t always apply to the variant condition.

Before: (psuedo code, sorry)

$SET_PRICING_FACTOR($SELF, VAR_COND_1, 2) IF ….  (same logic that sets VAR_COND_1).
should be:
$SET_PRICING_FACTOR($SELF, VAR_COND_1, 2)

2.  If you set a default, you don’t have to delete that default if you are setting the value for that characteristic.  $DEL_DEFAULT only needs to be used if you want to remove the default and you aren’t explicitly setting the value.

3.  If your if statement has CSTIC = X, you don’t need to add if CSTIC SPECIFIED AND CSTIC = X.  It will be true if the cstic is specified already.

There’s just a few examples of ways to simplify your code and make it easier to read and maybe even improve performance.

Thanks for reading,

As always, thanks for reading and don't forget to check out our SAP Service Management Products at my other company JaveLLin Solutions,
Mike

2 thoughts on “Variant Configuration – Simplify your Dependencies

  1. //3. If your if statement has CSTIC = X, you don’t need to add if CSTIC SPECIFIED AND CSTIC = X. It will be true if the cstic is specified already.

    not fully agree with this tip 3, in procedure, specified is added to make sure the whole procedure won’t be terminated once cstic is not specified.

    1. That’s a great point. I hadn’t thought about that when I started writing. Thanks for this correction.
      Mike

Leave a Reply

Your email address will not be published. Required fields are marked *