on 09-11-2008 10:13 AM
Hi, all!
I need to know that a sales order document will become an order draft before it is created. Is there a way to detect that before SAP shows the draft remarks window (Form=50106).
This window pops up after FORM_DATA_ADD event for the sales order is sent (BeforeAction property equals True), but before the FORM_DATA_ADD event for the draft itself (BeforeAction property again equals True) is sent at which point it would be too late for me.
I'm working on SAP B1 2005 PL45.
Regards, Yavor
HI,
Sorry, this is for when you creating and order from a draft.....
OK. Use SP_TransactionNotification to determine draft has been created from your order....
Regards,
J.
Edited by: Janos Nagy on Sep 11, 2008 11:45 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David!
I suppose I didn't explain it right.
The way it works on my PC is this:
1. I log in SAP B1 and open "Sales - A/R" tab.
2. I click on "Sales Order" option to create a new sales order
3. A "Sales Order" window shows that allows me to enter the details of the order I want to create.
4. I have an inventory item called "testItem", its price is $3.00. There is also a BP called "testBP". I select "testBP" as the customer and add one line in the order lines grid for that "testItem" setting the item quantity to 200 which makes an order total roughly $600.00 (no discount, there is some tax and shipping cost, but that's not important now).
NOTE: I have previously defined an Approval template (Modules/Administration/Approval Procedures/Approval Templates) that covers sales orders only and the only term set there is "Total Document" with ratio "Greater than" and value $500.00. There is one user assigned as originator and that's the one I logged in SAP B1 with.
6. I press "Add" button on the sales order form to create the sales order. Since the approval rule state that order will not be allowed directly if its total is more than $500.00 a window pops up that says "Generating this document requires the authorization of other users. In the table below, type remarks that are relevant for the authorizor and Click OK".
7. If I click OK a draft is created instead of a sales order. If I click Cancel the process stops and no document is created.
I have an addon that should perform certain operations should the document be an order, but should do nothing if the document turns out to be a draft. These operation should be performed before the order document is created, not after that.
To do that I try to use et_FORM_DATA_ADD event when BeforeAction=true and the event relates to the sales order to create. The problem is that I get this event before the popup window from 6. shows up and at that moment I have no way of knowing whether the document will become a draft or a sales order.
Is it possible to evaluate this situation the first time I get et_FORM_DATA_ADD event - I suppose trying to read the tables related to approval procedures might do the trick, but is there a API method to use instead?
Regards, Yavor
Hi Vasu!
Yes that's the way that might help me though it means I'll have to somehow rollback the specific operations I mentioned before(As I explained in my previous posts these are performed in the FORM_DATA_ADD event being fired before this popup window shows).
I was hoping there is some API method I don't know of that could evaluate the form's details and say if it would be a draft or the real document. Using approval tables doesn't seem like a good idea though.
Regards
Sorry i did not understand,
Can u plz explain a bit more..??
Vasu Natari.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
I try to create a sales order in SAP B1 application. Due to approval rules the order becomes a draft.
I'm writing an addon and I need to perform specific operations on a sales order before it is created but I should not perform these operations should the sales order become an order draft. To do that I try to hook at FORM_DATA_ADD event when the BeforeAction flag is set to true, but at that point it seem impossible. The reason is that I get two FORM_DATA_ADD events with BeforeAction flag set to true for the order followed by one FORM_DATA_ADD with BeforeAction flag set to true for the actual draft.
Is there a way to determine at the first FORM_DATA_ADD event with BeforeAction flag set to true that a draft will be created and not the actual order?
10x, Yavor
Edited by: Yavor Naumov on Sep 11, 2008 11:55 AM
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
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.