Modal forms
SeKo
Hi everybody,I would like to have a form popup when the Item Master Data form opens. The popup should be modal, so the OITM form should not be selectable.
What is the best way to do is?
Thanks!!
Paolo Manfrin
Hi SeKo,Do you have to show just a messageBox?
If yes the best option is to create a customize optimizer rule at FormLoad which show a messagebox MessageBox.Show("My message", "OK").
hth,
paolo
SeKo
Hi Paolo,no, I would need to show an entire form, with a lot of fields.. Is something like this possible?
Grtz,
Sebastiaan
Paolo Manfrin
Hi Sebastian,unfortunatly there is no such property in the standard SAP form. You have to implement with a workaround.
One possibility is to create a field (called "Modal") on any form that you want to be modal with a top and a left = -20 (so it does not appear on the form).
add the following code to the ItemEvent handler:
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DEACTIVATE Then
Try
oForm.Items.Item("Modal").Click()
oForm.Select()
oForm.Items.Item("Modal").Click()
Catch ex As Exception When Err.Number = -7001
Catch ex As Exception
oApp.MessageBox(Err.Number.ToString + " " + Err.Description)
End Try
End If
so the user has to click on a specific button in order to close the form.
On the SAP Forum community you find different workarounds in order to overcome this missing functionality.
hth,
paolo
SeKo
Thanks for the quick answer Paolo. I can implement this method.The other problem I have now is that the form is shown behind the OITM form. On the FormLoad event of form 150 (did not select BeforeEvent), I create a new form and load that one also. It shows the new form behind the old one. I do a form.Select() but that doesn't seem to work.
try{
Form frm = pVal.Form;
Form overview = Form.CreateNewForm("OITMOverview","ORD_OITM");
overview.Left = frm.Left;
overview.Top = frm.Top;
overview.Width = frm.Width;
overview.Height = frm.Height;
overview.Value = "Item Overview";
overview.Load();
overview.Select();
}
catch(Exception ex){
MessageBox.Show(ex.ToString(), "OK");
}
return true;
Paolo Manfrin
Hi,try with a different event. e.g. GotFocus.
You can use the event log of customizeto decide which is the best event to listen in order to show up your form.
hth
paolo
0
Please sign in to leave a comment.
Comments
0 comments