MarcelVreuls.Com

Certified Oracle E-Business Consultant and Microsoft .NET developer (General Ledger, Recevables, Payables, Advanced Pricing, Fixed Assest, Dataload, Budget, APRO, Clear2pay, PL/SQL, API

Boxing and UnBoxing, the .NET way

In this article I will explain the concepts of Boxing and UnBoxing. C# provides us with Value types and Reference Types. Value Types are stored on the stack and Reference types are stored on the heap. The conversion of value type to reference type is known as boxing and converting reference type back to the value type is known as unboxing.

Let me explain you little more about Value and Reference Types.

Value Types
Value types are primitive types that are mapped directly to the FCL. Like Int32 maps to System.Int32, double maps to System.double. All value types are stored on stack and all the value types are derived from System.ValueType. All structures and enumerated types that are derived from System.ValueType are created on stack, hence known as ValueType.

Reference Types
Reference Types are different from value types in such a way that memory is allocated to them from the heap. All the classes are of reference type. C# new operator returns the memory address of the object.

Examples
Lets see some examples to have a better understanding of Value Types and Reference Types. Since we know that all ValueTypes are derived from System.Valuewe can write something like this:

System.ValueType r = 5;So what do you think about the above line of code. Will it compile ? Yes it will compile. But wait what type is it cause I don’t remember any type which is called System.ValueType since its a base class from which all value types inherit. So is it Int32, Int64,double, decimal etc. It turns out that the type for variable ‘r’ is System.Int32. The Question arrises why Int32 and why not Int16. Well its because it is mapped to Int32 by default depending upon the Initial value of the variable.

You cannot write something like this since System.ValueType is not a primitive type its a base class for primitive value types and these mathematical operations can be performed on primitive types.

System.ValueType r = 10;
r++;In the above example I told you that variable ‘r’ will be a System.Int32 variable but if you don’t believe me than you can find out yourself using the GetType() method:

System.ValueType r = 5;
Console.WriteLine(r.GetType()) // returns System.Int32; Here are few samples you can try on your own:

——————————————————————————–
System.ValueType r = 23.45;
Console.WriteLine(r.GetType()); // what does this print
//——————————————————-
System.ValueType r = 23.45F;
Console.WriteLine(r.GetType()); // What does this print
//——————————————————-
System.ValueType r = 2U;
Console.WriteLine(r.GetType()); // What does this print
//——————————————————-
System.ValueType r = ‘c’;
Console.WriteLine(r.GetType()); // What does this print
//——————————————————-
System.ValueType r = ‘ac’;
Console.WriteLine(r.GetType()); // tricky
//——————————————————-
System.ValueType r = “Hello World”;
Console.WriteLine(r.GetType()); // tricky

——————————————————————————–

Boxing
Lets now jump to Boxing. Sometimes we need to convert ValueTypes to Reference Types also known as boxing. Lets see a small example below. You see in the example I wrote “implicit boxing” which means you don’t need to tell the compiler that you are boxing Int32 to object because it takes care of this itself although you can always make explicit boxing as seen below right after implicit boxing.

——————————————————————————–
Int32 x = 10;
object o = x ; // Implicit boxing
Console.WriteLine(“The Object o = {0}”,o); // prints out 10
//———————————————————–
Int32 x = 10;
object o = (object) x; // Explicit Boxing
Console.WriteLine(“The object o = {0}”,o); // prints out 10

——————————————————————————–

Unboxing
Lets now see UnBoxing an object type back to value type. Here is a simple code that unbox an object back to Int32 variable. First we need to box it so that we can unbox.

Int32 x = 5;
object o = x; // Implicit Boxing
x = o; // Implicit UnBoxing

So, you see how easy it is to box and how easy it is to unbox. The above example first boxs Int32 variable to an object type and than simply unbox it to xagain. All the conversions are taking place implicitly. Everything seems right in this example there is just one small problem which is that the above code is will not compile. You cannot Implicitly convert a reference type to a value type. You must explicitly specify that you are unboxing as shown in the code below.

Int32 x = 5;
object o = x; // Implicit Boxing
x = (Int32)o; // Explicit UnBoxing

Lets see another small example of unboxing.

Int32 x = 5; // declaring Int32
Int64 y = 0; // declaring Int64 double
object o = x; // Implicit Boxing
y = (Int64)o; // Explicit boxing to double
Console.WriteLine(“y={0}”,y);

This example will not work. It will compile successfully but at runtime It will generate an exception of System.InvalidCastException. The reason is variable x is boxed as Int32 variable so it must be unboxed to Int32 variable. So, the type the variable uses to box will remain the same when unboxing the same variable. Of course you can cast it to Int64 after unboxing it as Int32 as follows:

Int32 x = 5; // declaring Int32
Int64 y = 0; // declaring Int64 double
object o = x; // Implicit Boxing
y = (Int64)(Int32)o; // Unboxing and than casting to double
Console.WriteLine(“y={0}”,y);

I am sure that you all have grasp the basic understanding of Boxing and Unboxing. Happy Coding and practice a lot !

Application Management Pack and Application Change Management Pack 3.1 Now Available

a new version of of Application Management Pack 3.1 and Application Change Management Pack 3.1 for Oracle E-Business Suite had been released earlier this year.

Application Management Pack (AMP) and Application Change Management Pack (ACMP) extend Oracle Enterprise Manager Grid Control 10g to monitor and manage Oracle E-Business Suite components and the changes the system undergoes.

Oracle E-Business Suite Release Management Packs 3.1 (AMP-ACP 3.1) (Patch 8333939)

Application Change Management Pack provides features to monitor and manage Oracle E-Business Suite changes. Application Change Management Pack provides a centralized view to monitor and orchestrate changes (both functional and technical) across multiple Oracle E-Business Suite systems.

Application Management Pack for Oracle E-Business Suite extends Enterprise Manager Grid Control to monitor and manage Oracle E-Business Suite systems.
(more…)

EBS 12.1.1 Test Starter Kit now Available for Oracle Application Testing Suite

Ever discussed automated testing tools for the E-Business Suite several times on this blog, since testing is such a key part of everyone’s implementation lifecycle. An important part of our testing arsenal in E-Business Suite Development is the Oracle Application Testing Suite. The Oracle Application Testing Suite (OATS) is built on the foundation of the e-TEST suite of products acquired from Empirix in 2008. The testing suite is comprised of:

1. Oracle Load Testing for scalability, performance, and load testing
2. Oracle Functional Testing for automated functional and regression testing
3. Oracle Test Manager for test process management, test execution, and defect tracking

Oracle Application Testing Suite 9.0 has been supported for use with the E-Business Suite since 2009. I’m very pleased to let you know that our E-Business Suite Release 12.1.1 Test Starter Kit is now available for Oracle Application Testing Suite 9.1. You can download it here

Oracle Application Testing Suite Downloads

Use the functional administrator responsibility for clearing application cache

Every needed a memory cleanup but no sysadmin or dba available or willing :-) . You can do it through the application

1- Navigate to Functional Administrator Responsibility
2- Choose the “ Core Services” Tab
3- Choose “Caching Framework”
4- Click on “Global Configuration”
5- Click on “Clear All Cache”
6- The Click on yes on the display which will appear.

Change Sysadmin Password from backend

As you very much aware that you can change SYSADMIN password using FNDCPASS utility
FNDCPASS apps/appspwd 0 Y system/manager USER SYSADMIN sysadminpwd

Here I am giving another way to change the SYSADMIN password and Application User Login passwords using fnd_user_pkg from backend. Here is the procedure

sql> declare
var_l boolean;
begin
var_l=fnd_user_pkg.change_password(’sysadmin’,’sysadminpwd’);
end;
sql> PL/SQL Procedure Successfully Compiled.
You can verify from backend that password has changed successfully or not without login to the application.

sql>select fnd_web_sec.validate_login(’sysadmin’,’sysadminpwd’) from dual;
should returns ‘Y’.

Display Oracle background processes in Windows

Question: I knows how to use the “ps -ef” command in UNIX to see my Oracle background processes but I don’t know how to see the background processes in Windows. When I view Oracle processes on Windows, all I see is one background process called oracle.exe. How do you see details on the Oracle background processes on Windows?

Answer: In Windows, the “thread” model is used, and Oracle dispatches his own background tasks within the domain of the single process, oracle.exe.

Hence, you cannot see any background processes from the Windows OS (but you can see listener process and parallel query slaves). To see detauls about the background processes in Windows, you need to run a dictionary query against the v$bgprocess view to see what the background processes are doing in Windows:

set lines 200

select
a.sid,
a.serial#,
a.program,
p.pid,
p.spid,
a.osuser,
b.name,
b.description.
p.pga_used_mem
from
v$session a,
v$process p,
v$bgprocess b
where
a.paddr=b.paddr
and
a.paddr=p.addr
and
p.background=1
;

Please note that this inability to see the Oracle background processes in Windows is actually a benefit because Oracle leverages on the thread model in Windows, In UNIX, the OS dispatches and manages the background tasks, but within Oracle on Windows, Oracle is able to manage the background task activity directly.

De voordelen van Ubunto (dat ik dat ga zeggen :-(

U heeft misschien nog nooit van Ubuntu gehoord, maar toch is het echt de moeite waard om er iets over te weten te komen. Ubuntu is een besturingssysteem, net zoals Windows 7 of Macintosh. Het is een vorm van Linux. Toch zijn er grote verschillen. Het grootste verschil is dat Ubuntu OpenSource is. dit brengt vele voordelen met zich mee.

Ubuntu is een Zuid-Afrikaanse ethische ideologie die de nadruk legt op de communicatie en relatie met elkaar. Het woord komt uit de Zulu- en Xhosatalen. Ubuntu wordt gezien als een traditioneel Afrikaans concept, wordt gezien als een van de basisprincipes voor de nieuwe republiek van Zuid-Afrika en is verbonden met het idee van de Afrikaanse Renaissance. Een ruwe vertaling van het Ubuntu-principe is: “medemenselijkheid”. Een andere vertaling zou kunnen zijn: “de overtuiging dat delen met elkaar een universeel verbond schept dat de gehele mensheid bindt”.

“Een persoon met ubuntu is open en staat klaar voor anderen, geeft erkenning, voelt zich niet bedreigd wanneer anderen capabel of beter zijn, want hij of zij bezit de zelfverzekerdheid die ontstaat door de wetenschap dat hij of zij deel uitmaakt van een groter geheel, en voelt zich gekleineerd wanneer anderen vernederd of gekleineerd worden, wanneer anderen gemarteld of onderdrukt worden.” Dit zijn de woorden van aartsbisschop Desmond Tutu.


De voordelen:

1. Veiligheid: Geen antivirussoftware nodig en toch heel veilig.
2. Goedkoop: Na de aankoop van een Ubuntu-cd-rom kunt u bij wijze van spreken op elke computer die u tegen komt Ubuntu installeren. Er is geen licentie nodig. Dat geldt ook voor de honderden programma’s die u heel makkelijk (alleen internet nodig) in Ubuntu kunt installeren.
3. Snelheid: Binnen een minuut aan de slag gaan is geen probleem bij Ubuntu. Ook de programma’s werken razendsnel. U hoeft uw computer nooit meer te defragmenteren, en een steeds trager wordende pc is verleden tijd.
4. Compatibiliteit: Het besturingssysteem is ook goed bruikbaar op oudere computers. Zonde om ze weg te gooien! Bovendien herkent het systeem vrijwel alle hardware direct. De cd-roms van alle apparaten kunnen achterwege blijven.
5. Vrijheid: Alles in het systeem is aan te passen naar uw eigen smaak. Met een simpel menu ontvangt u bijvoorbeeld updates en nieuwe toepassingen.
6. Makkelijk: Natuurlijk zal het even wennen zijn, maar u zult ontdekken dat Ubuntu heel logisch in elkaar zit. Kiezen voor Ubuntu is kiezen voor gebruiksgemak.
7. Vrijblijvend: Ubuntu cd-roms zijn gratis te krijgen, maar ook zelf te branden. Met zo’n cd-rom kun je het besturingssysteem eerst uitproberen, zonder dat er iets geïnstalleerd wordt! Daarna is er de mogelijkheid om dat wel te doen.

De nadelen:
Die vraag zou iedereen zich moeten stellen. Er zijn maar een paar redenen waarom het beter is om Windows te blijven gebruiken. Hieronder de belangrijkste.

1. Games: Ben je een hardcore gamer, dan is het beter om met Windows spelletjes te spelen. Ze zijn er bij Ubuntu ook wel (gratis), maar ze zijn niet zo goed.
2. De hardware van je computer wordt nog niet ondersteund door Ubuntu.
3. Je hebt hele speciale software nodig die alleen werkt in combinatie met Windows.

Pricelist and Pricing Context

In order to automatically determine the price applicable for a certain customer, products are setup on a pricelist.

Oracle Pricing Manager > Price Lists > Price List Setup

The following Pricelists are currently defined in our example :

Name

Description

Currency

Round to

Payment Term

Standard Customer  (incl. VAT)

Standard Customers (including VAT)

EUR

-2

B1

This pricelist is used for the regular process. So all Quotes, Orders derive the price of this pricelist.

Service

Service Prijslijst

EUR

-2


This pricelist is used by Field Service.

Dummy Pricelist

Pricelist for 0 pricing

EUR

-2



Items can appear on the pricelist multiple times with different prices within the same period. In order to determine when which price should be applicable pricing attributes are used.

For the Standard Customer Pricelist the following Pricing Contexts (linked to the Price List line by Pricing Attributes) are setup and used:

  • Project Code: Referst to the project codeof the location of the Customer’s Connection ;
  • Line Type; Refers to the line type
  • Additional Characteristic;
  • Pricing Type; Referst to the extended attribute of the location of the Customer’s point.
  • Connection class; Referst to the extended attribute of the location of the customer’s connection point
  • First Line; Refers to whether the product PHONE is the first line or the second.
  • First Line Parent; Refers to whether the PHONE this product is linked to is the first line or the second.


How Customer value scoring works within EBS

You can use any value of your customers to apply the appropriate collections method. For example you can use

  • The total amount of open transactions
  • The number of transactions which are overdue
  • How long a customer is customer at your business.

These 3 components will be used in the customer scorings engine. For some components a high number means your are dealing with a good customer, but in other cases a low number is better. For example

  • The total overdue amount – low number is better
  • The number of invoices overdue – low number is better
  • How long is the customer customer – a higher number is better.

To qualify the numbers returned by the scoring compents, break down the possible value results into ranges and assign a value or score to each range. See picture below.

Scoring in Oracle Advanced Collections

Advanced Collections uses scoring for two purposes

  • Determination which transactions are deliquent
  • Assign a value to the customer, account, lease or bill to

There are several concurrent programs calculate the score. The way the score is calculate is for your own judgement / business rules. The scores are used to

  1. Determine the status (current or delinquent) of the transactions
  2. Determin the best collections strategy or dunning plan to use for the transaction or customer. it depends on your setup if you use collections on a transaction or on customer base. Each collection strategy has a minimum and maximum score value.
  3. Display the customer Score in the collections header

Scoring forms the foundation of the collections activities. When scoring transactions, collections looks at transactions within oracle receivalbles, including invoices, debit memos, chargebacks, In general you can say if a customers has delinquent transactions, the customers is considered to be delinquent.