Contact

Industry Leading Blog for Manufacturers

Let's start with an easy one. Setting and unsetting default values in SAP VC procedures can be a little tricky. Whereas conditionally inferred values are revoked when their condition is no longer satisfied, the same is not true for values set by default. What does that mean? Perhaps an example will help to explain:

$SELF.C = 'X' IF $SELF.B IS SPECIFIED

If B is specified, then C will have an inferred value of X. If B is later unspecified, then the value assigned to C will be revoked (i.e. no longer specified). Now let's change the syntax to set by default:

$SELF.C ?= 'X' IF $SELF.B IS SPECIFIED

If B is specified, then C will have a default value of X. If B is later unspecified, then the value assigned to C remains. This may or may not work to your advantage. What if you want values conditionally set by default to be revoked when their condition is no longer satisfied? A simple addition will make this work:

$DEL_DEFAULT( $SELF, C, $SELF.C ) IF $SELF.C SPECIFIED,

$SELF.C ?= 'X' IF $SELF.B IS SPECIFIED

The first statement deletes the value assigned to characteristic C from characteristic C if characteristic C is specified. The "if specified" is needed to prevent the procedure from terminating if no value is assigned to C. The first statement will always delete whatever default value is assigned to C. In the second statement (and beyond), a default value for C is set or not depending on conditions being satisfied. In effect, this revokes values set by default in the much the same way as inferred values.

There is one caveat to the approach above; C must be a single value characteristic. You may be wondering why $DEL_DEFAULT has three arguments anyway. It doesn't seem necessary for single value characteristics (i.e.

just delete whatever default value is assigned). It does however makes sense for multi-value characteristics. If there are multiple values set by default to the same characteristic, then it is necessary to specify which value is to be deleted by default.

x


Stay up to date on the leading industry solutions by subscribing to our blog digest.
What can we help you with?

CONTACT US

(585) 506-4600  |  (844) 506-4600