cancel
Showing results for 
Search instead for 
Did you mean: 

UDO objects

Former Member
0 Kudos

Hi,

I'm trying to connect UDO object with a form created with Screen Painter. How can I do it??? Is there any example available???

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

You should set the property <i>ObjectType</i> with the UID of your UDO object.

You can set it using the ScreenPainter form properties or by code into the FormCreationParams object.

Hope it helps

Trinidad.

Please reward points to this answer if your problem is solved.

Former Member
0 Kudos

Hi,

I'm trying this:

creationPackage = New SAPbouiCOM.FormCreationParams

creationPackage.FormUID = "Area"

creationPackage.Type = "2000000000"

creationPackage.ObjectType = "Area"

creationPackage.WindowType = SAPbouiCOM.BoFormTypes.ft_Fixed

oForm = SBO_Application.Forms.AddEx(creationPackage)

But when it's running I get next error: "No valid property use".

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Is "Area" the code of your UDO object?

Is the UDO already created?

You must also create the ForCreationParams using SBO_Application.CreateObject

before asigning its properties (and not with a New).

Here you have a sample:

creationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)

creationPackage.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed

creationPackage.FormType = "MyFormType"

creationPackage.ObjectType = "MyUDOCode" 'UDO Object code

creationPackage.UniqueID = "MyFormUID"

oForm = SBO_Application.Forms.AddEx(creationPackage)

Former Member
0 Kudos

Now I'm trying this,

Dim creationPackage As SAPbouiCOM.FormCreationParams

creationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)

creationPackage.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed

creationPackage.FormType = "2000000000"

creationPackage.ObjectType = "Area" 'UDO Object code

creationPackage.uniqueID = "Area"

creationPackage.XmlData = oXMLDoc.xml

oForm = SBO_Application.Forms.AddEx(creationPackage)

But I've got the same error.

The Area is the Code of my UDO object. This information is got from debugger infromation Form = Area.

The UDO object is already created through the SBO Wizard.

The FormType is from ScreenPainter property (is doesn't let change it...is always 2000000000 or I don't know how to do it)

The UniqueID is from ScreenPainter property as well.

Perhaps I'm doing something wrong with these properties.

Regards.

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

The UniqueUID property is the unique UID of your form, try to change it and use something different than the code of your UDO object (do it in the code and in the ScreenPainter properties of the form).

I don't see anything different from my sample that works properly.

Trinidad.

Former Member
0 Kudos

I've tried you suggested and got same error.

I don't know is there's missing some definition or something likew that....is there anything else I can try?? Other way??

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

I will sugest to create a simple form (with only one edit text or something) with the code (not using xml) and try to asign the UDO object to this form. Then see if everything is ok.

After that you can save your form in an xml file and reload it into a FormCreationPackage object.

If this two steps work then create the same simple form usign ScreenPainter and test it one more time.

Compare xml files of the differents ways and try to find the problem.

In the code I cannot find anything wrong.

Answers (1)

Answers (1)

Former Member
0 Kudos

It closes the aplicacion of SBO and you execute it again.

The error itself due to that you execute your application go, creates the Form , and after , error gives you.

The form is created but there is not visible.

I also Trying to create a Form from an object UDO.