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

System Message ( FormType=0) how do I know what called this form

I have a routine that messages salesorder owners when a goods receipt comes in that can satisfy outstanding backorders.

I currently trigger this from the 'Add' button in a goods receipt PO. All works fine provided that the user alway says yes to the SystemMessage 'You Cannot Change this document after it has been added. Continue?' if user says no the message gets Sent anyway...

I can trap the OK click on formtype '0' but I dont know how to tell if this particular system message was Launched by clicking the 'Add' Button on the GoodsReceipt PO form. I dont want to disable the system message but want to kick off the checkbackorders routine on 'OK' event in Sysform IF the sysform belongs to the Goods Receipt form...

Any pointers anyone 😊

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2005 at 08:40 AM

    Hi there,

    Try using this code?

    A message will generate upon successfully Goods Receipt PO generated. You can overwrite the message and put your procedure inside.

    If pVal.FormType = 143 Then

    oTmpForm = SBO_Application.Forms.Item(FormUID)

    If oTmpForm.Mode =

    SAPbouiCOM.BoFormMode.fm_ADD_MODE Then

    If pVal.EventType =

    SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED Then

    If pVal.ItemUID = 1 Then

    If pVal.ActionSuccess = True Then

    SBO_Application.MessageBox("AFTER ADD SO")

    End If

    End If

    End If

    End If

    End If

    Hope this help...

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks for the Reply Erik. Unfortunately when this event occurs it blanks out the contents of the form. which I use to do subsequent lookups.

      what I ended up doing was

      Case "143" 'The Goods Receipts PO Form
                          Select Case pVal.ItemUID
                              Case "1" 'The Add button
                                  Select Case pVal.EventType
                                      Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
                                          callingform = pVal.FormType
                                          callingformuid = pVal.FormUID
                                          'Set some global vars to tell me that the 
                                          'subsequent System Message was launched from the Goods Receipt PO form
                                  End Select

      i.e. when the OK button is pressed I populate some globals with some pointers

      then on the system form

      Case "0" 'System form
                          If callingform = "143" Then
                              callingform = ""
                              Select Case pVal.ItemUID
                                  Case "1" 'the OK button
                                      oform = sboapp.Forms.Item(callingformuid)
                                      'do my routines

      if the calling form was the Good receipt PO then grab it (b4 values are cleared) and do my stuff

      nb dont forget to clear the global vars...

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.