I cannot really do much with either the CurrentValues or the Defaultvalues objects.
Based on the object model both have a type WebiAddinValues.
So, as far as I understand, it goes like this:
WebiAddinValues (object)
----WebiAddinValue (object)
----------ValueDataType
----------ValueType
----------ValueString
Also a little confused with your code:
loPromptValues.Value = "Enter_the_value_here"
Indeed, it is working, and during a debug of a normal prompt, I can see the “Value” property, but as above, the WebiAddinValue object has no such property in the object model. So, I am wondering, what kind of object it really is.
so, I ended up with this code:
Relevant declarations part
Dim loPrompt As Object
Dim loPromptValues As IWebiAddinValue
Dim loObj As Object
Dim NewValue As IWebiAddinValue
Dim NewValues As IWebiAddinValues
Rest:
For j = 0 To strPromptArr.Length - 1
strCurrPromptValue = strPromptArr(j)
loPrompt = loObj.WebiAddinPrompts.GetItem(j)
loPromptValues = loPrompt.CurrentValues.GetItem(0)
If IsNothing(loPromptValues) Then
NewValues = New webi_moduleLib.WebiAddinValues
NewValue = New webi_moduleLib.WebiAddinValue
NewValue.ValueDataType = WebiAddinPromptType.WEBIADDIN_PROMPT_TYPE_TEXT
loPrompt.addvalues(NewValues, False)
loPrompt.addvalue(NewValue, False)
loPromptValues = loPrompt.CurrentValues.GetItem(0)
loPromptValues.ValueDataType = 0
loPromptValues.ValueString = strCurrPromptValue
Else
loPromptValues.ValueString = strCurrPromptValue
End If
The strPromptArr variable contains my prompts as an array. When I declared the loPromptValues object, I had to replace the loPromptValues.Value property part with loPromptValues.ValueString because, the build failed with “non-member” error. I don’t see any difference when whether I put True or False in the AddValue(s) part.
The first parameter is mandatory, with an existing value, the second in my report is optional, with no value. This is processed in the first part. The code fails at the very last row, when I try to add value to the prompt, saying that “The method or operation is not implemented.”
Attached the 2 screen shots how different is the 2 object, even tough, they should look the same… Maybe the missing properties are implemented from another object? Is there any chance that someone from SAP would provide an official code snippet on this?


vilmarci
(BOB member since 2006-10-04)