Skip to Content
avatar image
Former Member

UI: Updating user-defined fields

Hi all,

i want to update user-defined field in the form from my add-on. For example, an 'order' form has formType = 139 and order's user-defined form has formType = -139,

and my code doesn't work:

Dim frm As SAPBouiCom.Form

Set frm = appl.Forms(-139)

frm.Items("u_Cat").Specific.String = "Category1"

u_Cat is my user-defined field'name

Can anyone help?

Regards

Libor Mego.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Apr 21, 2004 at 05:48 AM

    Hi Libor

    I fear your code line

    > Set frm = appl.Forms(-139)

    doesn't work. As far as I know you have to creat a reference to a uiForms by one of these ways:

    > Set uiFrm = appl.Forms.Item([FormUID As String])

    or

    > Set uiFrm = appl.Forms.GetFormByTypeAndCount(-139, [Index as Long])

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 21, 2004 at 07:17 AM

    Hi Res,

    now it works, better solution is

    set frm = appl.Forms.GetFormByTypeAndCount(-139, [Index as Long])

    Many Thank's.

    Libor.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 07, 2004 at 03:04 PM

    Hi, I am having the exact same problem with form -139 and am not able to get it to work using the solution described in the discussion. I get an error message saying "Form - Invalid". Any help is appreciated.

    Note: I am using VB.NET

    Thank You,

    Gopal

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 07, 2004 at 03:09 PM

    Just to make my question clearer, what does the [Index as Long] stand for. What do I sustitute instead of that.

    set frm = appl.Forms.GetFormByTypeAndCount(-139, [Index as Long])

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 18, 2004 at 01:48 PM

    Hi Libor,

    I had similar problem with Form -139.

    The solution is to go through all open forms.

    I am using VB 6.0.

    Try this:

    For Index = 0 To SBO_Application.Forms.Count - 1

    If SBO_Application.Forms.Item(Index).Type = -139 Then

    Set frm = SBO_Application.Forms.Item(Index)

    AutoTransfer = frm.Items("U_AutoTran").Specific.Selected.Value

    End If

    Next Index

    Regards,

    Iwona

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      This method is good, but it doesn't distinguish between different instances of the same form (-139).

      In the following scenario, I cannot find any way to associate the UDF form with the system form.

      Open one order form with no UDF form showing.

      Open a second order form with no UDF form.

      Show the UDF form for the second order form.

      Show the UDF form for the first order form.

      I end up with

      Order form 1: Type 139, TypeCount 1, UID F_28

      Order form 2: Type 139, TypeCount 2, UID F_29

      UDF Form for 2: Type -139, TypeCount 1, UID F_30

      UDF Form for 1: Type -139, TypeCount 2, UID F_31

      Neither the form uids nor the frm.TypeCount tie the right two forms together.

      Has anyone solved this?

      Thank you,

      Bruce