Skip to Content
0
Jul 10, 2013 at 09:47 AM

Static method calls with namespace qualifiers

788 Views

Dear community,

I'm currently facing a small problem in ABSL-coding, perhaps someone can help me:

After migrating our solution into a new tenant, static method calls like "Duration.ParseFromString("PT0H");" caused an error which stated it was neccessary to explicitly qualify the namespace as the data type "Duration" was found in several namespaces.

I was just told by a SAP dev (via support ticket causing delays on every other question), that I should follow the pattern:

var myResult = [namespace] :: [data type].[method];

Now when trying "var duration = apCommon::Duration.ParseFromString("PT0H");" I get the error "Object type 'apCommon' is not valid. Choose different object type."

>>Please see screenshot attached.

The documentation also doesn't provide a specific explanation on how to handle static method calls with namespace prefix.

Can anyone help me on this please?

Kind Regards

Pablo

Attachments