Skip to Content
author's profile photo Former Member
Former Member

Click Event Question - VB6 SDK 6.5

A quick question for you guys:

On the A/R Invoice form, I have a UDF that exists as a combo box. I can trap the et_COMBO_SELECT event on that combo box just fine, however, I would like to generate a click event on the 'Name' field on the main form from the UDF et_COMBO_SELECT event. The problem I'm running into is that because the form that contains the UDF has a different UID from the actual A/R Invoice main form, I get an error when I try to perform the click event on the 'Name' field. The code I'm using is below. Any help would be appreciated.

Thanks,

Greg

'(A/R Invoice) Change value of eqp_DivisionCode global variable when combo select event triggers

If eqp_pVal.FormType = -133 And eqp_pVal.FormMode = fm_ADD_MODE And _

eqp_pVal.ItemUID = "U_Division" And eqp_pVal.EventType = et_COMBO_SELECT Then

Set eqp_frm = SBO_Application.Forms.Item(FormUID)

Set eqp_cmbDivision = eqp_frm.Items("U_Division").Specific

eqp_DivisionCode = eqp_cmbDivision.Selected.Value

End If

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2004 at 07:32 AM

    Hi Greg,

    if you want to access a User Defined Field on a System Form but in header level you need to approach it as follows:

    If (pVal.EventType = et_FORM_LOAD And pVal.FormType = 139 And _

    pVal.Before_Action = True) Then

    Set oform = m_App.Forms.Item(FormUID)

    Dim oUsrForm As SAPbouiCOM.Form

    Dim num As Long

    Dim UDFformUID As String

    num = Right(FormUID, (Len(FormUID) - 2))

    num = num + 1

    UDFformUID = "F_" & num

    Set oform = m_App.Forms.Item(UDFformUID)

    oform.Items.Item("U_1").Specific.String = "Test"

    End If

    Regards,

    Lisa Mulchinock

    SAP SDK Consultant

    Galway

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks very much for your response. My issue is resolved.

      I was actually trying to go the other way around, meaning I wanted to access a system form from a UDF. Using the formula for the formUID you gave me I was able to do it. For those that may run into the same problem, the code would look something like this:

      If (pVal.EventType = et_FORM_LOAD And pVal.FormType = -139 And _

      pVal.Before_Action = True) Then

      Set oform = m_App.Forms.Item(FormUID)

      Dim oUsrForm As SAPbouiCOM.Form

      Dim num As Long

      Dim SYSformUID As String

      num = Right(FormUID, (Len(FormUID) - 2))

      num = num - 1

      SYSformUID = "F_" & num

      Set oform = m_App.Forms.Item(SYSformUID)

      oform.Items.Item("54").Specific.String = "Test"

      End If

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.