Doubt in triggers
hello,
we have on trigger which contains 1000 lines of code.According to oracle documentation one point is given that if a trigger contains more that 50 lines
better to call a procedure(by writing trigger logic in the procedure) from a trigger instead of implementing the code in the trigger,is
this correct way please help
we have on trigger which contains 1000 lines of code.Yuk. What are you doing in a trigger that it requires so much code?
Anyway, I think just about any logic beyond simple formatting or sequence look-ups ...
select m_seq.nextval in :new.pk_col from dual;
:new.col1 := upper(:new.col1);should be put in a stored procedure.
Cheers, APC
Similar Messages
-
Hello,
How many triggers can i make at the most on a single table...
lets say ..i have a table 'Employee'....then how many triggers i can build on this trigger.then how many triggers i can build on this trigger.I guess you meant:
then how many triggers i can build on this table.You should always doubt triggers, and use them as little as possible.
The max you would use is easy to calculate, given the following trigger types (omitting compound and instead of triggers, assuming we're dealing with a normal table) :
-there's row level/statement level
-there's insert/update/delete of table
-there's before/after
So, 12 triggers is the 'logical max' according to many development tools that are capable of generating table API's.
Having multiple triggers that fire at the same level/type can cause you great troubles if all that trigger code needs to be processed in a specific order.
But yes, in addition to Frank, in theory, you can have as much triggers as you want:
"You can create as many triggers of the preceding different types as you need for each type of DML statement, (INSERT, UPDATE, or DELETE)."
http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/triggers.htm#CNCPT118
(read and scroll a bit)
But it wouln't be very practical (that's an understatement ;) ).
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:436419805666 -
Hi All,
I have a scenario where IDocs would be posted from R3 randomly to a non SAP system.
I would need to wait for 30 mins after posting one IDoc to the non SAP System and receive a Ack from that non SAP System.
If I receive a Ack within 30 mins or if the 30 mins of time is already elaspsed, i would need to process with the next IDoc.
Or in other words, there should always be one BPM instance active at any point of time and my IDocs should wait until that BPM is freed up..
Do you guys have any idea to achieve this? Your help is highly appreciated.
ThanksHI Suraj,
Thanks for your reply. Actually R3 collects a batch a IDocs(of MessageType A) and sends to XI and also sends a summary IDoc of MessageType B, that contians all the IDoc numbers of type A.
Using some corrleations I need to wait until Message Type B is received .There would be n number of such Batches(each batch containing few message Types A and one Message Type B).
My BPM(which would be timed out in 2 hrs) should process each batch in sequence. Meaning that second batch should be picked by the BPM only when the first BPM is auto-timed out.Or in other words, at any point of time, only one BPM instance should be active.
Pls let me know if you have sugeestions.
thanks a lot in advance.. -
Hi all,
I have a doubt with triggers. my synario is, I have to make 2 insets and a select(one after the other continuously). One of the two insert statements will fire a Trigger(AFTER INSERT Trigger) and do some manipulations on data.After this I use the slect statement to reterive values from the table. In this case, The Insert query which is associated is taking nearly 40 seconds.(while others take only 2 to 3 seconds). I have also used setQueryTimeout() in this query as 10 seconds. But it is not throwing SQLException also. Can anybody suggest why this occurs:.is this because,the trigger takes much time to execute and hence the query timeout doesn't affect the flow.I had given a part of my code here:
Statement stmt=dbConn.createStatement();
stmt.setQueryTimeout(10);
int i=stmt.executeUpdate(detIns);//without trigger
int j=stmt.executeUpdate(HeadIns);//with Trigger ::Takes 40s
stmt.close();Maybe you're not performing a commit in the stored procedure, so that the table is locked for a little while.......
Ps. if you can, you should be using PreparedStatements instead of Statements.
regards,
Owen -
Dear Expert,
I have doubt regarding BOM explosion for MRP Area. This doubt is triggered when performing MD01, as result I do not find the dependent requirement in MD04 for my FG. I have maintained the BOM through CS61 and MRP area for all component, I understand that only component level system is taking into account MRP area (storage location). FYI before maintaining all components to MRP area, the BOM explosion was successful exploded. Your advice is appreciated.
Best regards,
MahnansaDear,
Please check the Explosion control in Customizing, Transaction OMIW.
Try to explode the BOM in CS11 , CS12 or CS13 if it is working there in curret date then chack the planning file entry in MD21.
You need to convert the planning file entery at MRP area in OM0F.
Also note the dependent requirement is not generated in the corresponding MRP area to which the production storage location in the material master has been not assigned for the data of the MRP area.
Regards,
R.Brahmankar -
Hi All,
Im working in FI workflows. My Business object is FIPP. But clients wants to use custom class's instead of FIPP Business object. Now im having doubt in triggering part of the work flow. If I use class, then Is i need to make a entry in SWEC and SWE2? Or Can i use business transaction event to trigger workflow?
Thanks for Helping,
Helps will be appreciated.Hi Nandini
If you are working on the an FI workflow then i would first of all use the object BUS2081 and not FIPP if applicable at all (BUS2081 can cover both FI and MM invoices).
If you are going to use an ABAP OO class instead, you need to make sure the an event is raised on this class. This can be done in an event receiver functionmodule. The trick here is to listen for the relevant event to be raised on your FIPP oject (or your BUS2081 object). You can do that in a event receiver FM, you here need to link the FI event in SWE2. From within the Event Receiver FM you can the raise the relevant event on your class.
After that you just have to link the ABAP OO event to your WF in SWE2. No need for SWEC
Regards
Morten Nielsen -
Hi All,
I had doubt on triggers if possible if you have face before this please let me know.
I had table which had 200 columns and the end user is going to change the values of this table.
I need to find out which column has updated, the previous columns value as well as new value.
How to do this with triggers
Regards
ZaheerHi !
Well , to see what column was changed and to do this with triggers .. at the end someone must check column by column in any case.
Oracle can do this for you with specifing column list in trigger
create or replace trigger tr1
before update of ename on emp
for each row
begin
null; --- Do whatever
end;and this trigger will fire only if column ename is changed ... but then again you should have 200 triggers in this scenario.
And i agree there is a performance degradation with building a trigger on table , but degradation basically depends on "quality" of code in that trigger.
So doing some checks for 200 columns , will this be bad or very very bad or maybe not so bad ... this depends on how the thing is coded and on the data itself and so on .. you should done some observations and test few solutions not just one ..
T -
Doubts about applet triggering
Hello guys,
I was wondering, when I have my applet assigned to be triggered by a EVENT_UNFORMATTED_SMS_PP_ENV or even a EVENT_FORMATTED_SMS_PP_ENV, I mean, the applet being triggered by a SMS-PP message, what happens when I send two consecutive messages, i.e., when I send the second message and the applet is still processing the first one, what happens to the second message? is it lost by the ME or it is kept in some sort of buffer and re-sent to the applet when the applet finishes the process?
As there are no threads on Java Card so both messages can't be processed at the same time...
Thank you,
HelriThis is too broad a question.
Toad can fire random sql.
sql*plus can fire random sql.
Why would Toad be the problem?
You would need to gather statspack data to demonstrate this.
Sybrand,
Agreed on it and its a relevant point.But I guess he is not worried about the db performance.Anyways lets see what OP says.
Inner join and left join will always use CBO (Cost Based Optimizer) instead of RBO.
I am not sure that I have read that anywhere. They came into Oracle in 9i where optimizer mode was choose as the default one. Just by the syntax, oracle would push them to use CBO as the default one,I am not sure about this. Even if we are having + symbol and have the stats,Oracle wold go for CBO right?Can you please point me to some where in the docs where it is mentioned that using this keywords,Oracle would use only CBO?
Aman.... -
Doubt in creating program to display application logs
Hi,
I have doubt in creating a program to display application logs.
The standard transaction code SLG1 has been used to display Application logs till now by the user.
They came up with the new requirement on this.
<u>The requirements were:</u>
1)New custom program shoud be created like SLG1 with limited selection fields( data from, date to, Program name and User)
2) Detail list should be displyed immediately when this program is executed because SLG1 gives Basic list,Detailed list which is getting displayed when 'Detail view' is selected in the first list.
I have created one program with limited selection fields as per the requirement using the below function modules .
BAL_FILTER_CREATE
BAL_DB_SEARCH
BAL_DB_LOAD
and BAL_DSP_LOG_DISPLAY
<u>Issue :</u> still I am getting the firt list.
both Basic and Detailled lists are getting triggered at the FM BAL_DSP_LOG_DISPLAY.
Is it only the way to copy and modify this FM.
Could you please suggest me?
Thans in advace,
babu.
Message was edited by:
babu v
Message was edited by:
babu vHello All,
Thanks for your valuable suggitions.
I have seen most of the demo programs.
I found one fm'BAL_DSP_PROFILE_NO_TREE_GET' which avoids the tree list which is getting listed above the profile list.
I have been searching alot to omit the Profile list. I searched alot to find any function modules realted to that.
The requirement was only the Detail list should only be listed.
Could you please suggest me to avopid that profile list also?
Thanks in advance,
babu
Message was edited by:
babu v -
One doubt on CRM Workflow.
Hi All,
I have a clarification to be made.
Below are some requirements from a CRM project. Now we are planning to train some one to handle this part and essentialy his role is on Workflow. Now my doubt is whether this person should take CRM training or workflow training? One thing to note here is that the person does not have any CRM background also. So my question is whether this person needs to take Workflow training or CRM training( I am not sure whether CRM training has workflow in it) or something else(meaning first CRM and then Workflow, since the project is on CRM)?
The requirements are in bold.
<b>1. Ability to define a Customer Program, including, but not limited to:
will adhere to role based security
informational program characteristics
program eligibility rules
technical prerequisites (e.g. equipment)
program specific options (e.g. bill protection)
enrollment related work flow steps and prerequisites
funding accounts
<i>Comments : Standard SAP functionality. May need workflow</i>
2.Ability to automatically enable or disable program functions.
<i>Comments : Workflow or Actions can be used.</i>
3.Ability to generate automated notifications/ticklers when program steps need to be taken.
<i>Comments : Workflow or Actions can be defined to trigger Notification on certain events.</i>
4. Notify appropriate Program Manager if measure factors or incentive rates are changed.
<i>Comments : Need workflow or Actions to trigger this.</i>
5. Associate the completed audits to actual programs and when applicable tie to a programs workflow requirements.
<i>Comments : Link is Standard SAP Functionality and needs to define workflow.</i>
6. Ability to generate customer communications based on triggers such as; dates, changes to customer information, work flow steps, etc.
<i>Comments : Needs to develop workflow or actions to trigger Notifications on pre-defined rules.</i>
7. Based on program, allow for multiple incentives or timed incentives based on workflow process completion steps.
<i>Comments : Need to be configured in Rebate Processing</i>
</b>
Thank you,
Regards,
ManeshHi,
The steps which u have done al are correct
Find the information below for BWA1,BWA5 and BWA7
BWA1:
1.BW adapter which will give you meta data information and if you want to chnage any settings relatede to mapping or if you want add any BDOC mapping you can do by using this Tcode
2. We c an copy BW adapter data source and we can create custom BW adapter data data source by using copy function
3. We can change the selection conditions for the data source
4. we can bdoc mapping information under mapping tab,if you want to add any new field to map with new bdoc segment ,we have to map here;for ex if you want to extract Extractnal reference number from 0CRM_SRV_PROCESS_H data source
we have to follow below steps
1.enhance Extract structure
2.Add bdoc mapping in BWA1 with perticular BDOC segment for example Sales bdoc segment mapped with Extractnal reference number
3.Add code in Mapping module of data sourc eto fetch data or write code in Badi CRM_BWA_MFLOW to fetch data for newly added fields
BWA5:it will show all activated BW adapter data source information under ACTIVE tab
BWA7: it will have all BW adapter delta enabled data source information,if your data source is not available under BWA7 ,that means you didnt enable delta for the same (not intialized )
Table information:
SMOXAFLD: Field List: Key Attributes for BWA Master Data Delta Queue
for example : DISTR_CHAN, PRODUCT_GUID, SALES_ORG are key fields for data source 0CRM_PRODSL_ATTR
SMOXRELP:BWA: Use of Segments and Fields in DataSources
BDOC segment mapping information fro the data source (which u have used in BWA1 under mapping tab)
SMOXRELP_S: Shadow Table for Table smoxrelp
which will give information about BW selection whether we can use this field for BW selection for data loading iof its marked for selection u can see in rsa3 selections. -
Hi,
I have a doubt on functioning of Before or After Triggers.
Here is an example of it:
I created a trigger on EMP table
create or replace trigger tri11 before insert or update or delete on emp for each row
begin
if to_char(sysdate,'dy')='fri' then
raise_application_error(-20101,'No Transactions should be happend on Friday');
end if;
end;
According to the trigger created it has to fire before any event is happening and it should not allow any insertions or updates or deletion on FRIDAY.
And that is working fine.
I changed the trigger to fire on After Insert or update or delete....
create or replace trigger tri11 after insert or update or delete on emp for each row
begin
if to_char(sysdate,'dy')='fri' then
raise_application_error(-20101,'No Transactions should be happend on Friday');
end if;
end;
Here according to this trigger it has to fire after any event is happening .....but still it is not allowing me to perform any insertions or updates or deletion on FRIDAY.
And showing me the error message as below:
SQL> update emp set sal = 11000;
update emp set sal = 11000
ERROR at line 1:
ORA-20101: No Transactions should be happend on Friday
ORA-06512: at "SCOTT.TRI11", line 3
ORA-04088: error during execution of trigger 'SCOTT.TRI11'
Can anyone please explain me the difference.
Thanks.All triggers must be fired synchronously with the triggering statement. The statement and all triggers that are fired as the result of the statement must be atomic-- they must all succeed or all fail. It doesn't matter whether it is a before or after statement trigger that throws the exception-- in either case, the entire statement will fail and thus be rolled back.
Justin -
Hi ,I've got some doubts in forms.
1) what is the difference b/w commit and commit_form?
2) When we've to use key triggers?What is the purpose of key-triggers?
3) When we've to use On-triggers?
Pls reply me asap...
Prashanth DeshmukhHello,
You seem to have some strong problem to read (access) the online documentation...
Commit and commit_form are the same thing.
Key-triggers are used to intercept some...... key actions !
On-triggers are used to replace the automatic/internal form process
(Yhe code you place in an ON-INSERT trigger replace the Internal Forms code for each based record that have the INSERT status)
Please, open the Forms Builder and press the Ctrl+H key, then take some time to read and learn.
Francois -
Help regarding workflow triggering
hi
i am working on WLI using weblogic 8.1
i have designed very simple workflow using some simple nodes.
as given in the tutorial i am able to run my workflow using test browser.
.its pefectly working.
i would like to know the ways of triggering the workflow from java clients.
Is subscribing to message broker is the only way or we have some other simpler
ways?
thanxThats correct for Weblogic Integration 7.0 and before but in Weblogic
Integration 8.1 there is no default queue with the name
"com.bea.wli.bpm.EventQueue" configured. Weblogic Platform 7.0 uses the
Message Oriented Middleware (MOM) aproach and Weblogic Platform 8.1 uses the
Service Oriented Architecture (SOA).
There is a good article about Weblogic Workshop Internals on dev2dev [1] and
in the documentation there is a page about writing clients for web services
[2] (in Weblogic Platform 8.1 workflows are web services).
If you create your workflow with Weblogic Workshop then you can access the
workflow over the URL
http://yourhost:7001/yourApplication/processes/yourProcess.jpd with SOAP. In
the test browser under the overview tab you can generate a WSDL, a Java
Control, a Service Broker Control and a Java Proxy (which needs the Proxy
Support Jar). With this components you can access your workflow. If you
wanna see the SOAP message use the test browser there is the html form which
uses http for triggering the workflow, for example:
<table cellspacing=0 cellpadding=0 border=0 width="100%">
<form NAME="placeOrder"
METHOD="POST"
ACTION=http://localhost:7001/AvitekWeb/processes/orderProcessing/placeOrder.
jpd>
<tr><td colspan=2 class=methname><A
NAME="placeOrder"></A>placeOrder</td></tr>
<tr><td colspan=2 class=methdesc><!-- do comments
correctly --><!--docString--></td></tr>
<tr>
<td class=namcol><nobr><b>SOAP body:</b> </nobr></td>
<td class=inpcol>
<TEXTAREA class="xmlbox" name=".SOAPMESSAGE" COLS=50 ROWS=10 ><placeOrder
xmlns="http://www.openuri.org/"
xmlns:eval="http://www.beasys.com/evalguide">
<eval:Order>
<eval:CustomerID>3</eval:CustomerID>
<eval:OrderPriority>string</eval:OrderPriority>
<eval:CustomerType>string</eval:CustomerType>
<eval:LineItems>
<!--1 or more repetitions:-->
<eval:Item>
<eval:Name>string</eval:Name>
<eval:SKU>3</eval:SKU>
<eval:Description>string</eval:Description>
<eval:Price>1.5E2</eval:Price>
<eval:Quantity>3</eval:Quantity>
</eval:Item>
</eval:LineItems>
<eval:OrderID>3</eval:OrderID>
<eval:TotalAmount>1.051732E7</eval:TotalAmount>
<eval:OrderDate>2008-09-29</eval:OrderDate>
<eval:OrderStatus>string</eval:OrderStatus>
</eval:Order>
</placeOrder>
</TEXTAREA></td></tr>
<tr><td><img alt="" height=6 width=0
src="http://localhost:7001/AvitekWeb/processes/orderProcessing/placeOrder.jp
d?.RESOURCE=blank.gif">
</td></tr><tr><td> </td><td class=inpcol><input TYPE=submit
class=inpbut VALUE="placeOrder"> starts a conversation<input TYPE=HIDDEN
NAME=.EXPLOREOVERRIDE value=".TESTXML"><input TYPE=hidden NAME=.EXPLORE
VALUE=.INVOKE><INPUT TYPE=hidden NAME=.CONVERSATIONID VALUE=_ID_><INPUT
TYPE=HIDDEN NAME=".CONVPHASE" VALUE=".START"><p></td></tr></form>
I think in this code is all what you need to start a workflow.
mfg
Daniel
[1] http://www.dev2dev.com/products/wlworkshop81/articles/wlw_internals.jsp
[2] http://e-docs.bea.com/wls/docs81/webserv/client.html
"Raj" <[email protected]> schrieb im Newsbeitrag
news:[email protected]...
>
Hi Swati,
You can write JMS program to post an XML to a Queue and configure thestart node
to event.The Quename for this client program should be"com.bea.wli.bpm.EventQueue",
else you have to configure an MDB listener. Let me know if you havefurther doubts....
>
Regards
Raj
"swati" <[email protected]> wrote:
hi
i am working on WLI using weblogic 8.1
i have designed very simple workflow using some simple nodes.
as given in the tutorial i am able to run my workflow using test browser.
.its pefectly working.
i would like to know the ways of triggering the workflow from java
clients.
Is subscribing to message broker is the only way or we have some other
simpler
ways?
thanx -
Doubt in Workflows using Programming Exits on OO ABAP
I have a doubt on workflows:-
Let me brief you about my requirement:
I am trying to update some Master data using ABAP Methods through Programming Exits in a Workflow.
I managed to find an OO method that can fetch the workflow container values directly into the structure.
While testing the workflow:-
The OO ABAP method executes and successfully updates the master tables.
However, a calling method (that triggers this method indirectly), raises an exception called SWF_RUN_WIM_EXEC_INTERRUPTED.
The exception is caught within the caller method and the workflow errors saying that the method ABC cannot be executed.
The caller method is:-
CL_SWF_RUN_WORKFLOW_START
The exception is raised on execution of the following statement:-
CALL METHOD me->start_workitem( lh_wi_handle ).
One reason for this is that the workflow is still not completed and still in READY state.
Alternative method
Once the Master data is updated successfully,
I tried to use the FM SAP_WAPI_WORKITEM_COMPLETE to end the work item or tried another FM to suspend the workflow.
Now it gives an error saying that these FMs are restricted from use during run-time execution.
Query
Do you have an idea why the exception is raised and how to track/prevent the same?
Can you suggest any other alternative? Your valuable advice is urgently needed.
Thanks a million in advance,
Best Regards,
VinodCheck the code
CLASS zcl_event_handler IMPLEMENTATION
CLASS zcl_event_handler IMPLEMENTATION.
Top-of-page event
METHOD top_of_page.
PERFORM event_top_of_page
USING z_dyndoc_id.
ENDMETHOD. "METHOD top_of_page
Change Status Button
METHOD handle_toolbar.
IF NOT pa_prodr IS INITIAL.
DATA: lz_toolbar TYPE stb_button.
CLEAR lz_toolbar.
MOVE 'CHANGE_STATUS' TO lz_toolbar-function.
MOVE text-001 TO lz_toolbar-text.
APPEND lz_toolbar TO e_object->mt_toolbar.
ENDIF. "IF NOT pa_prodr IS INITIAL
ENDMETHOD. "METHOD handle_toolbar
Handle User Command
METHOD handle_user_command.
CASE e_ucomm.
WHEN 'CHANGE_STATUS'.
LOOP AT it_output
INTO wa_output.
IF wa_output-chk_box EQ kc_x.
z_flag = 1.
EXIT.
ENDIF. "IF wa_output-chk_box EQ kc_x
ENDLOOP. "LOOP AT it_output INTO wa_output
IF z_flag EQ 1.
PERFORM display_selected_data.
ELSE.
MESSAGE i001(zzrefn01)
WITH text-023.
ENDIF. "IF z_flag EQ 1
ENDCASE. "CASE e_ucomm
ENDMETHOD. "METHOD handle_user_command
ENDCLASS. "zcl_event_handler IMPLEMENTATION -
Exit which triggers after SO Save
Dear Experts,
I have a requirement to send auto mail to user on customer credit status when user create Sales Order and save.
I did all the necessary code in the form routine USEREXIT_SAVE_DOCUMENT of include program MV45AFZZ.
USEREXIT_SAVE_DOCUMENT will trigger before the document save but I need the condition value for that SO and that will be available only after the Order saved therefore my requirement will be completely fulfil if there is any exit which triggers after Order saved, please let me know if there is any exit triggers after SO saved.
Thanks in advance...
Regards
VenkatHi Venkat,
I think you can achieve through output. You can create an output condition similar to KRML (in which the credit data is send to credit rep) and modify the same as per your need.
How ever the desired credit data that you are looking for can be called from sales summary(t code-VC/2): Info block 018 Credit info.
Hope this will help you.
Please revert to forum if have further doubts
Cheers
Atul
Maybe you are looking for
-
I *believe* this is not off-topic, apologies if anyone considers it so... Clinician has passed on a series of WMV files captured from a PC application http://www.materialise.com/materialise/view/en/2407363-Cranio-Maxillofacial.html which generates a
-
MSE Not Showing Clients After Upgrade to 7.6.100.0
I've upgraded our 5508 WLC's to ver 7.6.100.0. I've also upgraded our NCS to 2.0, and our MSE to 7.6.100.0. I now can no longer see clients on the MSE map for our sites. I've added the WLC to the MSE syncronization. When I select "show clients" i
-
Business Catalyst Help | Getting started with Business Catalyst
This question was posted in response to the following article: http://helpx.adobe.com/business-catalyst/using/getting-started-business-catalyst.html
-
Hi I am a Revel member and have all my pictures and club logo, colors and so on, tomorrow we today NOW 1 hour ago I was supposed to send those logo and rest of club colors to people on the advertising to work and be finished so we have the posters re
-
Does anyone know how I can obtain a copy of Jeode that will run on a Toshiba e740 Pocket PC?