cancel
Showing results for 
Search instead for 
Did you mean: 

how to pass data from subform to my main form

Former Member
0 Kudos

hi everyone....

i have a user form. where for one editbox (uid 9) i am feeding data from one more form (sub form) which i have designed by taking a grid and 2 buttons(ok and cancel) and in that grid iam getting data from DB by writing simple query......

now in my user form when i click on tab on my editbox(i.e uid 9) my subform is opening with data in grid...

i want to select data from that grid onto my editbox.....how will i get this .....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sultana (raj),

capture the item event of the grid form when you press the ok button, take a variable store the selected value into this and pass this value to the edittext box.

it will work.

regards

shiva

Answers (2)

Answers (2)

Former Member
0 Kudos

catch the event of click of your grid, so

declare a form variable and get your other form, something like this

SUBFORM


         Form oForm = B1Connections.theAppl.Forms.GetForm("FORM TYPE", 0);      
         EditText oEdit;
         oEdit = (EditText)oForm.Items.Item("EDIT TEXT").Specific;
         oEdit.Value = "value "

Former Member
0 Kudos

Hi

-


>> this is the code for assigning data to the grid datatable

Dim oGrid As SAPbouiCOM.Grid

oGrid = Me.m_SBO_Form.Items.Item(enControlName.Grid).Specific

oGrid.DataTable = Me.m_SBO_Form.DataSources.DataTables.Item("TEMPDATA")

-


>> Below is the event where you can get the values from grid to a variable

Case SAPbouiCOM.BoEventTypes.et_DOUBLE_CLICK

Dim itmcode As String = oGrid.DataTable.GetValue(0, pval.row)

-


>> This code is for transferring the value from variable to your main form...

form.Items.Item("7").Specific.value = itmcode

Hope it helps

Thanks