Transaction Notification with Addon
Hi guys,
I want to be able to get a transaction notification whenever a sales order is added in SAP B1. I want to retrieve the document entry of the sales order in an Addon that uses only the DI API. I have a lot of experience in building addons, but have no experience with transaction notification. How can this be done?
Thanks,
Costas
Hi Costas
Is your customer a new one? I mean:
Pricing is only applicable to new customers with a contract date after July 15th 2013.
Take into account that in case you only want to be able to get new SO from B1 system you would probably need to buy only one license which suggested price is 750 EUR. I know it is certainly not nothing but still it is not that much.
As for your question regarding TN I'd do it like this:
use PostTransactionNotice procedure to grab a DocEntry of new SO and insert it into your own log table; you can also write a trigger on ORDR table to achieve it
create CLR procedure to do something with logged DocEntry from your table using DotNet; you probably want to be able to pass a parameter to this procedure and get some output after its execution
use a SQL job to grab only new records from your log table and execute a CLR against each one; update status in your log table; write down error, error message and so on...
If have never done any CLR before check this link to learn how easily it can be done to use regex within SQL Server:
http://www.sqllion.com/2010/12/pattern-matching-regex-in-t-sql/
Kind regards,
Radek
Similar Messages
-
Transaction Notification with DI Server
Hello
I am developing a Web Site with the DI Server, when I have validations in the Transaction Procedure the error message is incorrect.
Message: Could not commit transaction.
Transaction Notification
set @error='10'
set @error_message = 'SP: 123'
-- Select the return values
select @error, @error_message
end
I made the test with the DI - API and the message is correct.
Exists a workaround for this problem???
Thanks
Regrats
Edited by: Andres Naranjo on Sep 1, 2010 1:25 AMHello
This problem was solved in SAP Business One 8.8 PL20.
Regards -
Create PM orders/notif with inbound IDOC
Hi all,
Anyone knows how can I create a PM order and a PM notification with inbounds IDOC?. If there are not IDOC available, it´s possible create PM order and notification trhought BAPI´s?.
Thanks in advance
AbelHi Abel,
Have a look at BAPI_ALM_ORDER_MAINTAIN for PM Order and BAPI_ALM_NOTIF_CREATE for PM Notification.
You can check the BAPI's from transaction code BAPI.
Hope this helps.
Thanks
Lakshman -
How to implement notification with response against each order lines
We have a requirement wherein the multiple order lines should be displayed in one notificaiton and the response (Approve/Reject) should be line wise.
For exmple, if an order has 3 lines, the approver should get one notification with all 3 lines displayed in the notification. Approver should be able to approve say 2 lines
and reject the third line.
If reponse is not possible line wise, is it possible for including a drop down/checkbox/text against each line which would enable the approver to approve/reject the line and the approver response against each line should be captured.
How do we implement this?Hello,
we are evaluating BC4J/JClient. In our application we have a navigation tree
in a Java client from which we can call nested dialogs to set attributes,
call business logic etc.
Is it possible to open more than one sub-dialog from our starting navigation tree
at the same time? Each sub-dialog should have its own transaction context.
To our knowledge we need a new application module for each sub-dialog in order
to start a new transaction. But how is the navigation tree updated if data
from the sub-dialogs is commited? The dialogs and the navigation tree don't share
the same model, do they? The navigation tree might have to show lots of data
retrieved over a slow connection, so simply updating the entire model is not a solution.
This could work if an intelligent caching fetches only the changed data.
So: What is the best way to implement sub-dialogs with their own transaction plus an
update mechanism?To create a UI like this, see the sample on OTN at
http://otn.oracle.com/sample_code/products/jdev/jclient/jclient_binding_demo.html
YOu'd have to tweak this sample so that each sub-window comes up with it's own AM (as you've right suggested).
Regarding commit, yes, if you do not want to query the whole model on the navigator, you may use Transaction.commitAndSync() method to commit changes instead of simply performing a commit() call.
See javadoc on this method for details on how it works.
Thanks for any help! -
Approval procedure vs Transaction Notification
Hello dear experts,
I have an issue with the approval procedures and the validations I have to do using the Transaction Notificacion Stored procedure.
this is the scenario and conditions to consider:
1.A purchase order (Doctotal) that are between 0 and 25,000 USD needs an approval.
2. A purchase order needs to have all the project column filled in before the approval procedure. this column is in the detail of a document, so all the rows have to be filled in with the right project code otherwise when your request have been submmited and your receive the approval you are not allowed to do any changes in the Detail Document.
I realized that the approval procedure is launched before the Transaction Notification SP.
So I decided to add a query for the approval procedure considering the validations in the project column:
SELECT distinct 'true'
FROM OPOR
WHERE $[OPOR.DocTotalSy.number] Between 0 and 24999.99 ---This part works perfeclty!!!
AND LEN(isnull($[POR1.Project.0],''))>0 and $[POR1.U_SubJob.0]>0 ) --This part does not work
As you see in the query, I am trying to validate that all the rows have the project code (Project) and a UDF (U_SubJob) filled in.
Have anybody been done this before? How can I access to the detail values of the document? It is easy to acces values on the header.
I appreciate any help on this. Thank you very much
Regards,
MaryHi,
You must use both in approval procedure or use both in SBO store procedure transaction notification.
To request approval for a project, you this following approval query:
if (SELECT $[$38.31.0]) > ' '
select 'true'
the other query is for doctotal approval as follows:
if ($[opor.doctotalsys.number]) between 0 and 24999.99
SELECT 'true'
or
select distinct 'true' FROM OPOR
WHERE $[OPOR.DocTotalSy.number] Between 0 and 24999.99
Both are able to use and work simultanously.
JimM -
Transaction Notification Considering Old transaction as well
Dear Experts,
If (@transaction_type = 'A' AND @Object_type = '140000009')
begin
if exists (SELECT T0.DocEntry FROM OOEI T0 WHERE (T0.U_ModVatCatg = 'N' AND T0. Series = 34) or (T0.U_ModVatCatg = 'M' AND T0. Series = 40) and T0.DOCENTRY = @list_of_cols_val_tab_del)
select @Error = 1, @error_message = 'Wrong Series Selected for the given MODVAT Category'
end
The above transaction notification is written to check the series with a UDF. It was working fine till a few days back.
However, a historical transaction was needed to be updated in a way that the condition in the transaction notification was not met.
After having updated the transaction, this notification blocks all further documents even though the condition is satisfied.
It seems the transaction notification is also considering the historical transaction and hence blocking the new transactions. However, this is not the way transaction notifications are meant to work.
Kindly advise on how to over come this issue.
Regards,
JimitHi Jimmit,
Seems you have 3 condition here
1. (T0.U_ModVatCatg = 'N' AND T0. Series = 34)
2. (T0.U_ModVatCatg = 'M' AND T0. Series = 40)
3. T0.DOCENTRY = @list_of_cols_val_tab_del
You place OR between 1 and 2, and place AND between 2 and 3, but no bracket to group condition 1 and 2.
Seems fishy, try this
if exists
SELECT T0.DocEntry FROM OOEI T0
WHERE ((T0.U_ModVatCatg = 'N' AND T0. Series = 34) or (T0.U_ModVatCatg = 'M' AND T0. Series = 40))
and T0.DOCENTRY = @list_of_cols_val_tab_del
Hope this help.
Best Regards,
Hendry Wijaya -
Transaction Notification - User Table
Hi experts.
I'm wondering if it's even possible to create an IF statement on SAP Transaction Notification that looks up to an user table.
Regards,
Eduardo Araujo.So, I take this and I use the name of my table instead of "@PODGRUPA"?
@EDIT
I've tried this:
IF(@object_type = '-3 @FLAGCADPAC' AND @transaction_type IN ('A', 'U'))
BEGIN
IF (1=1)
BEGIN
SET @error = 1
SET @error_message = 'Teste'
END
END
But with no success.
I've tried "IF (1=1)" o make an test if it works.
Between "-3" and my table name, I've used TAB, space, and even without anything between them, but no success too.
Regards. -
I Don't know how to use SBO Transaction Notification procedure
Hi all
I don't know how to use SBO Transaction Notification procedure
can any body give me description why we use,where we use,how we use some example
Awaiting soon reply
Rajkumar G.example is for testing, if on delivery is filled ref no of vendor or not
if @object_type = '20' and (@transaction_type= 'A' or @transaction_type= 'U')
begin
if 1 = (select count(docentry) from opdn with(nolock) where docentry =@list_of_cols_val_tab_del and (numatcard is null or len(numatcard) = 0) )
begin
select @error =1
select @error_message = 'vendor ref no isnt filled'
end
end
next example is for creating BP as vendor and testing, if dont begin for specific sign
if @object_type = '2' and @transaction_type= 'A'
begin
if left(@list_of_cols_val_tab_del, 1) = N'x' or left(@list_of_cols_val_tab_del, 1) = N'X'
begin
if 1 = (select count(cardcode) from ocrd where cardcode = @list_of_cols_val_tab_del and cardtype in ('S', N'S') )
begin
select @error =1
select @error_message = 'Vendor code cannot begin to X sign.'
end
end
end
is it clear? -
Change Notification with C#
I am trying to get a test application to work using Oracle Change Notification with C#, but I am not receiving the callback notification in my application. Oracle DB version is 11.2.0.1.0. Oracle.DataAccess v.2.112.30. I can confirm the query gets registered in Oracle by viewing SYS.USER_CHANGE_NOTIFICATION_REGS and SYS.USER_CQ_NOTIFICATION_QUERIES. However, nothing ever appears in SYS.DBA_CHANGE_NOTIFICATION_REGS.
The registration persists until I commit a transaction on the table. The registration disappears after a few seconds after the commit and my application does not received the notification.
I have made sure my computer is listening on the correct port and have even tried turning off any firewall that could be blocking the port.
I do have GRANT CHANGE NOTIFICATION to MYSCHEMA, GRANT EXECUTE ON DBMS_CHANGE_NOTIFICATION TO MYSCHEMA, and the JOB_QUEUE_PROCESSES is set to 1.
Questions:
1) Should the registration be visible in SYS.DBA_CHANGE_NOTIFICATION_REGS and, if so, what could be causing it not to be when it is visible in SYS.USER_CHANGE_NOTIFICATION_REGS and SYS.USER_CQ_NOTIFICATION_QUERIES?
2) What could be causing the registration to disappear after a commit?
3) What could be causing the failure of the notification to my application?
Here is the C# code I am using and it is basically the same as from the Oracle website:
using System;
using System.Threading;
using System.Data;
using Oracle.DataAccess.Client;
namespace NotifyTest
public class Program
public static bool IsNotified = false;
public static void Main(string[] args)
string constr = "User Id=mySchema;Password=myPassword;Data Source=myOracleInstance";
OracleDependency dep = null;
try
using (var con = new OracleConnection(constr))
Console.WriteLine("Registering query...");
var cmd = new OracleCommand("select * from mySchema.NOTIFY_TEST", con);
con.Open();
OracleDependency.Port = 1005;
dep = new OracleDependency(cmd);
dep.OnChange += OnMyNotificaton;
int queryRegistered = cmd.ExecuteNonQuery();
// If oracle returns -1, then the query is successfully registered
if (queryRegistered == -1)
Console.WriteLine("Query Registered...");
Console.WriteLine("Listening for Callback...");
else
Console.WriteLine("There was an error...");
catch (Exception e)
Console.WriteLine(e.Message);
// Loop while waiting for notification
while (IsNotified == false)
Thread.Sleep(100);
public static void OnMyNotificaton(object sender, OracleNotificationEventArgs arg)
Console.WriteLine("Table change notification event is raised");
Console.WriteLine(arg.Source.ToString());
Console.WriteLine(arg.Info.ToString());
Console.WriteLine(arg.Source.ToString());
Console.WriteLine(arg.Type.ToString());
IsNotified = true;
}Just wanted to provide an update as to how I resolved this issue. I changed my Oracle.DataAccess.dll from v.2.112.3.0 to v.2.112.1.2 and it works fine.
-
Help Restriction Purchase Order Transaction Notification
Good afternoon experts community'm doing a lock which I doubt as raise it, the case is as follows:
The purchase order should not be created if the unit price of the item is higher than the price of the price list of sap, the problem is that now they will start to use the extra coin price list, that is why it is requires blocking the creation of the purchase order if the order price is higher or not applicable to the two alternatives we have in our price list.
In advance I will be grateful if anyone reads this post and I can reach out to fill this requirement and also bring something more to my knowledge.
best regards!
example
if @transaction_type = 'A' and @object_type='22'
begin
set @itemcode =(select top(1) o1.itemcode
from opor o inner join por1 o1 on o1.docEntry = o.docEntry
inner join ocrd c on c.cardcode = o.cardcode
where u_facnum is not null
and not exists(
select *
from itm1
where itemcode = o1.itemcode
and pricelist = c.listnum
and (price > o1.Price and AddPrice1 > o1.Price or itemcode in ('FLETE','SEGURO'))
and o.docEntry = @DocEntry)
if (
select count(*)
from opor o inner join por1 o1 on o1.docEntry = o.docEntry
inner join ocrd c on c.cardcode = o.cardcode
where u_facnum is not null
and not exists(
select *
from itm1
where itemcode = o1.itemcode
and pricelist = c.listnum
and (price > o1.Price and AddPrice1 > o1.Price or itemcode in ('FLETE','SEGURO'))
and o.docEntry = @DocEntry
)>0
begin
set @error = 1
set @error_message = 'Error el articulo '+@itemcode+' no concuerda a lista de precios del cliente.!'
end
endHi,
Please avoid using Transaction Notification if you want to insert a B1 object via DI API using the integration framework.
The reason is, that the integration framework uses the DI API logic and this transaction notification runs on top after the DI API process is finished. Therefor it is not really part of the DI API process.
This could cause an unexpected exception in the DI Adapter of the Integration Framework.
My proposal is to check your mentioned logic within the integration framework instead of using the transaction notification at the end.
E.g. Build a flow using a SQL Call atom to retrieve the pricelist price you want to compare with.
You can built a conditional processing in your integration flow to avoid the creation of the purchase order or directly change the price on the flow.
Another option is to check your logic, create the purchase order with status "for approval" and inform the keyusers via B1 alert message out of your integration scenario step.
Best regards
Bastian -
BDC for notification with sales order
Hi,
I have to code a BDC program for IW51 : Service Notification with sales order.
The problem is that in simulation mode (SHDB) the button "Sales order" is not working !!!
although it works well in transaction mode!
please help!
A+
Ihsenhi all,
so anyone came across any BAPI or FM that creates Orders from Notification.
My requirement is similar to "Order Explode" functionality in WPS1 transaction (MEB). For two notificaitons, if the task list having the same operation and same type, then a single order gets created.
I want to know whether any FM/ BAPI is available that creates Order in reference to Notification. I just want to simulate Order creation.
Waiting for reply.
Debs -
Use Transaction Notification in Approval Procedures
Hi
I want to use the "SBO_SP_TransactionNotification" Stored procedure in one of my approval procedures. I have implemented a approval procedure based on certain criteria when a "PURCHASE ORDER" is created. Now i want to send an email out to certain users when a approval is needed for a PO.
I m not sure if transaction Notification is being used when Approval procedure are involved. For all POs that does not require an approval , my code for emailing uses in the SP is working fine.
Has anybody came across this scenario? pls help.
thanks
raghuSBO_SP_TransactionNotification is not compatible with approval procedure. This is clear mentioned in SAP Notes. You may not use this SP in associated with approval. I think there are alternative ways to achieve your goal.
Thanks,
Gordon -
Sp transaction notification to control docdate
Hi,
i've this problem. i've Sales Invoceis ( OINV) and Credit Notes (ORIN) with the same series
i want to control, by sp transaction notification, that the user does not insert, for this series, a new document with a docdate < then the last date insert about OINV or ORIN ( because these have the same series)
i've create this procedure: but i'm not able to control docdate about OINV and ORIN together
DECLARE @GroupCode SMALLINT
DECLARE @DocDate DATETIME
DECLARE @MaxDocDate DATETIME
DECLARE @Series INT
DECLARE @NumAtCard NVARCHAR(100)
DECLARE @Conta INT
DECLARE @CardCode NVARCHAR(15)
DECLARE @IdUtente SMALLINT
-- ADD YOUR CODE HERE
-- Select the return values
IF @object_type = '13' AND @transaction_type = 'A'
BEGIN
SELECT @Series = OINV.Series, @DocDate = DocDate
FROM OINV WHERE OINV.DocEntry = @list_of_cols_val_tab_del
BEGIN
/* 1. inserendo una fattura di vendita la data non deve essere precedente
a quella dell'ultima fattura per la stessa serie */
--Reperisco la serie a cui il documento appartiene
SELECT @MaxDocDate = MAX(@DocDate)
FROM OINV
WHERE OINV.Series = @Series AND OINV.ObjType = @object_type
IF @DocDate < @MaxDocDate
BEGIN
SELECT @error = 1002,
@error_message = 'La data del documento non può essere precedente a quella dell''ultimo inserito ' + CONVERT(VARCHAR, @MaxDocDate, 103)
ENDHi,
Correct this
SELECT @MaxDocDate = MAX(@DocDate)
FROM OINV
WHERE OINV.Series = @Series AND OINV.ObjType = @object_type
to
SELECT @MaxDocDate = MAX(DocDate)
FROM OINV
WHERE OINV.Series = @Series AND OINV.ObjType = @object_type
Thanks
Malhaar -
SP Transaction Notification - what object type number to use for BP Activity
Have to re-post it, the previous one has been accidently marked as answered.
I'm trying to add some script into SP Transaction Notification and want to make it
run when user add a new "BP Activity" into B1.
What object type number should I use in SP Transaction Notification stored
procedure?
BTW, following this article:
SAP Business One Form Types and Object Types
http://scn.sap.com/community/business-one/blog/2013/07/09/sap-business-one-form-types-and-object-types
I tried 103, but it seems like doesn't work.
103 ActivityTypes object
Thanks.Found my answer here, object type should be 33. Strange, this is inconsistent with article in my original post
Object code for Activity (OCLG) -
Use SP Transaction Notification for trigger on user defined table
Hi i need some help. I have a user defined table in sap (@LAU_ACCT) .
I need way to catch the event on the table (update , delete , add).
I heard about SP Transaction Notification , but how use it with udt ?
Thanks!Hi Pavel,
it is only possible if the UDT is registered as part of an object ( UDO ) - further info http://scn.sap.com/thread/3277846 . So for pure UDT actions you have to find another way ( SQL trigger, UI API, periodic query ).
regards,
Maik
Maybe you are looking for
-
I want to play guitar with a friend through my iphone and his ipad.
I want to play guitar with a friend through my iphone4 and his ipad. Is this possible??? I hooked my Iphone4 to a FM transmitter so I could hear my friend through my stereo. However, whenever I played, his feed cut out. Is there a way to play mus
-
I have a 10g grid console installed configured and working. However thirty four error lines a second are written to the ons.log file. The error is: 05/05/02 12:59:42 [4] Local connection 0,127.0.0.1, 6100 missing form factor. The above line is repeat
-
Hi, If the backround job is failed where can i see the status and how can i run again?
-
How to make cells in table pushbuttons
Hi! I have an applet ( http://www.topbridge.com/topbridge/resultat/350/sp62.html ) which displays a bridge game. I would like to improve it by making a display area for the status in the game at the choosen stage in the play. I was thinking of using
-
Hi All, In transaction 'APPCREATE' im going to create appraisal process. Once i created the appraisal, then 'Appraisal ID' will be generated. Now I need to get the generated appraisal ID. Can i use change document header table for that? I have no ide