Generating a condition in the FOX code
We wish to generate a condition in the FOX code that is conditional upon part of a characteristic value. Assume the characteristic has the following values 0006010B01, 0006020B01. We only wish to process a function where the value "B01" is part of the characteristic value.

    Requires Free Membership to View

    When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

Let's assume the characteristic you want to use in the condition is Cost Center, then following FOX code checks the Cost Center values and if Cost Center number includes 'B01,' program assigns 5000 to the quantity key figure for that record.

DATA CC TYPE 0COSTCENTER.

CC = OBJV().

IF CC CP '*B01*'.

{0QUANTITY} = 5000.

ENDIF.

You can include similar logic in your FOX code to transform data based on the characteristic value conditions. You can find detailed information about the usage of string functions in the FOX on screen help (documentation).

This was first published in December 2004