cancel
Showing results for 
Search instead for 
Did you mean: 

Save Data to UDO Problem

Former Member
0 Kudos

Hi. I created a new form in the screen painter

and set the auto managed property to true

when saving the document to the database, only the fields created by the system (DocEntry, DocNum, Period.. etc)

are the fields that inserted to the table.

How can i save data to the other user defined field like (U_RequestedByID, U_DepartmentID)?

I tried binding the fields and it works just fine

but the problem is if the object(EditText/Matrix) is binded to the table where i want to save them, the EditText/Matrix doesn't shows the value that came from choose from list

tnx in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Robert,

If you are not geeting saved values means, bind through coding(For specified fields) on SRF Loading, i used the same scenario, i gave automanged = false only.

OItem = oForm.Items.Item("UId") '// Edit text UId on SRF

oEdit = OItem.Specific

oEdit.DataBind.SetBound(True, "UDT name", "U_RequestedByID,")

oEdit.ChooseFromListUID = "CFL id"

oEdit.ChooseFromListAlias = "Alias name"

and give the Correct Object type , Multiselection,Unique id in SRF CFL Fields. Surely you will get values...

regards,

Ganesh K

Answers (4)

Answers (4)

Former Member
0 Kudos

hi ganesh

tnx for your reply.

i have already tried to do this option but in the line

oEdit.DataBind.SetBound(True, "@GC_OPRQ", "U_RequestedByEmpID")

i have an error says that the table not found. when i removed the @ sign

i have an error that says that table must be bound in an alphanumeric table...

i guess this is only applicable to system tables..

regards,

robert

Former Member
0 Kudos

Hi,

try [] around the tablename

Former Member
0 Kudos

hi Ganesh

probably the reason why the values doesn't show is because im trying to bind userdatasources to choosefromlist object and at the same binding it to an edittext

can there be a way that a variable be bind to a userdatasources? or how can i set value to a user data source such that

my table "@GC_OPRQ" with a field "U_RequestedByEmpID"

could have a value?

regards

robert

Former Member
0 Kudos

Hi Robert,

my table "@GC_OPRQ" with a field "U_RequestedByEmpID"

that is not a problem. you can use userdatasource also For CFL.

i will give some sample Flow. you can try this After Loading yor Form.

LoadFromXML("name.srf")

oForm = oApplication.Forms.ActiveForm

oForm.DataSources.DBDataSources.Add(""@GC_OPRQ")

Dim oCFLs As SAPbouiCOM.ChooseFromListCollection

Dim oCons As SAPbouiCOM.Conditions

Dim oCon As SAPbouiCOM.Condition

oCFLs = oForm.ChooseFromLists

Dim oCFL As SAPbouiCOM.ChooseFromList

Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams

oCFLCreationParams = oApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)

oCFLCreationParams.MultiSelection = False

oCFLCreationParams.ObjectType = "Your UDO Name"

oCFLCreationParams.UniqueID = "Your CFL Name"

oCFL = oCFLs.Add(oCFLCreationParams)

'// Adding Condition If any need

' // Adding Conditions to CFL1

oCons = oCFL.GetConditions()

oCon = oCons.Add()

oCon.Alias = "alias Name"

oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

oCon.CondVal = "Condition value"

oCFL.SetConditions(oCons)

'// End

OItem = oForm.Items.Item("Edit txt Uid")

oEdit = OItem.Specific

oEdit.DataBind.SetBound(True, "@GC_OPRQ", "U_RequestedByEmpID")

oEdit.ChooseFromListUID = "CFL id For Edit txt" '//given in srf

oEdit.ChooseFromListAlias = "Alias name" ''//

in Item Event:

If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then

Try

Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent

oCFLEvento = pVal

Dim sCFL_ID As String

sCFL_ID = oCFLEvento.ChooseFromListUID

Dim oForm As SAPbouiCOM.Form

oForm = oApplication.Forms.Item(FormUID)

Dim oCFL As SAPbouiCOM.ChooseFromList

oCFL = oForm.ChooseFromLists.Item(sCFL_ID)

If oCFLEvento.BeforeAction = False Then

Dim oDataTable As SAPbouiCOM.DataTable

oDataTable = oCFLEvento.SelectedObjects

If (pVal.ItemUID = "edit txt id") Then

oForm.DataSources.DBDataSources.Item("@GC_OPRQ").SetValue("U_RequestedByEmpID", 0, oCFLEvento.SelectedObjects.GetValue("Columnuid From CFL", 0))

End If

End If

Dont Forget to bind your objectype (oCFLCreationParams.ObjectType = "Your UDO Name" )

regards,

Ganesh K

Former Member
0 Kudos

hi Raghu Ram

what do you mean matching the objecttype?

regards

robert

Former Member
0 Kudos

Have you matched the objectcode property in XML to the UDO code of your form.It will be next to the Automanaged property in XML.

Regards

Raghu