Skip to Content
0
Former Member
Sep 05, 2013 at 06:49 AM

Add new column in grid

359 Views

Hi all,

I have given a query in a grid where it has to fetch the values from the other table in a condition where the STATUS is given as YES alone,

it is fetching properly but the grid is a editable and after fetching the data from the table when i change the values in the grid it is not getting updated in my form.

How to solve this issue????

Help me solving this issue.

Following is my code,

Sub HRGrid()

Dim ocomboColumn As SAPbouiCOM.ComboBoxColumn

Dim oGrid As SAPbouiCOM.Grid

oGrid = objForm.Items.Item("grid1").Specific

objForm.DataSources.DataTables.Add("DT_0")

objForm.DataSources.DataTables.Item(0).ExecuteQuery("SELECT T0.[U_refID], T0.[U_canName], T0.[U_canMail], T0.[U_contact], T0.[U_refBy], T0.[U_refDate], T0.[U_resume], T0.[U_status] FROM [dbo].[@EAHCM_JBP2] T0, [dbo].[@EAHCM_JBP] T1 WHERE T0.[U_status] ='Yes' AND T0.[DocEntry]=T1.[DocEntry] AND T1.[U_reqNo]='" & objMain.JobPost.req & "' AND T1.[U_postNo]='" & objMain.JobPost.post & "' ")

oGrid.DataTable = objForm.DataSources.DataTables.Item("DT_0")

oGrid.Columns.Item("U_refID").TitleObject.Caption = "Referral Id"

oGrid.Columns.Item("U_refID").Visible = True

oGrid.Columns.Item("U_refID").Editable = False

oGrid.Columns.Item("U_canName").TitleObject.Caption = "Candidate Name"

oGrid.Columns.Item("U_canName").Visible = True

oGrid.Columns.Item("U_canName").Editable = False

oGrid.Columns.Item("U_canMail").TitleObject.Caption = "Candidate Mail"

oGrid.Columns.Item("U_canMail").Visible = True

oGrid.Columns.Item("U_canMail").Editable = False

oGrid.Columns.Item("U_contact").TitleObject.Caption = "Contact Number"

oGrid.Columns.Item("U_contact").Visible = True

oGrid.Columns.Item("U_contact").Editable = False

oGrid.Columns.Item("U_refBy").TitleObject.Caption = "Referred By"

oGrid.Columns.Item("U_refBy").Visible = True

oGrid.Columns.Item("U_refBy").Editable = False

oGrid.Columns.Item("U_refDate").TitleObject.Caption = "Date"

oGrid.Columns.Item("U_refDate").Visible = True

oGrid.Columns.Item("U_refDate").Editable = False

oGrid.Columns.Item("U_resume").TitleObject.Caption = "Resume"

oGrid.Columns.Item("U_resume").Visible = True

oGrid.Columns.Item("U_resume").Editable = False

oGrid.Columns.Item("U_status").Visible = False

oGrid.Columns.Item("U_status").Type = SAPbouiCOM.BoGridColumnType.gct_ComboBox

ocomboColumn = oGrid.Columns.Item("U_status")

ocomboColumn.ValidValues.Add("Selected", "SL")

ocomboColumn.ValidValues.Add("Waitinglist", "WL")

ocomboColumn.ValidValues.Add("Rejected", "RJ")

ocomboColumn.DisplayType = SAPbouiCOM.BoComboDisplayType.cdt_Value

oGrid.Columns.Item("U_status").TitleObject.Caption = "Status"

oGrid.Columns.Item("U_status").Visible = True

oGrid.Columns.Item("U_status").Editable = True

oGrid.AutoResizeColumns()

End Sub