Skip to Content
avatar image
Former Member

Form Mode validation

Hi ,

created Add-on Form using screen painter. in form update mode i want to make my document no fleld(user defined) to be non-editable(enabled=fasle) like normal SAP screens.i used the following code for that.

Select Case pVal.FormUID

case "FormId"

Select Case pVal.Before_Action

case "true"

If pVal.FormMode = "2" Then

OForm = sbo_application.Forms.Item("Frmuid")

OForm.Items.Item("Doc_No").Enabled = False

End If

End Select

End Select

its working fine. but the event will trigger again and again until change in form mode.

i want to eliminate execution of statement once the docnumber field is set to Enabled = False in update mode.where i can add my code exactly?

regards,

Ganesh kl

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Oct 13, 2008 at 12:18 PM

    Try this...

    Select Case pVal.FormUID
    case "FormId"
    Select Case pVal.Before_Action
    case "true"
    If pVal.FormMode = "2" Then
    OForm = sbo_application.Forms.Item("Frmuid")
    If OForm.Items.Item("Doc_No").Enabled = True Then
    OForm.Items.Item("Doc_No").Enabled = False
    End If
    End If
    End Select
    End Select

    Hope it helps

    Vasu Natari.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi vasu,

      in your coding also for every item event of my form the following code will execute in update mode..

      If pVal.FormMode = "2" Then

      OForm = sbo_application.Forms.Item("Frmuid")

      If OForm.Items.Item("Doc_No").Enabled = True Then

      i thought of doing pVal.FormMode = "2" checking only once for every individual form until it closed.To avoid mulitiple time execution of above coding for other validations of my form also.

      regards

      ganesh k

  • avatar image
    Former Member
    Oct 14, 2008 at 04:09 AM

    Hi...

    u want to avoid the repeated loop use this one

    pVal.InnerEvent = False

    Regards...

    Billa 2007

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 14, 2008 at 11:14 AM

    hi

    in the screen painter it self use editable=false for item which u want.

    in the menu event for add menuUID and while form loading make item editable=true

    and for the menus find,first record,last record,next record,previous record use editable=false

    1.while opening the form if u r opening in add mode then make item editable=true

    2. If (pVal.MenuUID = "1282") And (pVal.BeforeAction = False) Then 'Add mode

    'make item editable=true

    endif

    3. If (pVal.MenuUID = "1281") And (pVal.BeforeAction = False) Then 'Find mode

    'make item editable=false

    endif

    4.If ((pVal.MenuUID = "1288") Or (pVal.MenuUID = "1289") Or (pVal.MenuUID = "1290") Or (pVal.MenuUID = "1291")) And (pVal.BeforeAction = False) Then 'navigation mode

    'make item editable=false

    endif

    hope this helps u

    regards,

    varma

    Add comment
    10|10000 characters needed characters exceeded