cancel
Showing results for 
Search instead for 
Did you mean: 

3 fields choosing problem from ChooseFromList

Former Member
0 Kudos

Hello,

I've made a UDO form where 3 fields are taken one after other.

Sales Order No.

Sales Order Date

Customer Name

User will press TAB button on the Sales Order No. field.And he will choose the order from ChooseFromList Window .I can do this.

When the user will choose Order no. ; Sales Order Date and Customer Name

value of that particular order will fill up their corresponding fields.

But the problem is ---my program getting all data Sales Order No. ,

Sales Order Date , Customer Name and showing all data

except Sales Order Date

.

Part of my code for this work as follows--

If oCFLEvento.BeforeAction = False Then

Dim oDataTable As SAPbouiCOM.DataTable

oDataTable = oCFLEvento.SelectedObjects

Dim val, val1, val2 As String

Try

val1 = oDataTable.GetValue(10, 0)

val2 = oDataTable.GetValue(13, 0)

val = oDataTable.GetValue(0, 0)

' 'SBO_Application.MessageBox(val)

' 'SBO_Application.MessageBox(val1)

' 'SBO_Application.MessageBox(val2)

Catch ex As Exception

End Try

If (pVal.ItemUID = "OrVal") Or (pVal.ItemUID = "Button1") Then

oEdittext = oForm.Items.Item("CustVal").Specific()

oEdittext.String = val2

oEdittext = oForm.Items.Item("OrdtVal").Specific()

oEdittext.String = val1

oEdittext = oForm.Items.Item("OrVal").Specific()

oEdittext.String = val

End If

End If

Rgds

Subrata

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Subrata,

Can u tell me which variable is date u specifiy??

Regards,

Anitha

Former Member
0 Kudos

val is keeping Sales Order No.

val1 is keeping Sales Order Date

val2 is keeping Customer name of Sales Order.

CustVal is the name of Customer EditText Box [Related field in Table U_customer , nvarchar(30) ]

OrdtVal is the name of Order Date EditText Box [Related field in Table U_ordrdt , datetime]

OrVal is the name of Order No. EditText Box [Related field in Table U_ordrno

, nvarchar(20)]

Former Member
0 Kudos

Subrata,

U have assign the Val2 as string. This is date value but u assign as string so what to do is dont assign the value u directly mention the value like below

HEAD_oDBds.SetValue("U_PoDate", 0, CDate(oDT.GetValue("DocDate", 0)).ToString("yyyyMMdd"))

If any doubt ask me...

If its helps give reward points,

Regards,

Anitha

Former Member
0 Kudos

Now I've changed the line to

Dim val1 as string

val1 = oDataTable.GetValue("DocDate", 0).ToString("yyyyMMdd")

oEdittext = oForm.Items.Item("OrdtVal").Specific()

oEdittext.Value = val1

But, still it not showing date on the Date EditText Box.

Former Member
0 Kudos

U dont asign i told

remove the line

'Dim val1 as string'

and have

oForm.Items.Item("OrdtVal").Specific.Value=DataTable.GetValue("DocDate", 0).ToString("yyyyMMdd")

It will work

Regards,

Anitha

Former Member
0 Kudos

Still have the problem.

Whereas for Order No. & Customer name ,I don't have problem.

Former Member
0 Kudos

Subrata,

U write the the below code in Choosefromlist itemevent

If oCFL.UniqueID = "POCFL" Or oCFL.UniqueID = "POCFL1" Then

Try

HEAD_oDBds.SetValue("U_PNo", 0, oDT.GetValue("DocNum", 0))

HEAD_oDBds.SetValue("U_PoDate", 0, CDate(oDT.GetValue("DocDate", 0)).ToString("yyyyMMdd"))

HEAD_oDBds.SetValue("U_Curr", 0, oDT.GetValue("DocCur", 0))

Me.LoadCFL(oDT.GetValue("DocNum", 0))

Catch ex As Exception

'app.MessageBox(ex.Message)

End Try

Here instead of PO fields u refer SO fields....

Regards,

Anitha

Former Member
0 Kudos

I didn't get you.

Will this code show me the datevalue in the edittext box?

It's setting the value with table field?

Would I not have to mention the EditText Box name?

Where will I write it--- in the itemevent?

Rgds

Subrata

Former Member
0 Kudos

Subrata,

Else u try this

frm.items.item("Textboxname").Specific.Value=CDate(oDT.GetValue("DocDate", 0)).ToString("yyyyMMdd"))

Regards,

Anitha

Former Member
0 Kudos

Thanks

Answers (0)