Business Rule Logic
Hey everyone, i have a logic to impliment using business rules and i spent whole my saturday scrathing my head, here is the logic i have to impliment...............
i have to calculate fee based on this rule.
there is a fee of 500$ for first 1.5million$ spent and 200$ for additional 1million$ spent or part of.
so if i input as 3,5million$ spent it should return me the fee amount as 900$.
first part is pretty straight forward, but the second part i cant get my head around, i havent used business rules alot ,
so if any inputs it will help me alot.
Hi,
Facts handling is one of the most important parts of rules definition.
Besides spent and fee amounts, which are obvious facts, I added one boolean fact that is not part of the input or output variables.
Put 2 rules, with checking and setting that condition flag and that's it.
Hint: when you modify a fact in action part of "if" rule and this fact is not used in condition part of "if" rule, designer will not let you do it. But, temporarly, add that fact in condition, specify modify and then delete fact from condition; it will work
You can find my project here: https://docs.google.com/file/d/0ByB4-EjSkKZNQVl3QjBBbkZzQnc/edit?usp=sharing
Let me know if it was useful for you.
Mirza
Similar Messages
-
Problem with two of my business rule triggers
Good morning every one,
I have a small problem with two of my business rule triggers.
I have these tables:
pms_activity
csh_cash
csh_integrate_leh
csh_integrate_led
and my process goes like this:
upon approval of a row in my pms_activity table I have a trigger that insert a row in my csh_cash - and in the csh_cash table I have a trigger that will insert in the csh_ingerate_leh and csh_integrate_led.
my problem is pms_activity does generate a row in csh_cash but the trigger in the cash does not fire to generate a row in the csh_integrate_leh and led tables.
I have generated in the following order after I created my business rule:
I have generated the table from the designer (server module tab)
I have generated the CAPI from the head start utility
I have generated the API from the designer
I have generated the CAPI from the designer
I have run the recompil.sql
I have checked that my business rule trigger is enabled and should run on insert and no where restriction
=== this is my business rule logic ======
l_rule_ok boolean := true;
begin
trace('br_csh001_cev (f)');
csh_gl_pkg.csh_gen_integ_jvs(p_id
,p_ref_num
,p_own_id
,p_trt_id
,p_value_date
,p_description
,p_amount
,p_cur_id
,p_gla_dr
,p_gla_cr
,p_gla_pl
,p_gla_rev
,p_gla_eqt);
return l_rule_ok;
exception
when others
then
qms$errors.unhandled_exception(PACKAGE_NAME||'.br_csh001_cev (f)');
end br_csh001_cev;
==== end =======================
Any help will be appreciated as I have struggled with this for two days.
Thankshmmm...
Try resetting it again and restoring with the same backup file...
Does the phone work properly once you've reset it before you try restoring? A lot of people here have experienced problems restoring from backups... could be worth forgetting about it and starting from scratch.
You could try contacting your nearest Nokia Service Centre (www.nokia.com/repair) and see if they can do anything - it may need the firmware reinstalling or upgrading... possibly... give them a call though and see.
Nokia History: 3110, 5110, 7110, 7110, 3510i, 6210, 6310i, 5210, 6100, 6610, 7250, 7250i, 6650, 6230, 6230i, 6260, N70, N70, 5300, N95, N95, E71, E72
Android History: HTC Desire, SE Xperia Arc, HTC Sensation, Sensation XE, One X+, Google Nexus 5 -
Business rule trigger not calling the procedure in my code
Good morning every one,
I have a small problem with two of my business rule triggers.
I have these tables:
pms_activity
csh_cash
csh_integrate_leh
csh_integrate_led
and my process goes like this:
upon approval of a row in my pms_activity table I have a trigger that insert a row in my csh_cash - and in the csh_cash table I have a trigger that will insert in the csh_ingerate_leh and csh_integrate_led.
my problem is pms_activity does generate a row in csh_cash but the trigger in the cash does not fire to generate a row in the csh_integrate_leh and led tables.
I have generated in the following order after I created my business rule:
I have generated the table from the designer (server module tab)
I have generated the CAPI from the head start utility
I have generated the API from the designer
I have generated the CAPI from the designer
I have run the recompil.sql
I have checked that my business rule trigger is enabled and should run on insert and no where restriction
=== this is my business rule logic ======
l_rule_ok boolean := true;
begin
trace('br_csh001_cev (f)');
csh_gl_pkg.csh_gen_integ_jvs(p_id
,p_ref_num
,p_own_id
,p_trt_id
,p_value_date
,p_description
,p_amount
,p_cur_id
,p_gla_dr
,p_gla_cr
,p_gla_pl
,p_gla_rev
,p_gla_eqt);
return l_rule_ok;
exception
when others
then
qms$errors.unhandled_exception(PACKAGE_NAME||'.br_csh001_cev (f)');
end br_csh001_cev;
==== end =======================
Any help will be appreciated as I have struggled with this for two days.
ThanksHaroon,
SAP does not allow Stored Procedures to be used as part of the SAP Business Db or to be used to access SAP Business One tables directly for Insert, Update or Delete. Any interaction with the SAP Business One Db is required to go through the SAP Business One API's, namely the DI and UI API's.
Eddy -
Business Rules for Account Transformation - Execute a Transformation Group
Hello,
when executing a package for account transformation, I want to select a specific transformation group
only.
The transformation group is the first column in the definitions.
My question:
Can I pass this to script logic as a parameter?
What is it like?
I think this should have a performance effect when using account transformation in default logic.
Thanks for an answer
JochenHi Jochen,
Your best bet is the documentation at [http://help.sap.com/saphelp_bpc75_nw/helpdata/en/2b/8f059920de465b88be2893e2117fbe/frameset.htm], however in this case it does not do a very good job of explaining what is happening. Fortunately the CALC= property is just about the only one that you have control over for the account transformation business rules.
The other option (and the only way to truly know what is going on) is to investigate the ABAP programs that actually execute the business rule logic in BW. You can find these programs in SE80, under the UJ package, in the UJP sub-package. You will be most interested in the classes available there. There tends to be one class per business rule group, as well as classes for allocations and validations.
Cheers,
Ethan -
Business Logic and Business Rules
Hi,
I have a very basic question. If we develop a new screen on top of ECC using Webdynpro ABAP to replace a ECC default screen, say for an example, ME51n screen for purchase requisition to be replaced by a custom screen developed in ABAP Webdynpro, then how do we incorporate the inbuild business logic and the business rules of me51n in to this new screen developed in ABAP Webdynpro? In short, how do we incorporate business logic and rules in to ABAP Webdynpro application?
do we have to code all the logic from scratch or we can use existing logic? If we can, how.
Thank you for your help.
ShaiDuplicate thread
Business Logic and Business Rules
could you please close it.
thanks
sarbjeet singh -
Is it possible to limit FX business rule to only records selected in logic
We are trying to convert from the standard older FX logic (MULTICURRENCYTRANS). The business rule is definitely faster when I run FX over all the records (purposefully). However, every time the FX stored procedure is called from a script logic file (package) it is running over ALL the records for the category specified in the package selection criteria. However, it is ignoring the other selections (product in this case). It should only update FX for the records specified in the package selection criteria. Because of this we are seeing increased run times on the packages. Is there additional logic needed in the FX script? If this is normal behavior, the stored procedure/business rule for FX is not a feasibly replacement for the script logic FX process previously delivered by SAP.
Is there a way to fix this so we can use the business rule?I figured it out. I needed to add a couple of dimensions that are being passed from the package front end. The delivered business rule only has category as a variable. I had to add our entity dimension and our user defined product dimension.
SAP delivered:
*RUN_STORED_PROCEDURE=SPRUNCONVERSION('%APP%','%CATEGORY_SET%','','RATEINPUT','%SCOPETABLE%','%LOGTABLE%')
Revised for our installation:
*RUN_STORED_PROCEDURE=SPRUNCONVERSION('%APP%','%CATEGORY_SET%','%PRODUCT_CP_SET%','%COCODE_SET%','','RATEINPUT','%SCOPETABLE%','%LOGTABLE%')
Carlos -
Hi,
Can anyone explain me the backend logic behind the execution of the business rules. Like,
1) What all tables are involved for maintaining the business rule and
2) What all function modules are involved in the execution of the script logic for the business rules.
Please help me out.
Regards,
G.Vijaya KumarHi,
If you have access to the backend system then login into the system and go to the transaction code SE80 - under the "UJ" package , check the sub-object "UJP" - Parameter driven logic. Under this sub-object you would find all the related tables, programs and function modules.
Thanks -
Is it possible to use "not" logical operator in a Business Rule Condition?
This seems like a very simple request to me, but I cannot see any other questions/answers about it.
Can I add a "not" to my Conditions in a Business Rule?
My scenario is that I have a core Entity with a Type. The Type is a domain attribute with a Code and Name. The Code of the core Entity should in the form 'AA-9999', where 'AA' is the Code from Type.
The idea is that I have a business rule with the condition "not
Code starts with DBA.Type.Code" and the Action would be "Code is not valid".
Is this possible? Is there a better way of implementing this?
Thanks,
MichaelYeah! This is the board in question! But it has lots of versions, like K7T Pro, K7T Pro2 (my one!), K7T Turbo, K7T Turbo Limited Edition and K7T Turbo2, all of then are WS-6330 Lite... They phisically diferent, but the BIOS seens to be the same... I want to know is this feature in the newer version is going to work or not on my board (MS 6330 Lite K7T Pro2 Ver:1) ....
Doesn´t matter what board you choose (PRO, PRO2, Turbo, Turbo2) the MSI page shows all the same BIOS to Download... But I think that this feature is only applicable for K7T Turbo2, but will make no difference in my! At least that´s what I think...
But you´re right! The board that I have is the one on the link you said!
Thanks! -
BPC 10.0 NW - How do I make Business Rules run one Period at a time
I was wondering if anyone has a way to make business rules run one period at a time before moving on to the next to the next time period (i.e. January 2014 calc prior to moving on to February 2014). In past SQL this could be achieved with a piece of script *CALC_EACH_PERIOD. Is there anything like this that can be applied in the NW platform for Business Rules? I have some logic that I want to run through a package on multiple periods at once. Part of this logic contains a Business Rule that uses a value from the preceding period. the Business rule appears to be calculating all time periods selected in the package at once so it is missing the piece that is supposed to come from the prior month unless the package is run one period at a time. I need the logic to run sequentially by time period (oldest first) when more than one time period is selected.
thanks,
KeithHi Vadim,
Script for the business rule is below, it runs along with the FX_Trans rule in the same package ( I have also attached a screen shot of the actual Business rule its self)
*RUN_PROGRAM CALC_ACCOUNT CATEGORY = %CATEGORY_SET% ENTITY = %ENTITY_SET% CURRENCY = USD //GROUPS = %GROUPS_SET% TID_RA = %TIME_SET% //OTHER = [AUDITTRAIL=%AUDITTRAIL_SET%] CALC = CALC_HIST_USD *ENDRUN_PROGRAM
Thanks, Keith Carlson -
Using a local Array in a Business Rule
Newbie question here...
I am writing a business rule that applies a standard rate to a lot of different lines in a business rule. This rate only varies by year, so from a logical perspective I think of it as a 1 dimensional variable. However the rate is actually stored in my normal Essbase cube (8-dimensions) something like the following:
Dimension Dimension Member
Account: Rate
Dim2: No Dim2 Value (A dimension member called "No dim2 Value")
Dim3: No Dim 3 Value
Dim4: No Dim4 Value
Dim5: No Dim5 Value
Dim6: No Dim6 Value
Dim7: No Dim7 Value
Year: [varies by year]
So right now my formula to calculate things looks something like the following:
"Target Account 1" = "Driver Account 1" * Rate ->
"No Dim2 Value" ->
"No Dim3 Value" ->
"No Dim3 Value" ->
"No Dim5 Value" ->
"No Dim6 Value" ->
"No Dim7 Value"
But I have to do this for several "Target" and "Driver" Accounts in the rule, which means an ugly looking rule. What I would like to do is create a local array at the beginning of my business rule and populate it with the rate:
ARRAY _rate[Year]
and then set the value of the array equal to
Rate -> "No Dim2 Value" -> "No Dim3 Value" -> "No Dim3 Value" ->
"No Dim5 Value" -> "No Dim6 Value" -> "No Dim7 Value"
This will allow me to simplify my formula down to
"Target Account 1" = "Driver Account 1" * _rate
My first question is "can I do this?" I've been able to create an array and use it in the formula, but I can't figure out how to populate the values in the array from my main Essbase cube.
The second question is "does it make sense to do this?" In addition to making the code easier to read, my guess is that populating the array once and just using it within the scope of the rule would be a bit more efficient than referencing that big cross dim expression, but I really don't know.
Any advice anyone has would be appreciated.
Thanks
-GlennI am familiar with what you are trying to accomplish.
Having Essbase store a fixed rate over time to be used in calculations is possible. However formulas start to look complex depending on how many dimensions you have and what the desired outcome is.
There are alternate techniques to the one you mentioned.
You can create a new database for rates only and make it with fewer dimensions. Then use the @XREF function to retrieve it in your formulas.
If the rate doesn't change very often you can put the Rate inside of the formula as is.
For example Y2006_Rate = 5%.
Brian Chow -
Dynamic filename in Business Rules
Hi,
I would like to use the DataExport command in my business rules to extract level-0 data in a file as a reference for user. I would need to extract data only for Entities that a user has access to (I figured that I could use parameters, link the rule to a Planning form and use "members" on form).
My problem is that I would need a different filename for each execution. Something like :
..\userABC_20090513_100350_BV_SBQ.txt
..\userDEF_20090513_100430_BV_SLVQ.txt
Is there a way, in business rules, to find the following info ?
- the user who is currently running the rule.
- the current date.
- the current time.
If not, is there a way to include a shell in a business rule. I have a small .exe that return the date or time as an "errorlevel" code that I could use if I can call a shell in the rule.
Finally, a theorical question : is there an other way to ensure that only the user who run the rule can access the generated file (always while using business rules) ?
ThanksFirst, in a well designed data model, I'm not sure I see the need for data validation logic to change regularly. If a particular column cannot be NULL today, it would be rather unlikely that it would somehow need to be NULL tomorrow.
Second, I'm not sure I see what this approach buys you over the much simpler approach of adding and removing check constraints if the data model changes. Adding and removing a constraint is pretty trivial-- orders of magnitude less difficult than doing the analysis to determine what constraint needs to change and what impact that has downstream.
Third, I would suspect that if you need to encode these sorts of constrains in a table, your system will kill downstream systems with regularity. If p1 is NOT NULL today, but tomorrow it suddenly allows NULL values, a consumer application might well break (or worse, silently return incorrect results). Data changes should not be able to screw up downstream systems.
Fourth, if you did build such a system, you would have to build your own constraint validator, rather than being able to rely on Oracle's (unless you wrote code to create and drop Oracle constraints based on values in a table, but that seems rather convoluted). Given that Oracle's constraint validation engine is highly optimmized and highly accurate, a home grown engine isn't going to look particularly good in comparison.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Validation - Business Rule or/and UJ_Validation
Hi experts,
I'm on BPC 7.5 NW, I'm facing problem to construct a simple validation where I need to compare the amount from one parent account against to other. Let's explain the business scenario and after the technical solutions.
Business Scenario
Compare the Total Assets is equal to the Total Liabilities. The Total Assets is represented by a parent account "1", the Total Liabilities is represented by a parent account "2". If it is different show a warning.
This is need to trigger, after the Actual Transactional Data Load + Journals.
Technical Solution
Application: Legal
Dimensions: Empresa (Entity), Conta (Account), Fonte (C_DataScr), Versao (C_Category), Groups, Intco, MesAno (Time), TipMov (Flow), CCusto (User Defined), CLucro (User Defined)
1 - Business Rule
Validation Definition
Validation Account Remark Validation Operand Other destination dimension Members Validation Tolerance
ZATIVO_X_PASSIVO Ativo x Passivo = CONTA=VALIDATIVPASS,INTCO=SPTOTAL,CLucro=ACTEDUMMY,CCusto=ACTENONE 0
Account 1 Flow 1 Sign 1 Account 2 Flow 2 Sign 2 Remark
1 TMTOTAL* 1 2 TMTOTAL* 1 Ativo x Passivo
*The TMTotal Flow is a parent from every data on the master data TipMov (flow)
Validation.lgf
*RUN_PROGRAM VALIDATION
CATEGORY = %VERSAO_SET%
CURRENCY = %GROUPS_SET%
TID_RA = %MESANO_SET%
OTHER = [ENTITY=%EMPRESA_SET%]//For More than one other scope parameters: OTHER = [ENTITY=%ENTITY_SET%;INTCO=%INTCO_SET%...]
*ENDRUN_PROGRAM
Result
When I run with this parameters I receive the message : "UJP_PROCESS_EXCEPTION:Data for category not found in application LEGAL"
2 - Validation with UJ_Validation
Assign the driver dimension to Legal - in case I used the CONTA (Account)
Rule Maintenance
Assigned Member: "1" and "2"
Use Logic Table
Dimension = Empresa (Entity)
Operator "="
Members = TECSA - This is a parent from every Entities.
Result
When I run with this parameters I receive the message : "UJP_PROCESS_EXCEPTION:Data for category not found in application LEGAL"
3 - Validation with UJ_Validation and BADI
Assign the driver dimension to Legal - in case I used the CONTA (Account)
Rule Maintenance
Assigned Member: "1" and "2"
Use BAdI Implementation
BADI_UJ_VALIDATION_RULE_LOGIC
Create a Enhancement ZATIVO_X_PASSIVO
Filter
Rule_Num = 1
APPSET_ID = ZTECSA
DIMENSION = CONTA
Class
METHOD if_uj_validation_rule_logic~do_validation_logic.
FIELD-SYMBOLS:
<field1> TYPE ANY,
<field2> TYPE ANY.
ASSIGN COMPONENT 'FIELD1' OF STRUCTURE is_data TO <field1>.
ASSIGN COMPONENT 'FIELD2' OF STRUCTURE is_data TO <field2>.
IF <field1> NE <field2>.
es_message-message = 'Error in Validation'.
es_message-recno = 1.
es_message-MSGTY = 'W'.
ENDIF.
ENDMETHOD.
And add this line to the script
*START_BADI_UJ_VALIDATION_RULE_LOGIC~DO_VALIDATION_LOGIC
QUERY = ON
WRITE = ON
*END_BADI
Result
Data Region:
[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:CCUSTO WILL QUERY ON ALL BASE MEMBERS.
[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:CLUCRO WILL QUERY ON ALL BASE MEMBERS.
[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:CONTA WILL QUERY ON ALL BASE MEMBERS.
[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:FONTE WILL QUERY ON ALL BASE MEMBERS.
[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:INTCO WILL QUERY ON ALL BASE MEMBERS.
[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:TIPMOV WILL QUERY ON ALL BASE MEMBERS.
[WARNING!] MEASURES IS NOT SPECIFIED!
So what could I make to maintain all my options to do what I need ?
I appreciate any help
Best Regards
Alexandre Mendoza CollepicoloHi,
Just to check, can you try and hardcode the category in the rules itself...just for a test to see if it is working.
You can have the category mentioned as CATEGORY=ACTUAL in the rules itself for Other source dimension members and other destination members. J
This is to check if the validation package runs successfully or not.
Thanks,
Sreeni -
Problem executing Business Rule in BPM 11g
I've createad one business object CPFBObject which contains several attributes. My requirement is that if relationship is parent the it goes to human task otherwise to end. for thet I've written the business rule which is as not working properly. Please suggest what to do?
Hi
I do not know why business rule is not working. But, if "relationship" is an attribute of the Business Object "CPFBObject", then you can also use an exclusive gateway to perform the conditional branching logic. See this example image: http://imgur.com/AhePz
Regards.
Daniel -
How to apply business rule over report level
Hi All,
I have a column name AAA over which i have to apply a business rule/filter like
COUNT(“X Fact”." ID") WHEN “X Fact”.”Time to Issue Policy” <= 2 days at report level.How to apply that?any idea?
Regards,
SonalHi,
Thanks for responce.
Yes my AAA col is measure column coming frm Order Fact table (i.e AAA= "Order Fact"."Number of Order") & below is Business rule which I have to apply there
COUNT(“Order Fact”."Order ID") WHEN “Order Fact”.”Time to Order” <= 3 days.How Can I apply this logic there at report level.Plz help?
Regards,
Sonal -
BPC NW - Error in Business Rule for Account transformation rule table
hi
I have given the Account transformation Rule to move Amount from Account A to Account B and then I have given the following script logic in the default script
**RUN_PROGRAM CALC_ACCOUNT*
*CATEGORY = Category*
*CURRENCY = RptCurrency*
*TID_RA = %TIME_SET%*
*CALC=A*
*OTHER = ENTITY=C1000*
**ENDRUN_PROGRAM*
But when I try to load data through Input schedule in Account A and expect amount to transfer to Account B, I m getting an error
Book Name:Book4
Application : PLANNING*
Status : Failed*
Submitted Count : 1*
Accepted Count : 1*
Rejected Count : 0*
- Error Message -*
Error running default logic (Business rules are not available)
- Rejected record list -*
Error converting records: The root element is missing.
Can someone please advice me what to do ....hi Marcel,
Lot of thanks for your answer.
But I have used your logic after removing GROUPS as I dont have GROUPS dimension in my application.
*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = %CATEGORY_SET%
TID_RA = %TIME_SET%
CALC=FX
OTHER = [ENTITY=%ENTITY_SET%]
*ENDRUN_PROGRAM
This is the error I m getting
Book Name:Book3
Application : PLANNING
Status : Failed
Submitted Count : 1
Accepted Count : 1
Rejected Count : 0
- Error Message -
Error running default logic (Business rules are not available)
- Rejected record list -
Error converting records: The root element is missing.
Can you please advice
a) Does it mean some issue with my client installation as I dont see these LGF files. I even dont see the data folder in which lgf files are supposed to be present
b) Where to find information for this interface CALC_ACCOUNT? How did you decide to use 'FX' and how do you know which dimensions to use. Like I dont have GROUPS.
Please give me your comments.
regards
Gaurav
Maybe you are looking for
-
Oracle.jbo.NoDefException: JBO-25002 when deploying ADF application
Hi all! In our ADF application the below error occurs once we deploy the application to a SOA server cluster. This error does not occur when testing the application on the integrated Weblogic. The error also occurs only for one of the jspx pages in o
-
Hi I have a selfexecutable jar-file. It runs fine until it needs to check an existence of a certain file. It also has to check the size of that file. How can it be done, since the file is also in the jar? Thanks
-
Hi, I have maintained Service tax condition record for the combination of Vendor/Plant/Material group. If I create PO without Item category 'd', system picking the condition record. But if i prepare with Item category 'd', system is not picking the
-
I can not find this answer by searching the web nor the messages on this list. Is it possible to organize or "order" the styles which are listed in the Styles Panel. It seems that the order is the order in which they are created. I would like to drag
-
Hi, anyone have implemented an iView for footer menu with a drop up menu? My menu is affected from some conflicts with javascript for drop up and javascript described in "Best Practices for Changing the Portal Look and Feel" ("Footer iView in Framewo