Hi all,

I've tried to set the value of an attribute of the type enumerator in a macro.

I tried the methods

Designer.setAttribute(myModel, myObj,Constants.AT_SAP_FUNC_TYPE, "Process", null)
 and
Designer.setAttributePersistent(myObj, Constants.AT_SAP_FUNC_TYPE, "Project", null)

The result was that in the first case, although no error was thrown, the attribute value remained unchanged. In the second case an error was thrown stating that an parameter of type String was passed instead of Integer. This error message doesn't make much sense: When I tried exactly the same statement with the attrTypeNum "AT_SHORT_DESC", it worked flawlessly.

When I try to do the same in a report by the following statement, the attribute is set without any problems:

ObjDef.Attribute(Constants.AT_SAP_FUNC_TYPE, Context.getSelectedLanguage).setValue("Process")

Does anyone know whether there's a different way to set the value of enumerator attributes in a macro? Or has someone experienced a similar problem?

Thank you and best regards,

Philipp

Tags: script macro