on 02-09-2009 1:14 PM
Hello,
thank you very much for your effort and valuable time in advance.
I have a question concerning duplicate of documents:
When you duplicate a document and give an a different Business Partner, the system asks you by a popup wether you want to update the rows or not.
Here you can choos "Yes" or "No". My question is, how can I get this event, what the user has pressed??? Is there any chance to get this information?
Best Regards
Vural Özmen
If you want it on only one document say Sales Order, then keep a global variable (say ParentDoc), on rightclick Duplicate menu clich pass set ParentDoc=SO and check it in the Message class
in Messageclass, check it on Form ONload Event
if(ParentDoc=="SO")
{
//do your work
ParentDoc="";
}
Now it will not interfare in other Document forms.
If you want the same functionality in all documents you have to set and free the ParentDoc Variable on each form. May be there will another option, but I only know this one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the user enters directly after duplicating the documents this would work perfectly.
But the user can open for instance a sales order (SO1), duplicate this (SO2), BUT does not enter a Business Partner, but he opens a delivery note (DN1) and wants to add the DL1. At this moment the systems opens a different popup, which has than also FormType = 0.
Here we than do not know if this is a popup for duplicate or if it is a different popup, and we do not also know from which form this popup was opened.
This is a difficult problem, which we have to solve, because otherwise the duplicating of documents does work by our AddOn.
If the user enters the Busniess Partner directly after duplicating the documents this would work perfectly.
But the user can open for instance a sales order (SO1), duplicate this (SO2), BUT does not enter a Business Partner, but he opens a delivery note (DN1) and wants to add the DL1. At this moment the systems opens a different popup, which has than also FormType = 0.
Here we than do not know if this is a popup for duplicate or if it is a different popup, and we do not also know from which form this popup was opened.
This is a difficult problem, which we have to solve, because otherwise the duplicating of documents does work by our AddOn.
Hi,
Have you tried the scenario with keeping the Flag.
it should work as we keep the flag only on rightclick duplicate menu click event.
also pass the form id to this global falg and check it in message class.
As u ll also pass the Form ID to the flag, u can also keep track of on which form duplicate menu has been clicked
Dear Anuj,
with the scenario which you haave described, you can only differ between different documents. That means you can differ between e.g. if the duplicate menu event was clicked in a sales order or in a delivery note, thats ok. BUT how do you know when the user has opened a delivery and the message class is not for duplicate but a different message? Form 0 is not only used for duplicate message. It is a general message form which is used for different messages.
Second problem is when I open a sales order and duplicate this. And than before I have finished the duplicating I open a second sales order and duplicate also this one. Than I have duplicate twice. I can store these information in a global variable (array) but I do not know when message class opens form which form the message comes then. Because I have two duplicates of two different sales orders.
Hi,
For your first paragraph, I have already wrote that you can differentiate between the Menus. Yes you are right that All Msg forms have 0 FormID, But all context menus have different IDs. So for this You can track which Menu has been clicked.
For your 2nd paragraph, I am not sure, but you can track the form instances.
Like, If 2 SO forms opened, both have different instances.
Hi Anuj,
thank you very much for your helpful answers. They helped me to get the event.
But now I have a different problem:
I have seen that this is not only aq problem by duplicating documents but by all transactions when you just change the customer. Then the system updates all rows of the matrix document.
What I want to do is I want to get the after event of this event. I want to do some procedure after the system has updated the matrix rows.
How and where can I do that?
Hi Varul,
When u perform any action in SAP validate event is fired.In this event u can track what user has pressed.
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_VALIDATE And pVal.Action_Success = True
' Here pVal.ItemUID gives the name of the control
End If
End Sub
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anuj,
thank you for your answer.
That would be a possible solution.
But the next problem is how can I know which form this popup is belonging to? Because popup can also come from an other form not only for duplicate. Or I can duplicate to different documents at the same time.
Do you have also good idea for this problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you are using SDK, you can get the whether user preesed YES or NO. Create a class for Message form(Its Form ID is 0). In the class you can get which item has been pressed by user. If yes-then Item press is 0 ,if NO-item press is 1.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.