-->

Wednesday, 30 April 2014

A Guide for Beginners to learn Structured Query Language (SQL)

Structured Query Language (SQL)

SQL is a standard language for accessing and manipulating databases.


What is SQL?

  • SQL stands for Structured Query Language
  • SQL lets you access and manipulate databases
  • SQL is an ANSI (American National Standards Institute) standard


What Can SQL do?

  • SQL can execute queries against a database
  • SQL can retrieve data from a database
  • SQL can insert records in a database
  • SQL can update records in a database
  • SQL can delete records from a database
  • SQL can create new databases
  • SQL can create new tables in a database
  • SQL can create stored procedures in a database
  • SQL can create views in a database
  • SQL can set permissions on tables, procedures, and views

SQL is a Standard - BUT.... Although SQL is an ANSI (American National Standards Institute) standard, there are different versions of the SQL language.

However, to be compliant with the ANSI standard, they all support at least the major commands (such as SELECT, UPDATE, DELETE, INSERT, WHERE) in a similar manner.


Using SQL in Your Web Site

To build a web site that shows data from a database, you will need:
  • An RDBMS database program (i.e. MS Access, SQL Server, MySQL)
  • To use a server-side scripting language, like PHP or ASP
  • To use SQL to get the data you want
  • To use HTML / CSS

RDBMS

RDBMS stands for Relational Database Management System.

  • RDBMS is the basis for SQL, and for all modern database systems such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.
  • The data in RDBMS is stored in database objects called tables.

Database Tables

A database most often contains one or more tables. Each table is identified by a name (e.g. "Customers" or "Orders"). Tables contain records (rows) with data.

In this tutorial we will use the well-known Northwind sample database (included in MS Access and MS SQL Server).

Below is a selection from the "Customers" table:

CustomerIDCustomerNameContactNameAddressCityPostalCodeCountry
1Alfreds FutterkisteMaria AndersObere Str. 57Berlin12209Germany
2Ana Trujillo Emparedados y heladosAna TrujilloAvda. de la Constitución 2222México D.F.05021Mexico
3Antonio Moreno TaqueríaAntonio MorenoMataderos 2312México D.F.05023Mexico
4Around the HornThomas Hardy120 Hanover Sq.LondonWA1 1DPUK
5Berglunds snabbköpChristina BerglundBerguvsvägen 8LuleåS-958 22Sweden

The table above contains five records (one for each customer) and seven columns (CustomerID, CustomerName, ContactName, Address, City, PostalCode, and Country).

Ref: http://www.w3schools.com/sql/sql_syntax.asp

SQL Statements


Most of the actions you need to perform on a database are done with SQL statements.
The following SQL statement selects all the records in the "Customers" table:

SELECT * FROM Customers;
The above Query will list all the Rows & Columns in the Database Table.

Simulator: http://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all


Keep in Mind That...

SQL is NOT case sensitive: select is the same as SELECT
In this tutorial we will write all SQL keywords in upper-case.

Semicolon after SQL Statements?

  • Some database systems require a semicolon at the end of each SQL statement.
  • Semicolon is the standard way to separate each SQL statement in database systems that allow more than one SQL statement to be executed in the same call to the server.
  • In this tutorial, we will use semicolon at the end of each SQL statement.

Some of The Most Important SQL Commands

  • SELECT - extracts data from a database
  • UPDATE - updates data in a database
  • DELETE - deletes data from a database
  • INSERT INTO - inserts new data into a database
  • CREATE DATABASE - creates a new database
  • ALTER DATABASE - modifies a database
  • CREATE TABLE - creates a new table
  • ALTER TABLE - modifies a table
  • DROP TABLE - deletes a table
  • CREATE INDEX - creates an index (search key)
  • DROP INDEX - deletes an index

SQL SELECT Statement

The SELECT statement is used to select data from a database.
The result is stored in a result table, called the result-set.

SQL SELECT Syntax

SELECT column_name,column_name FROM table_name;
&
SELECT * FROM table_name;

Tuesday, 22 April 2014

Basic Setups on Purchase & Order Management Module



Basic Setups on Purchase & Order Management Module

Purchase Module: 

1. Personnel

Define EmployeesDefine JobDefine PositionDefine Position HierarchyDefine Buyer


2. Approvals

Define Approval Assignments
Define Approval Group


3. Organization

Receiving Option
Financial Option
Purchasing Option

4. Create Document Types
5. Create Supplier

Order Management Module:

1. Define OM System parameters
2. Define System Options
3. Define Customer profile classes
4. Define Payment terms
5. Define Transaction Type:
Define line types
Define order types

6. Define Price list
7. Define Customer
8. Define Picking rule
9. Define Global Parameter
10. Define Document sequence
Assign the Documents

11. Define Release Sequence Rule
Picking
Setup

12. Define Release rule
13. Define Pick slip grouping rule
14. Define Grants and role definition

Courtesy : Mr. CS Boopathy

Tuesday, 15 April 2014

Different Receiving Options


Different Receiving Options


We can use different methods for receiving goods in our subinventories

1.) Allow Substitute Receipts: It is used in case our supplier sends us a substitute item. It means we have ordered for item A but we have received item B.

Define relationship between items. Navigate to Items > Item Relationships à Click on New & give details as shown below




It means that we can receive VS ASL Item1 instead of VS ASL Item 2

Now navigate to Setup > Organizations > Receiving Options & check the Allow Substitute Receipt checkbox  & save the record




This option can be over written at PO level

Next is to create a PO. While creating a PO, we can overwrite the ‘Allow Substitute Receipts’ option


Save & approve the PO





Now navigate to Receiving > Receipts




Here we can see that item field is enabled & if we wish, we can change the item details


Save the record.



2.) Allow Unordered Receipts: When we go for Allowed Unordered Receipts then goods will be sent to us without a PO. But these goods can only be sent till receiving. If we wish to transact these goods to sub inventory then a PO is required.

Navigate to Setup > Organizations > Receiving Options

Check the ‘Allow Unordered Receipts’ checkbox & save the record

Now navigate to Receiving > Receipts à Click on Unordered & give details as shown below (Here we need to give each & every detail manually)






A Receipt number will be generated at Header level.

Now check the Receiving Transaction Summary. Navigate to Receiving > Receiving Transaction Summary à Search by receipt number


Here Transaction Type is Unordered Receipt

Next step is to create a PO. The Receipt Routing for this PO can be either Standard or Inspection (Because a Direct PO will send the goods directly to sub inventories)



Save & approve the PO



Now Navigate to Receiving > Match Unordered Receipts & give details as shown below




Now again Navigate to Receiving Transaction Summary form



Here we can see that the receipts are matched with PO.

Till now goods are in Receiving area. We need to move these goods to Sub Inventory. Navigate to Receiving > Receiving Transactions

Give Sub Inventory details & save the record


Again Navigate to Receiving Transaction Summary form



We can see that the goods are now moved to subinventory

3.) Express Transaction: It is used when the receipt routing method is Inspection but due to some business requirement, we do not want our goods to be inspected. Means they should be directly sent to subinventories


Navigate to Setup > Organization > Receiving Options




Check the ‘Allow Express Transactions’ checkbox & save the record

Now create a PO with Receipt Routing as Inspection Required & give subinventory details in Distribution Tab





Save & Approve the PO



Now Navigate to Receiving > Receipts à Here we can see that Express option is enabled. If we make any changes in the receipt. This option will be disabled so without making any changes click on Express



& save the record



4.) Cascade Transactions: In such transactions the quantity which is not fulfilled in first shipment will be fulfilled in subsequent shipments.

Navigate to Setup > Organizations > Receiving Options à Check Allow Cascade Transaction Check Box



Next is to create a PO. Navigate to Purchase Orders > Purchase Orders & give details as shown below






Save & approve the PO



Navigate to Receiving > Receipts à Give PO & Line Number in search criteria



We can see that Cascade Tab is enabled. Click on Cascade & give details as shown below






Give sub inventory details & save the record. Requery & you can see the price has been adjusted




5.) Blind Receiving: This option is used when we want our receipts to show 0 quantity no matter whatever is the quantity mentioned in PO. The purpose behind it is to count the goods once they arrive in your inventory & enter the quantity manually

Create a PO



Check receipt for this PO



Right now we are able to see the quantity in receipts. Now navigate to Setup > Organizations > Receiving Options àCheck Allow Blind Receiving checkbox



Now again check the receipt



Now we can see that the quantity is 0. Quantities will be counted & then entered into the receipts

Tuesday, 11 March 2014

iProcurement Setup


iProcurement Setups [not BR100]

Written by Anil Passi   - 
Sunday, 26 November 2006

Information brought to this site ONLY for INFORMATIONAL PURPOSE!
Ref: http://oracle.anilpassi.com/iprocurement-setups-not-br100.html


This is not a comprehensive BR100, but this article will give you an outline of the steps to implement Oracle iProcurement using Punchouts.
I will try to cover as many steps for full cycle iProcurement implementation using Punchouts. This is due to email requests & the comment requests that I received to write something on iProcurement implementation.
What is a punchout?In your iProcurement homepage, your suppliers can raise requisition to buy items like stationary. By punchout, we integrate iProcurement with Suppliers website. From a users perspective below steps take place:-
1. Buyer logs into iProcurement Homepage
2. Buyer then sees various suppliers for which punchouts are enabled [depending on their security via realm & secured attributes]
3. Buyer clicks on a stationary supplier and browser displays supplier’s website.
4. Buyer selects the items on supplier website and adds them to his cart.
5. Buyer checks out the basket from Suppliers iStore [website]
6. The items selected are brought in as “Shopping Basket in iProcurement”
7. Requisition is created in iProcurement and sent for Approval [can be auto approved].


Typical iProcurement Steps [assuming no encumbrances setup] a. Create Requisition
b. Approve Requisition
c. Auto-create & auto-approve Purchase Orders for approved requisitions.
d. Send PO XML to Supplier [if approver is setup as trading partner for XML PO]
e. Create receipts for goods [optional depending on setup]
-----Other non iProc steps----
f. Supplier sends Invoice electronically [posts to your XML Gateway electronically]
g. Invoice is Matched, Approved & Paid
Account Generation for iProcurement Requisition
Decide the rules for your account generation. For this you will need to customize “PO Requisition Account Generator”. For details of account generator implementation visit link Account Generation using Workflow .
You may also visit Rebuilding Generated Account in iProcurement 11.5.10 using OA Framework

PO Create Documents WorkflowIn iProc you create Requisitions, which then get converted to a Purchase Order using workflow “PO Create Documents”.
In this workflow, you must examine & modify the default values of following attributes[sample defaults values listed below]:-
            Is Automatic Creation Allowed  -- Y
                        Should PO be created from iProc requisition without user intervention.
            Is Automatic Approval Allowed – Y
            Should Contract be used to auto create Doc  Y
            Should non-catalog request be auto sourced from contract  Y
            Is Contract Required on Requisition Line  N
There could be other attributes of your interest, but my implementation involved usage of contracts to create Purchase Orders. We have a blanket contract against each iProc supplier. The values above for those attributes are merely indicative of one scenario.

PO Requisition Approval Workflow
Similarly for workflow “PO Requisition Approval”, assign a default value for attribute
            Send PO Auto-creation to Background N

Image
This means, as soon as a Requisition is approved, the creation of Purchase Order is kicked off [rather than wait for workflow background process]

Charge Account Flexfield Display-Prior to 11.5.10
If you are not on 11.5.10, then you would be using AK Developer.
Prior to 11.5.10, You will modify below AK regions to enable region items POR_CHARGE_ACCT_SEG1...X [depending upon the number of segments in your accounting flexfield.]
POR_BILLING_CHARGE_ACCOUNT_R
POR_BILLING_MULT_CHARGE_AC_R
You will also set the profile options to relate to those regions for Accounting KFF
POR: Edit Account Regions: POR_BILLING_CHARGE_ACCOUNT_R
POR: Multiple Account Regions: POR_BILLING_MULT_CHARGE_AC_R


Charge Account Flexfield Display-On or after 11.5.10
You can use personalization to decide which segments are visible in Accounting Flexfield in iProc. Hence you no longer have to touch the “AK Developer”



Indicative Profile options for iProcurement [Assuming punchout implemented & no local hosting of catalogs]
Profile
Site
Note
Indicate Attachments
Yes
Show attachment icon
INV: Dynamic Precision Option
-9999990

PO: Terms and Conditions File Name
No need for Punchouts

MO:  Operating Unit
Your operating Unit

ICX:  Days Needed By
4 --Change as you  desire

ICX:  Override Location Flag
Yes

ICX:  Override Requestor
By All

ICX: Allow Funds Override
No

POR:  Amount Based Services Line Type
Services

POR:  Approved Pricing Only
No

POR : CA Certificate File Name
In ApacheTop/conf/ssl.crt/ca-bundle.crt
Used for https punchout
POR: Emergency Requisitions Restrict To Templates
No

POR:  Goods Line Type
Goods

POR: Override Supplier P-card
No

POR:  Parallel Routing Allowed
No

POR : Proxy Server Name

Leave this blank
POR : Proxy Server Port

Leave this blank
POR:  Rate Based Services Line Type
Service Quantity

POR: Sort By Relevance
No

POR:  System Approvers Are Mandatory
Yes

POR:  Use Sequence for Requisition Numbering
No

POR: Catalog Bulk Load Directory

Ignore for punchout
POR: Catalog Bulk Load Host
Default
Ignore for punchout
POR:  Default Currency Conversion Rate Type
Corporate
Change as you wish
POR:  Edit Accounts Regions
POR_BILLING_CHARGE_ACCOUNT_R

POR:  Enable Requisition Line Customisation
Yes

POR: Extract BPA/Quote Images
Yes

POR: Help Path
DBA
For help customisations
POR:  Hosted Images Directory

Ignore for punchout
POR: Items Display Num


POR:  Load Auto Category
No

POR:  Multiple Accounts Region
POR_BILLING_MULT_CHARGE_AC_R
 Prior to 11.5.10
POR:  One Time Location


POR: Purge Commit Size
2500

POR:Purge Jobs Older Than (days)
30

POR:  ROWS DISPLAY NUM


POR:  Result Set Size
10

POR:  SSP Version
5

POR:  SSP4 Installed
Yes

POR: Select Internal Requisition for Confirm Receipt
No

POR:  Select Inventory Replenishment Lines for Confirm Receipt
No

POR:Allow Manual Selection of Source
Yes

POR:Display Search Box and Browse Categories
No

POR:  Load Auto Attrib
No

POR:  Load Auto Root
No

ECE: Output File Path
$XXICX_TOP/out

ECX: Log File Path
/usr/tmp

ECX: OAG_LOGICALID
Your company domain
ECX: Server Time Zone
GMT

ECX: System Administrator Email Address

ECX: XSLT File Path
/usr/tmp

PO:  Workflow Processing Mode
Online

RCV:  Processing Mode
On-line

PO: In File Path
No need for Punchouts



Define Approval Groups
Define Approval Groups [In Purchasing super User]
For example, assuming the below approval groups is assigned to Buyer named Anil Passi, this approval group means that Anil Passi can work on documents upto  $5000, within all accounting range of Company and Cost Centre [because 00 to ZZ covers everything].
Similarly you may also exclude a range. In this implementation example, I am assuming one Approval Group per person. You could have one to many relation too.
Image
Once you have defined Approval Groups, you can  use Approval Assignments screen to assign approval rules to Positions or Jobs defined in HRMS.



Assign Approval Group
Effectively in this screen, you give ability to your buyers to Approve different document types like Requisitions, Blankets, Contracts within the restrictions as they were defined in Approval Groups(prior step)

Image

Define Document Types
The different attributes are self explanatory. Refer to Metalink for details.
The example in screenshot displays Document type for Purchase order, but the setup must be configured for other Document Types being used too.
Image


Define Line Types

You can define the default information for a line type. Line types can identify transactions involving goods, services, outside processing, or any line type you define. They allow you to distinguish between quantity-based and amount-based transactions.
Image

Note: When you have set the Line Types up you can go back and complete these  Profiles Options, as in screenshot  below:
Image


Define Financial OptionsIn this screen, some of the fields are used for defaulting and some other fields for defining the behaviour of iProcurement/Purchasing. The setup here is done per Operating Unit. Here within Accounting Tab, you specify accounts like Liability, Prepayment, Discount accounts.
Also Specify the following here  - Whether supplier numbering is manual or automatic.
  - Default payment terms for [say  1month], and default payment type like Electronic.
  -Specify FOB, Default inventory location and ship to and bill to, freight etc
  -Encumbrance :- specify whether you use encumbrance and the type
  - Default tax code
  -VAT registration number of Operating unit
Define Purchasing OptionsAgain, this screen is defined per Operating unit, and it drives defaults & various controls in Purchasing & iProcurement.
Specify various controls like Min release amount , Price Break Type, Price Type(say fixed).
Define Accrual rules and Expense AP accrual account.
Define price tolerance rules, tax defaults & document type numbering.


Define Receiving OptionsVarious receipts related setup per Operating Unit, like Tolerance, Substitute Receipt Allowed.


Define transaction reasonsYour client specific setup, refer Metalink. Primarily this is an inventory function.


Define locationsThe locations/Office Address where your suppliers will deliver goods and also send invoices.


Define Employees          Use this screen in PO if you do not have full HRMS Suite installed, in which case you would be using shared HR installed [cutdown version of HRMS to support Purchasing].


Define BuyersDefine the people that can use Application to create and approve documents.


Category Search DisplayNot needed for punchout implementations.


“XML Gateway” responsibility: Define HubsUse this form to define the hubs via which XML documents will be sent & received. If you are using Exchange for punching out, then your setup will look like below

Image

XML Gateway Responsibility: Define Transactions
Here you indicate, the type of Documents you wish to exchange with your suppliers using XML

Image

XML Gateway Responsibility: Define Trading Partner
In this screen you will create a record for each Supplier with whom you wish to exchange XML Documents electronically.
For example, if you wish to send XML Purchase Orders to “Go 4 Gold Management Ltd”, then you will create an entry similar to below. The connection can either be direct or via exchange server.
Image

You will also capture trading party’s DUNS numbers in this screen.
During the implementations you usually use testexchange.oracle.com.
The DUNS number for the supplier also needs to be entered in the EDI Location field against supplier site in Vendor Definition Screen.

The DUNS number for your implementation client needs to be entered in the EDI Location field on Other Details section of Location form for Client location[lets say your client for which iProc is being implemented is “XX Machine Inc”].
Process PO 007 is an OAG standard that dictates the structure of XML document which your supplier will receive.
For those that do not know, PO007 is nothing but an Approved Purchase Order sent to the supplier. Its format is XML.
To see its structure, on your middle tier, review the dtd file as listed below. $PO_TOP/xml/oag71/003_process_po_007.dtd

Oracle Apps uses XML Gateway to generate the PO-007 file.
How is this PO 007 file generated?FTP the xgm file to you PC from $PO_TOP/patch/115/xml/US/process_po_007.xgm
Open that file in XML Gateway Message designer
You will notice that message designer reads information from views like  ITG_PO_HEADER_ARCH_V  [Prior to 11.5.10 it was PO_ECX_HEADER_ARCH_V]
iProcurement uses the XML Gateway engine in conjunction with PO-007 message definition to generate PO007 XML document.
Configure your Exchange setupGiven that in this setup, we will use Oracle’s exchange server to send PO Documents to supplier, hence we need to enable this Document Type[PO 007] in exchange[for the company implementing iProc]

Logon to exchange.oracle.com or the testexchangeNavigate to Application Setup tab/ Transaction Delivery
Select the document type PROCESS_PO_007 and edit
Set the communication method and click Apply

Your Supplier will have to register on Oracle Exchange Server too.To begin with, during implementation, each  supplier must register themselves on http://testexchange.oracle.com
Your supplier does the below:-Clicks on Registration on testexchange, and selects the option to register as an affiliate of your client.
Say your client is “XX Machine Inc”, hence your supplier will search & select “XX Machine Inc”. Supplier will be prompted to enter further details.
Following this, your client will have to approve the request for Supplier’s registration.
Supplier Enables PROCESS_PO_007 for themselves on the Exchange
The sequence of flow for PO 007 in this case is…
XX Machine Inc-->PO 007-->Exchange server-->Supplier

Hence Supplier needs to enable “PO 007” for themselves on the exchange serverFor this your Supplier does the below steps:-
Login to the testexchange (i.e. exchange.oracle.com  after testing during goLive).
Clicks on Transaction Delivery under Company Administration
Selects Sales Order Outbound (PROCESS_PO_007) [going out  from Exchange, becoming sales order in Suppliers System]
Under transaction type they select delivery method HTTPS etc
They specify their URL on server which where exchange will post the PO 007 XML doc.... https://inboundpo...
They also need to specify other connection details to their server like port number, userid password etc.
Exchange server will use those credentials to connect  and post the XML PO Document[PO 007]
Note: Oracle Exchange supports various protocols like http,https,smtp . The supplier selects a protocol based on the protocols their server supports.

Supplier Enables themselves for PunchOut on the Exchange Server
Oracle supports both cXML ad XML punchouts. Hence the supplier must support one of these two options.
Supplier does the following steps to enable punchouts:-Logs in to TestExchange Server or the Exchange Server
Clicks on “setup punchout”
Enters their punchout URL, userid password for their iStore.
Select XML or cXML and then clicks on APPLY.
Supplier can then test whether their punchout setup works by punching out to their iStore from testexchange/exchange.

”XX Machine Inc” reviews suppliers PunchoutClient “XX Machine Inc” logs into testexchange or exchange server, and navigates to “Control Punchout Access” and accepts Suppliers Punchout definition.


”XX Machine Inc” makes Oracle EBS aware of the Punchout setup
It is possible that with some suppliers, you would like to Punchout to their iStores via exchange, and for the other suppliers you may like to punchout directly to their iStore.
I am detailing both the scenario’s below.

Scenario 1 Use the Supplier punchout definition from Exchange
Navigate to Internet iProcurement Catalog Administrator.

Image
Image

As in picture above, by downloading[click on download], you will bring into Oracle, all the Punchout Suppliers that are enabled for your business in exchange.

Scenario 2 Create Supplier punchout definition directly in Oracle Apps eCatalog Mgr

If  you were not to be using Exchange, then you will have to create the Punchout definition from scratch in Oracle Apps itself.
For this, click on “Manage Content” in responsibility “Internet iProcurement Catalog Administrator”
Click on create catalog

Image
Select Punchout catalog and click on continue
Image
As in picture above, we select Supplier and Direct Punchout.
Given that you are creating Punchout definition of the supplier from scratch straight in Oracle Apps, you then need to enter information in below fields like Punchout URL, Encoding Method, password etc.

Image
Image
NOTE: As you may have noticed, effectively we are trying to create a punchout definition in Oracle Apps…either by downloading the Supplier’s punchout definition from exchange or by directly creating the Punchout definition in Oracle Apps.


Display the punchout site on iProcurement HomepageThis will be the last step. You need to define a store that is attached to the punchout catalog definition.

For this Click on create store in responsibility “Internet iProcurement Catalog Administrator”
Image
This finishes the punch-out setup with your Supplier.
Further notes:-
1. Your suppliers punchout basket may contain items with UOMs that are not defined in Oracle Apps inventory module. In this case, you must navigate to responsibility “eCommerce Gateway” and define those mappings using menu “Code Conversion Values”
2. As per the OAG format, the item category used in punchout baskets is 8 digit UNSPSC code. Effectively UNSPSC code is a global code for item categories. However in Oracle EBS, we implement Item Categories using Key FlexField for Item Categories. For a 3 segment Item category flexfield in inventory, your item category may look like AA.BB.CC. This value of AA.BB.CC must be mapped with the UNSPSC codes that your suppliers will be sending for their item categories. This definition is mapped in the same screen under “eCommerce Gateway”.