cancel
Showing results for 
Search instead for 
Did you mean: 

once form is updated successfully....i need to close the form

Former Member
0 Kudos

hi,

i am facing one problem

i am having two forms(customizaiotn)

i just open the first form..

then

i am opening the second form just by double click on the sno

then

second form will be open.

i am doing calculation...at second form

second form is all ready added previously.. some where..

so, in this scenario i am just opening the second form

so, if i do any changes in second form , form mode will be changes to update mode.

now

what i need is

when ever the from(second form ) is updated success fully  i need to copy paste some values into first form...

below code is helping

but what i need is.

once the value is saved on first form...

the second form will be close.

if i close the form.

it is telling  do u want to save or not

means forms is still updating

but i need after update...

Any information plz update me..

        Try

            Select Case BusinessObjectInfo.EventType

                Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_UPDATE

                    If BusinessObjectInfo.FormUID = "ROA" Then

                        If BusinessObjectInfo.ActionSuccess = True Then

                            If BusinessObjectInfo.BeforeAction = False Then

                                '  If flagcount = 0 Then

                                oForm = SBO_Application.Forms.Item("ROA")

                                'SBO_Application.MessageBox(Grand_total_roa)

                                SBO_Application.Forms.Item("BOQ").Select()

                                OFORM33 = SBO_Application.Forms.Item("BOQ")

                                Dim omat_boq As SAPbouiCOM.Matrix

                                omat_boq = OFORM33.Items.Item("9").Specific

                                For uuu As Integer = 1 To omat_boq.VisualRowCount

                                    If omat_boq.IsRowSelected(uuu) = True Then

                                        omat_boq.Columns.Item("V_3").Cells.Item(uuu).Specific.value = Grand_total_roa

                                        Exit For

                                    End If

                                Next

                                SBO_Application.Forms.Item("ROA").Select()

                                'oForm.Items.Item("1").Click(SAPbouiCOM.BoCellClickType.ct_Regular)

                                'oForm.Close()

                                ' flagcount = 1

                            End If

                        End If

                    End If

                    'End If

            End Select

        Catch ex As Exception

            SBO_Application.MessageBox(ex.Message)

        End Try

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi.

the below code i used working good.

i hope it will give any problem...

Try

            If (pVal.FormUID = "ROA" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.BeforeAction = False And pVal.ItemUID = "1" And pVal.ActionSuccess = True) Then

                oForm = SBO_Application.Forms.Item("ROA")

                oForm = SBO_Application.Forms.ActiveForm()

                If oForm.Title = "Rate Of Analysis" Then

                Else

                    OFORM3 = SBO_Application.Forms.Item("ROA")

                    OFORM3.Close()

                End If

            End If

        Catch ex As Exception

            SBO_Application.MessageBox(ex.Message)

        End Try

AdKerremans
Active Contributor
0 Kudos

Hi,

just change the form mode to ok_mode just bevore closing the form.

Regards

Ad

Former Member
0 Kudos

i will try...

thanks for your  fast reply.

but i am having one doubt.

whether form is going to update or not..

i mean it is updating ..while updating i am changing to ok mode.

i will try..

edy_simon
Active Contributor
0 Kudos

Hi Srinivas,

Is the 2nd form a UDO form ?

If it is not, can you set the form automanaged = false ?

Regards
Edy

Former Member
0 Kudos

hi.

Mr Edy..

2nd form is udo form...

Former Member
0 Kudos

hi

i used your code not

working

getting errorr.

If oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE Then

     oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE

----------------------------------------

-----------------------------------------

hi any information plz update me

i need to clse the form ... immediately..

Former Member
0 Kudos

Have you considered updating your UDO records using the GeneralService objects instead?

This thread might help: