Skip to Content

What is the Exact difference between Isset() and IsInitial()?

hi,

As im very much new to SAP im unable to understand the difference between isset and isinitial and when I see any sample code there is a not symbol(!) and I don't understand the exact definition ..Please Help me to clear these concept

Thanks in advance,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 10 at 12:36 PM

    7.2.4.8 Check Associations (Business Logic) Syntax <path expression>.<association name>.IsSet();

    Description

    You can use the IsSet () method for [1,1] or [0,1] associations to check whether the association was set before. Otherwise any access to an association that was not set causes a runtime error.

    Example

    var targetNode = this.ToTarget; if (this.ToTarget.IsSet()) { this.Name = "Assoc set to: " + targetNode.Name; } else { this.Name = "Assoc not set."; }

    7.2.6.2 Generic Built-In Functions

    IsInitial ==> All data types except for Boolean data types. Indicates whether a value is initial or not. Returns a Boolean value.

    Add comment
    10|10000 characters needed characters exceeded