cancel
Showing results for 
Search instead for 
Did you mean: 

Employee Code Value

Former Member
0 Kudos

hi

  As i move from 1 record to another i want to display Employee ID value in a message box.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

edy_simon
Active Contributor
0 Kudos

Hi Sunny,

The best to do this is you catch the After Form Data Load event.

In this event, the screen is already populated with the data, so you can easily get the value from the Edit Text of ItemUID 33.

Do note that Form Data event has its own event handler method. Not the same as Item Event.

This event falls under this method :

    Private Sub SBO_Application_FormDataEvent(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean) Handles SBO_Application.FormDataEvent

          'Your codes here

    End Sub

The logic is:

1. Catch After Form Data Load event.

2. Get the Edit Text of Item UID '33'

3. Get the value of this edittext and pop up the message box.

Try it out, if you have any problem let us know.

Regards

Edy

Former Member
0 Kudos

Hai,

      you try this,

         In Item Event

 

Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD

      

 

If BusinessObjectInfo.BeforeAction = False then

       msgbox  (form.items.item("33").specific.value.tostring())

endif

Regards,

K Sakthivel


     

Former Member
0 Kudos

Hi Edy

     I have written this , it displays first message but it is not going in If condition

Private Sub SBO_Application_FormDataEvent(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean) Handles SBO_Application.FormDataEvent

        SBO_Application.MessageBox("in")

        If ((BusinessObjectInfo.FormTypeEx = "60100" And BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD) And (BusinessObjectInfo.Before_Action = True)) Then

            oForm = Me.SBO_Application.Forms.GetForm(BusinessObjectInfo.FormType, BusinessObjectInfo.FormTypeCount)

            SBO_Application.MessageBox(oForm.Items.Item("33").Specific.value.ToString())

            SBO_Application.MessageBox("in")

     endif

end sub

Thanks

edy_simon
Active Contributor
0 Kudos

Hi Sunny,

You missed a few things.

1. BusinessObjectInfo does not have BusinessObjectInfo.Before_Action property. Instead, use BusinessObjectInfo.BeforeAction.

2. You should catch it on BeforeAction = False.

3. BusinessObjectInfo does not have BusinessObjectInfo.FormTypeCount property. use this line instead :

     oForm =  Me.SBO_Application.Forms.Item(BusinessObjectInfo.FormUID)

The rest should be okay.

This is the complete code :

    Private Sub SBO_Application_FormDataEvent(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean) Handles SBO_Application.FormDataEvent

        SBO_Application.MessageBox("in")

        If ((BusinessObjectInfo.FormTypeEx = "60100" And BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD) And (BusinessObjectInfo.BeforeAction = False)) Then

            Dim oForm As SAPbouiCOM.Form = Me.SBO_Application.Forms.Item(BusinessObjectInfo.FormUID)

            SBO_Application.MessageBox(oForm.Items.Item("33").Specific.value.ToString())

            SBO_Application.MessageBox("in")

        End If

    End Sub

Regards

Edy

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sunny,

     Can you post your code please?

Regards,