Tuesday 3 December 2013

Wedding Query. ....... ........ (SQL Style):

1 comments
HUSBANDS QUERY:
============

CREATE PROCEDURE MyMarriage (
BrideGroom Male (25) ,
Bride Female(20) )
AS
BEGIN

SELECT
Bride FROM india_ Brides
WHERE FatherInLaw = 'Millionaire'
AND Count(Car) > 20 AND HouseStatus ='ThreeStoreyed'
AND BrideEduStatus IN (B.TECH ,BE ,Degree ,MCA ,MiBA) AND Having Brothers= Null
AND Sisters =Null

SELECT Gold ,Cash,Car,BankBalance
FROM FatherInLaw

UPDATE
MyBankAccout
SETMyBal = MyBal + FatherInLaw.BankBalance

UPDATE
MyLocker
SET MyLockerContents = MyLockerContents + FatherInLawGold

INSERT INTO
MyCarShed VALUES('BMW','Rolls Royce')
END;

Then the WIFE writes the below query:
========================

DROP HUSBAND;
Commit;



Ur's
AmarAlam

Tuesday 26 November 2013

Link Between AR,SLA and GL

1 comments
SELECT b.NAME batch_name,
                 b.description batch_description,
                 h.je_category,
                 h.je_source,
                 h.period_name je_period_name,
                 h.NAME journal_name,
                 h.status journal_status,
                 h.description je_description,
                 l.je_line_num line_number   
FROM gl_je_batches b,
             gl_je_headers h,
             gl_je_lines l,
             gl_code_combinations_kfv glcc,
             gl_import_references gir,
             xla_ae_lines xlal,
             xla_ae_headers xlah,
             xla_events xlae,
             xla.xla_transaction_entities xlate,
             ra_customer_trx_all rct,
WHERE b.je_batch_id = h.je_batch_id
AND h.je_header_id = l.je_header_id
AND xlal.code_combination_id = glcc.code_combination_id
AND l.je_header_id = gir.je_header_id
AND l.je_line_num = gir.je_line_num
AND gir.gl_sl_link_table = xlal.gl_sl_link_table
AND gir.gl_sl_link_id = xlal.gl_sl_link_id
AND xlal.ae_header_id = xlah.ae_header_id
AND xlah.event_id = xlae.event_id
AND xlae.entity_id = xlate.entity_id
AND xlae.application_id = xlate.application_id
AND h.je_source = 'Receivables'
AND h.period_name = '2009-10'
AND rct.trx_number = xlate.transaction_number
AND xlate.transaction_number =':P_TRX_NUMBER


Ur's
AmarAlam

Link Between AP,SLA and GL

0 comments
SELECT   c.code_combination_id, h.je_header_id, l.ae_header_id, l.ae_line_num,
         te.source_id_int_1, te.application_id, te.entity_id, h.je_source,
         h.je_category, i.gl_date, s.vendor_name, s.segment1 AS supplier_no,
         l.event_class_code AS event_class, i.invoice_id,
         ad.invoice_distribution_id, i.invoice_num AS transaction_number,
         i.invoice_date, INITCAP (jl.description) description,
         jl.accounted_dr AS debit, jl.accounted_cr AS credit,
         NVL (jl.accounted_dr, 0), NVL (jl.accounted_cr, 0) net_amount
    FROM apps.gl_je_headers h,
         apps.gl_je_lines jl,
         apps.gl_code_combinations c,
         apps.gl_import_references r,
         apps.xla_ae_lines al,
         apps.xla_ae_headers ah,
         apps.xla_distribution_links l,
         apps.ap_invoices_all i,
         apps.ap_invoice_distributions_all ad,
         apps.ap_suppliers s,
         apps.xla_events e,
         apps.xla_transaction_entities te
   WHERE ad.accounting_date BETWEEN :startdate AND :enddate
     AND c.code_combination_id = 6429
       AND ad.line_type_lookup_code = ‘item’
     AND jl.je_header_id = h.je_header_id
     AND jl.code_combination_id = c.code_combination_id
     AND al.gl_sl_link_id = r.gl_sl_link_id
     AND al.ae_header_id = ah.ae_header_id
     AND al.application_id = ah.application_id
     AND ah.application_id = e.application_id
     AND ah.event_id = e.event_id
     AND e.application_id = te.application_id(+)
     AND e.entity_id = te.entity_id(+)
     AND r.je_header_id = jl.je_header_id
     AND r.je_line_num = jl.je_line_num
     AND l.ae_header_id = al.ae_header_id
     AND l.ae_line_num = al.ae_line_num
     AND l.applied_to_source_id_num_1 = i.invoice_id
     AND l.source_distribution_id_num_1 = ad.invoice_distribution_id
     AND ad.invoice_id = i.invoice_id
     AND i.vendor_id = s.vendor_id
ORDER BY i.gl_date DESC


Ur's
AmarAlam

Oracle FNDLOAD Scripts To Migrate AOL Objects

5 comments

Following are the usage list of FNDLOAD to upload and download various AOL objects.

Concurrent Program
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XXCUST_CP.ldt PROGRAM APPLICATION_SHORT_NAME="XXCUST" CONCURRENT_PROGRAM_NAME="XXCUST_CP"

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct XXCUST_CP.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

Lookups
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/aflvmlu.lct XXCUST_LKP.ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME="XXCUST" LOOKUP_TYPE="XXCUST_LKP"

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/aflvmlu.lct  XXCUST_LKP.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

Message
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afmdmsg.lct XXCUST_MESG.ldt FND_NEW_MESSAGES APPLICATION_SHORT_NAME="XXCUST" MESSAGE_NAME="XXCUST_MESG%"

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afmdmsg.lct XXCUST_MESG.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

Request Set and Link

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct XXCUST_RS.ldt REQ_SET REQUEST_SET_NAME='XXCUST_RS'

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct XXCUST_LNK.ldt REQ_SET_LINKS REQUEST_SET_NAME='XXCUST_LNK'


FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct  XXCUST_RS.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct  XXCUST_LNK.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

Form Function

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XXCUST_FUNC.ldt FUNCTION FUNC_APP_SHORT_NAME='XXCUST' FUNCTION_NAME='XXCUST_FUNC'

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afsload.lct XXCUST_FUNC.ldt

Profile


FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct XXCUST_PROF.ldt PROFILE PROFILE_NAME="XXCUST_PROFILE" APPLICATION_SHORT_NAME="XXCUST"

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afscprof.lct XXCUST_FUNC.ldt

Menu

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XXCUST_MENU.ldt MENU MENU_NAME="XXCUST_MENU"

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afsload.lct XXCUST_MENU.ldt

Data Definition


FNDLOAD apps/apps 0 Y DOWNLOAD $XDO_TOP/patch/115/import/xdotmpl.lct XXCUST_DD.ldt XDO_DS_DEFINITIONS APPLICATION_SHORT_NAME=XXCUST DATA_SOURCE_CODE=XXCUST_DS

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afsload.lct XXCUST_DD.ldt


Ur's
AmarAlam

Oracle Order to Cash Queries

1 comments
Query to Join OM and requisition Interface table for Back 2 back Order

SELECT l.line_id, l.flow_status_code , l.open_flag,pr.interface_source_code,pr.interface_source_line_id,pr.note_to_buyer,
pr.note_to_receiver
FROM
oe_order_lines_all l,
po_requisitions_interface_all pr
WHERE l.line_id = pr.interface_source_line_id
AND pr.interface_source_code='CTO'

Query to Join OM and Purchase Order tables for Back 2 Back Order


SELECT ph.segment1,a. supply_source_line_id, a.supply_source_header_id
FROM
mtl_reservations a,
oe_order_lines_all l,
po_headers_all ph
WHERE demand_source_line_id = &Enter_Order_lineID
AND l.line_id = a.demand_source_line_id
AND a.supply_source_header_id = ph.po_header_id

Query to Join OM and PO Requisition table for Back 2 Back Order

SELECT ph.segment1,a. supply_source_line_id, a.supply_source_header_id
FROM
mtl_reservations a,
oe_order_lines_all l,
po_requisition_headers_all pqh
WHERE demand_source_line_id = &Enter_Order_lineID
AND l.line_id = a.demand_source_line_id
AND a.supply_source_header_id = pqh.requisition_header_id

Query to Join OM , WSH and AR table

SELECT h.order_number,l.line_id,l.ordered_quantity,l.shipped_quantity,l.invoiced_quantity,
wdd.delivery_detail_id,wnd.delivery_id,wdd.shipped_quantity,a.org_id,
a.creation_date ,a.trx_number,b.quantity_ordered , b.quantity_invoiced ,b.interface_line_attribute1,b.interface_line_attribute3,
b.interface_line_attribute6,interface_line_attribute12
FROM
ra_customer_trx_all a,
ra_customer_trx_lines_all b,
oe_order_headers_all h,
oe_order_lines_all l,
wsh_delivery_details wdd,
wsh_delivery_assignments wda,
wsh_new_deliveries wnd
WHERE a.customer_trx_id = b.customer_trx_id
AND a.interface_header_context = 'ORDER ENTRY'
AND b.interface_line_attribute1 = to_char(h.order_number)
AND h.header_id = l.header_id
AND to_char(l.line_id) = b.interface_line_attribute6
AND l.line_id = wdd.source_line_id
AND wdd.delivery_detail_id = wda.delivery_detail_id
AND wda.delivery_id = wnd.delivery_id
AND to_char(wnd.delivery_id) = b.interface_line_attribute3

Mapping Between AR and OM (Transaction Flex field)
(RAL) - RA_CUSTOMER_TRX_LINES_ALL

RAL.INTERFACE_LINE_ATTRIBUTE1 Order_Num
RAL.INTERFACE_LINE_ATTRIBUTE2 Order_Type
RAL.INTERFACE_LINE_ATTRIBUTE3 Delivery ID
RAL.INTERFACE_LINE_ATTRIBUTE4 WayBill
RAL.INTERFACE_LINE_ATTRIBUTE6 Line_ID
RAL.INTERFACE_LINE_ATTRIBUTE8 Bill_Lading
RAL.INTERFACE_LINE_ATTRIBUTE10 WH_ID =
RAL.INTERFACE_LINE_ATTRIBUTE11 PA_ID


Ur's
AmarAlam

Wednesday 20 November 2013

Sachin Tendulkar (Thank You Sachin).....!

2 comments
I'm not "The God Of Cricket!! God is not a simple word, It means everything, I'm just a cricketer, God is only one & He is compareless, Request to Fans: Please do not compare me with God. 
--Sachin Tendulker #Respect.


Thank You Sachin.

Ur's
Amaralam

How to get the Distinct Values in TABLE Value set?

2 comments
Method 1

Create the VIEW based on DISTINCT values; use the VIEW for creates the VALUESET.

Method 2

Paste the QUERY in TABLE field with alias name, and give the column name (with alias name).

(For an example):

TABLE: (SELECT  DISTINCT W.NAME,W.TRIP_ID,W.STATUS_NAME,WV.SOURCE_CODE,
WV.RELEASED_STATUS,WV.ORGANIZATION_ID,WV.INV_INTERFACED_FLAG FROM APPS.WSH_DELIVERABLE_TRIPS_V W,APPS.WSH_DELIVERABLES_V WV WHERE W.DELIVERY_DETAIL_ID=WV.DELIVERY_DETAIL_ID) Z

Value: Z.NAME
Id: Z.TRIP_ID



Ur's
AmarAlam

Tuesday 29 October 2013

Formatting Date in Oracle XML(BI) Publisher

26 comments
We can format dates in BI Publishes in the following three different ways,

1. Formatting Date using Microsoft Word’s native date format mask.
2. Formatting Date using Oracle’s format-date function.
3. Formatting Date using Oracle’s abstract date format masks.
4. Format with Calendar.

Lets me now explain little details about the above three ways, and below is the XML I am going to use in the below examples,
1. Formatting Date using Microsoft Word’s native date format mask?
In the BI Publisher Properties window, select type as Date and select the format from the drop down box.
Here is the output sample of all the three types of date’s we had in the XML. Format I selected is
DD-MM-YY.
2. Formatting Date using Oracle’s format-date function.
format-date() is an inbuilt function in BI Publisher.
Syntax:

In the above syntax MASK is an optional parameter. We will see more details about MASK later in this post.

To use this format-date function, under the BI Publisher Properties window -> keep type as Regular Text -> click on Advanced tab –> call format-date function with the tag name. (For time being we will not pass the MASK parameter.)
Here is the output sample of all the three types of date’s we had in the XML.
3. Formatting Date using Oracle’s abstract date format masks.
In this section we will seeing various MASK parameters that can be passed to MASK’
?> function. - See more at: http://flexfields.blogspot.ae/2011/01/bi-publisher-formatting-date.html#sthash.LrUuM9zp.dpuf3. Formatting Date using Oracle’s abstract date format masks.
In this section we will seeing various MASK parameters that can be passed to
Function.

Out of box we have the following MASK available for various format of dates,
Mask Constant                                               Output
SHORT                                                          1/26/11
MEDIUM                                                      Jan 26, 2011
LONG                                                           Wednesday, January 1, 2011
SHORT_TIME                                              1/26/11 8.10PM
MEDIUM_TIME                                          Jan 26, 2011 8.10PM
LONG_TIME                                                Wednesday, January 1, 2011 8.10PM
SHORT_TIME_TZ                                       1/26/11 8.10PM GMT
MEDIUM_TIME_TZ                                   Jan 26, 2011 8.10PM GMT
LONG_TIME_TZ                                        Wednesday, January 1, 2011 8.10PM GMT


The default MASK constant is MEDIUM.

In order to user these abstract’s you need to have your XML date data in canonical format as,
YYYY-MM-DDThh:mm:ss(+/-)HH:MM
(For example check out DATE_UTC tag value in the above XML.)

Here,
YYYY is the year
MM is the month
DD is the date
T is the separator between the date and time component
hh is the hour in 24-hour format
mm is the minutes
ss is the seconds
(+/-)HH:MM is the time zone offset from Universal Time (UTC) or Greenwich Mean Time

Here is the output for our XML data using the MEDIUM_TIME mask,
Now if you notice the output that we got earlier while using format-date with the default parameter, column for date_utc alone is showing Jan 27 were as the date we have in the XML is 26.

This is because of the time zone offset –08:00.

Where this timezone offset is nothing but, the time zone difference of the date that we passed in the XML with respect to GMT. So BI Publisher will automatically understand the timezone of the XML data, and print/convert it as per the BI Publisher Local Server time.

How to get Time zone offset of the data?
Ok now we know its important to pass the time zone offset in the XML data to use the MASK. Lets see how to get them in the XML data,

First Option:
If your data source is a data definition file, then no need to worry, the standard BI Publisher data definition engine by default will give the data in the canonical format with time zone offset. So you are good. No need of any extra coding.

If you do not want the template to change the date as per the time zone then, user the TO_CHAR function to print without the time zone offset. So that template engine will not modify the date as per the server time zone.

Second Option:
Lets say your data source is an RDF file. In that case use TO_CHAR function in your SQL query and bring the data in required canonical format.

Third Option:
Lets say, you do not have control over the data source. You have only access to the template and know what will be the time zone of the data that is going in come in the XML.
4. Format with Calendar:
Now that we had seen different types of formatting dates, let finally see how to use the above formats with various calendars.
Here is the supported calendar types,
- GREGORIAN
- ARABIC_HIJRAH
- ENGLISH_HIJRAH
- JAPANESE_IMPERIAL
- THAI_BUDDHA
- ROC_OFFICIAL (Taiwan)


I think, I had covered all the date formatting techniques in BI Publisher. If you feel I had missed anything or would like to explain some specific example, feel free to put on the comments.



Ur's
AmarAlam

Hide a Field in Oracle XML Publisher

1 comments
1). If You Want to Hide a Field:

2). If you want to Hide The Data Based on One Field :
3). To Hide a Column We Can Use IF And END IF.


Ur's
AmarAlam

RICE components

1 comments
Mostly an oracle apps technical consultant will be working on RICE components.
R--Reports
I--Interfaces
C--Conversions

E--Extensions(Forms personalization)

Reports:
For suppose I'm running a business named 'ALAM' which is wide spread across the globe.Now,I want to know how my business is running across the globe.I will ask a tech guy(oracle apps technical consultant) to develop a report.In that report I ask him to simply print the details of profit or loss,of every branch of my business across the world.He(tech guy) will come up with the report to me then I will come to know whether my company is running fine or not.Thereby, I can take necessary decisions to run my business fine.
Clearly we have seen that report will be developed by technical person,who must know the report building.
We build a report using sql,pl/sql.So,if your are strong in sql,pl/sql then its not a big deal to learn the report building.Its enough to learn the report developer tool.

Conversion:
As I said earlier I'm running a 'ALAM' business(which is factious).Suppose I'm using excel sheets to store the data.Now I want to install oracle apps(E-Business Suite) in my company. So,What ever data that is present in my excel sheets must also be present in my oracle apps tables(A table is a collection of rows and columns).Now I ask a tech guy to write a code such that my excel sheet data will get into oracle apps base tables.Then that tech guy will use 'conversion' to get the data from the legacy system(in our case it is excel sheet) into oracle apps base tables.

Interfaces:
Interfaces are similar to conversions.Conversion is a one-time process where as Interface is on-going process every now and then.We run interfaces daily or periodically.
Interfaces are of two types
1)Inbound Interface
2)Outbound Interface

Inbound Interface:Transferring the data from the legacy system(in our case it is excel sheet) into the Oracle apps base tables.
Outbound Interface:Transferring the data from the Oracle apps base tables into the legacy system(It might be any of these SAP,People soft etc).

Extensions:
Extensions are nothing but personalizing the forms.In oracle e-business suite we have some where around 5000 to 6000 forms.In my 'ALAM' business i want to customise the po(purchase order) form of the oracle apps then i ask the tech guy to do that.He will use form builder tool to do that.


Ur's
AmarAlam

Oracle Apps Technical Consultant

32 comments
Oracle Apps is an ERP(Enterprise Resource Planning),nothing but effective planning of the resources in an Enterprise.An Enterprise is  'A business organization' like Ford,Reliance...etc.
An insight into the organization for the higher level authorities(in that organization) always make them to take decisions for the development of the organization.ERP makes the details of the organization available to the managers at the click of a mouse.Thereby,Managers and the employees in the organization can collaborate for the success of the company by taking effective decisions.
Without ERP It would be possible to run the business effectively but its a tedious process coz there are many departments involved in an organization.Gathering all that data and summing up it for the result is a nightmare.
ERP comes with the facility that it puts all the data of an organization at one place,and also we can get the result of its functioning at the click of a mouse.
So,many organizations are using ERP for their business.Some of the ERPs in the market are SAP, JDedwards, Siebel, Peoplesoft.
As we are now learning the basics of Oracle apps for a technical consultant,We will only discuss about the ERP,Oracle apps.
In oracle apps we have three roles
1)Apps technical consultant.
2)Apps functional consultant.
3)Apps DBA(Database Adminstrator).

In order to start your career as oracle apps technical consultant,you must have a good command on sql,pl/sql. and a little bit of knowledge on UNIX commands.
For an organization to use this ERP,it has to first install the Oracle apps later on according to the company's requirement it asks the tech guys(We the oracle apps technical consultants) to customize the application.This is how we(Oracle apps technical consultants) get the work to do.


Ur's
AmarAlam

Monday 28 October 2013

How To Enable About This Page in Oracle Apps

1 comments
Navigate to System Administrator --> Profile --> System

Profile: FND: Diagnostics
Set the site value to Yes




Logout and log back in.


Ur's
AmarAlam

Concurrent Program Phase codes and Status Codes

1 comments
Concurrent Program Phase Codes:

SELECT lookup_code, meaning
  FROM fnd_lookup_values
 WHERE lookup_type = 'CP_PHASE_CODE' AND LANGUAGE = 'US'
   AND enabled_flag = 'Y';

LOOKUP_CODE
MEANING
C
Completed
I
Inactive
P
Pending
R
Running






Concurrent Program Status Codes:

SELECT lookup_code, meaning
  FROM fnd_lookup_values
 WHERE lookup_type = 'CP_STATUS_CODE' AND LANGUAGE = 'US'
   AND enabled_flag = 'Y';

LOOKUP_CODE
MEANING
R
  Normal
I
 Normal
Z
 Waiting
D
Cancelled
U
Disabled
E
Error
M
No Manager
C
Normal
H
On Hold
W
Paused
B
Resuming
P
Scheduled
Q
Standby
S
Suspended
X
Terminated
T
Terminating
A
Waiting
G
Warning




Ur's
AmarAlam

Deleting a Template From Back End

0 comments
DECLARE  
   l_templateCode    varchar2 (100) := 'XX_AR_CUST_AUDIT_REPORT'; -- Template Code  
BEGIN
   FOR r IN (SELECT t1.application_short_name template_app_name,
                    t1.data_source_code,
                    t1.application_short_name def_app_name
               FROM xdo_templates_b t1
              WHERE t1.template_code = l_templateCode)
   LOOP
    
      xdo_templates_pkg.delete_row (r.template_app_name, l_templateCode);

      DELETE FROM xdo_lobs
            WHERE lob_code = l_templateCode
                  AND application_short_name = r.template_app_name
                  AND lob_type IN ('TEMPLATE_SOURCE', 'TEMPLATE');

      DELETE FROM xdo_config_values
            WHERE application_short_name = r.template_app_name
                  AND template_code = l_templateCode
                  AND data_source_code = r.data_source_code
                  AND config_level = 50;

  END LOOP;
END;


Ur's
AmarAlam

Monday 21 October 2013

Value Sets in Oracle Applications

0 comments
What is a value set and where is it used?
Value set is primarily the List of Values(LOV) to restrict and mantain consistencies in entering or selecting the values. It is also the place holders to allow user enter a value. Oracle Application Object Library uses value sets as important components of key flexfields, descriptive flexfields, and Concurrent Request Submission.

What are the Format Types the value set have?
* Character
* Number
* Time
* Standard Date, Standard Date Time
* Date, Date Time
Note that Date and Date Time value set formats are obsolete and are provided for backward compatibility only. For new value sets, use the the format types Standard Date and Standard Date Time.

What are the validation types?

    None:

* There is no validation done for this type of value set, hence allows user to enter any value.

    Independent:

* It provides a list of pre-defined values. The predefined values are entered seperately.

    Dependent:

* Same like Independent Value Set, except the List of Values shown to you will depends on which the Independent value you have selected in the Prior Segment.
* Must define your independent value set before you define the dependent value set that depends on it.
* Must create at least one dependent value for each independent value.

    Table:

* The list of value is created based on database tables
* Allows to write simple queries, joins, order by etc
* The value, meaning and ID can be used to display a value, description to the value but return ID to the calling program or screen.
* Additional columns can also be displayed. The syntax is column "column title(size)",.... e.g. order_type "SO Order Type(40)"
* Can also create dependent values to filter LOV data based on parameter value selected earlier. This can be done using :$FLEX:.value_set_name in the where clause.

    Special & Pair:

Pair validation value set allows to select a range of concatenated Flex field segments as parameters to the report. The special value set is used to perform special validation. This is used to enter the entire key flexfield segment in the single parameter of the report/calling entity.

    Translatable Independent & Translatable Dependent:


* This is similar to Independent and Dependent value set except that translated values can be displayed to the user.

APIs to create value set:
The FND_FLEX_VAL_API package can be used to create different types of value sets.
* VALUESET_EXISTS - To check if value set exists
* DELETE_VALUESET - To delete value set. The value set can only be deleted if it is not being referenced by any program or entity.
* CREATE_VALUESET_NONE
* CREATE_VALUESET_INDEPENDENT
* CREATE_VALUESET_DEPENDENT
* CREATE_VALUESET_TABLE
* CREATE_VALUESET_SPECIAL
* CREATE_VALUESET_PAIR

What are the oracle tables that store value set information?
* FND_FLEX_VALUE_SETS
* FND_ID_FLEX_SEGMENTS
* FND_FLEX_VALUE
* FND_FLEX_VALIDATION_EVENTS
* FND_FLEX_VALUE_RULE_LINES
* FND_FLEX_VALUE_RULE
* FND_FLEX_VALUE_RULE_USAGE
* FND_FLEX_VALIDATION_TABLES


Ur's
AmarAlam

Handling NULL Values Using $FLEX$ in Value Sets

3 comments
To Handle The Null Values In Value Set Please find the Below One, Hope it is Helpful for All Techies.

SELECT SHIPMENT_NUM
FROM RCV_SHIPMENT_HEADERS

WHERE CLAUSE: SHIPMENT_HEADER_ID in
(select shipment_header_id from rcv_shipment_lines
where shipment_line_status_code NOT IN('FULLY RECEIVED','CANCELLED')
and from_organization_id=NVL(:$FLEX$.IFF_WMS_ORGANIZATION1:NULL,from_organization_id)
and to_organization_id=:$FLEX$.IFF_WMS_ORGANIZATION)
and receipt_source_code not in ('VENDOR')


Ur's
AmarAlam

Thursday 26 September 2013

Group By Clause In Value Sets

0 comments
Goto the following window from “System Administrator” Responsibility and define your Value Set.

–>Application
———–>Validation
————————>Set

 
If distinct values to be listed in your value set, you cannot directly use Distinct or Group By clause in your definition in Value set form where you define it. You have to either create View with of distinct or group by clause or you can use the following way to define to get distinct values. This is one of the alternative ways to get distinct value in value set.

In Where/Order By section, you can get the max rowid of your condition.

Select attribute2 from wms_license_plate_numbers wlpn
where

wlpn.attribute2 is not null and
wlpn.lpn_context in (1, 8, 9, 11)
and wlpn.organization_id
in
(select organization_id from
apps.org_access_v where responsibility_id in (select fnd_profile.value('resp_id') from dual))
and rowid = (select max(rowid) from wms_license_plate_numbers wlp where wlp.organization_id in (select organization_id from
apps.org_access_v where responsibility_id in (select fnd_profile.value('resp_id') from dual)) and wlp.attribute2=wlpn.attribute2)




Code in Red Color(Value set where clause) .


Ur's
AmarAlam

Friday 23 August 2013

PO Matching Report

1 comments
SELECT
      PHA.TYPE_LOOKUP_CODE,
      PHA.LAST_UPDATE_DATE,
      PHA.SEGMENT1,
      PHA.SUMMARY_FLAG,
      PHA.ENABLED_FLAG,
      PHA.APPROVED_FLAG,
      PLA.UNIT_MEAS_LOOKUP_CODE,    
      PLA.QUANTITY,
      PLA.UNIT_PRICE,
      PLA.LIST_PRICE_PER_UNIT,
      PLA.PRICE_TYPE_LOOKUP_CODE,
      PLL.RECEIPT_REQUIRED_FLAG,
      PLL.INSPECTION_REQUIRED_FLAG,decode
         (INSPECTION_REQUIRED_FLAG||RECEIPT_REQUIRED_FLAG,'NN','2-Way','NY','3-Way','YY','4-Way','Not Specified')  
                              Matching,      
      PLL.ENCUMBERED_FLAG,
      PDA.QUANTITY_ORDERED,    
      PDA.ACCRUAL_ACCOUNT_ID,
      PDA.VARIANCE_ACCOUNT_ID
 FROM
       PO_HEADERS_ALL PHA,
       PO_LINES_ALL PLA,
       PO_LINE_LOCATIONS_ALL PLL,
       PO_DISTRIBUTIONS_ALL PDA
 WHERE
        PDA.PO_HEADER_ID=PLL.PO_HEADER_ID
AND          
       PLL.PO_HEADER_ID=PLA.PO_HEADER_ID
AND
       PLA.PO_HEADER_ID=PDA.PO_HEADER_ID
AND         
       PLA.UNIT_PRICE>1000000000
AND
      decode
(INSPECTION_REQUIRED_FLAG||RECEIPT_REQUIRED_FLAG,'NN','2-Way','NY','3-Way','YY','4-Way','Not Specified')=:MATCH LEVEL


Ur's
AmarAlam

Pending Purchase Orders Report Code

0 comments
select sysdate REP_DATE,
pv.SEGMENT1 VENDOR_NUM,
ph.segment1 PO_NUM,
PH.REVISION_NUM,
ph.type_lookup_code PO_TYPE,
pol.ITEM_DESCRIPTION,
pol.UNIT_MEAS_LOOKUP_CODE,
pol.UNIT_PRICE,hr.name,
pds.QUANTITY_ORDERED,
PDS.QUANTITY_CANCELLED,
pds.QUANTITY_DELIVERED,
pds.QUANTITY_BILLED,
pds.AMOUNT_BILLED,
pol.CANCEL_DATE,
pds.QUANTITY_ORDERED-pds.QUANTITY_DELIVERED REMANING_QTY,
pv.vendor_name Supplier,
PH.AUTHORIZATION_STATUS STATUS,
PH.CREATION_DATE po_date
from po_headers_all ph,
po_lines_all pol,
po_distributions_all pds,
HR_OPERATING_UNITS hr,
po_vendors pv
where ph.PO_HEADER_ID=pol.PO_HEADER_ID
and ph.PO_HEADER_ID=pds.PO_HEADER_ID
and ph.VENDOR_ID=pv.VENDOR_ID
and hr.ORGANIZATION_ID=ph.ORG_ID
AND PdS.QUANTITY_ORDERED<>PdS.QUANTITY_DELIVERED
AND ph.TYPE_LOOKUP_CODE<>'RFQ'
AND ph.TYPE_LOOKUP_CODE<>'QUOTATION'
AND PH.AUTHORIZATION_STATUS='APPROVED'
and hr.NAME=:org
and trunc(ph.creation_date)=trunc(:dt)
and to_char(ph.creation_date,initcap('mon')||'-'||'yy')=:mon
and trunc(ph.creation_date)  between trunc(:inp) - 7   and trunc(:inp)


Ur's
AmarAlam

R12 Fetures and Tables

1 comments
R12 Feaututes :
--------------
1.MOAC(Multiorg Access Control) :
  ------------------------------
  By Using Single Responsibility we can be able to access
  multiple operating units at a time.
2.Mutiorg views were replaced with MOAC Based synonyms.
3.MO:Security Profile is a new profile added in R12.
4.VPD(Virtual Private Database) System will take care of
  Data security in R12

5.Org Initialisation process in R12 :
  ----------------------------------
   begin
     mo_global.set_policy_context('S','204');
   end;

  MOAC Synonym Initialisation :
  ----------------------------
   begin
     FND_GLOBAL.APPS_INTILISE('APPLICATION_ID','RESPONSIBILTY_ID,'USER_ID');
     MO_GLOBAL.INIT('SQLAP'); -- Application Short Name
   end;

  Modulewise Changes in R12 :
  --------------------------
  General Ledger :
  --------------
  1. Subledger Accounting module was added in  R12.
  2. gl_sets_of_books table was replaced with gl_ledgers
     and gl_ledger_Sets.
  3. In Addition to Currency,Calendar,Chart of accounts,
     Convention was added in R12.

   Accounts Payable :
   ----------------
   1.ap_invoice_lines_all table added in R12.
   2.ap_invoice_distributions_all table populates the data
     when ever invoice gets accounted.
   3.Supplier form was converted from form based solution to
     webbased solution.
   4.po_vendors tables replaced with ap_suppliers tables.
   5.Supplier and customer information was defined together
     Under TCA(Trading Community Architecture).
   6.Accounting Tables were modified.
   7.Both supplier and customer bank information was defined
     under payments(New application in R12) Application.
   
      11i Table               R12 Table
      -----------             ------------
      po_vendors              ap_suppliers
      po_vendor_sites_all     ap_supplier_sites_all
      po_vendor_contacts      ap_supplier_contacts
      ap_banks                ce_banks
      ap_bank_branches        ce_bank_branches
      ap_ae_headers_all       xla_ae_headers
      ap_ae_lines_all         xla_ae_lines
      ap_ae_accounting_events xla_events

Order Management  :
-----------------
  Move Order Fautures were added in R12.
  ra_customers ,ra_site_uses_all ,ra_adderesses_all
  views were removed in R12.
  in place of ra_customers,ra_site_uses_all,ra_addersses_all
  views need to use the below mentioned base tables.
 
    hz_cust_accounts
    hz_parties
    hz_cust_site_uses_all
    hz_cust_acct_sites_all
    hz_party_sites
    hz_locations


Ur's
AmarAlam

Important TCA API's

0 comments


Ur's
AmarAlam

Order to Cash Cycle - Tables get Affected @ Each Step

0 comments
1) Order Entry
------------------------------------
oe_order_headers_all.flow_status_code = 'ENTERED'
oe_order_headers_all.booked_flag = 'N'

oe_order_lines_all.flow_status_code = 'ENTERED'
oe_order_lines_all.booked_flag = 'N'
oe_order_lines_all.open_flag = 'Y'

2) Order Booking
------------------------------------
oe_order_headers_all.flow_status_code = 'BOOKED'
oe_order_headers_all.booked_flag = 'Y'

oe_order_lines_all.flow_status_code = 'AWAITING SHIPPING'
oe_order_lines_all.booked_flag = 'Y'

wsh_delivery_details.released_status = 'R' (ready to release)

wsh_delivery_assignments.delivery_id = BLANK

3) Reservation
------------------------------------
mtl_demand
mtl_reservations

4) Pick Release
------------------------------------
wsh_new_deliveries.status_code = 'OP'
wsh_delivery_assignments.delivery_id gets assigned
wsh_delivery_details.released_status = 'S' (submitted for release)
mtl_txn_request_headers
mtl_txn_request_lines
mtl_material_transactions_temp

5) Pick Confirm
------------------------------------
oe_order_lines_all.flow_status_code = 'PICKED'
mtl_material_transactions
wsh_delivery_details.released_status = 'Y' (Released)
mtl_onhand_quantities

6) Ship Confirm
------------------------------------
Data will be removed from wsh_new_deliveries
oe_order_lines_all.flow_status_code = 'SHIPPED'
wsh_delivery_details.released_status = 'C' (Shipped)
wsh_serial_numbers
data will be deleted from mtl_demand and mtl_reservations
item qty gets deducted from mtl_onhand_quantities

7) Enter Invoice
------------------------------------
After shipping the order, workflow backgroud engine picks up records and post it to
ra_interface_lines_all
Auto invoice program picks up records from interface table and insert them into
ra_customer_trx_all (trx_number is invoice number)
ra_customer_trx_lines_all (line_attribute_1 = Order number and line_attribute_6 = Order line id)

8) Complete Line
------------------------------------
oe_order_lines_all.flow_status_code = 'SHIPPED'
oe_order_lines_all.open_flag = 'N'

9) Close Order
------------------------------------
oe_order_headers_all.flow_status_code = 'CLOSED'
oe_order_lines_all.flow_status_code = 'CLOSED'
oe_order_lines_all.open_flag = 'N'

10) Create Receipt
------------------------------------
AR_CASH_RECEIPTS_ALL

11) Transfer to General Ledger
------------------------------------
GL_INTERFACE

12) Journal Import
------------------------------------
GL_JE_BATCHES
GL_JE_HEADERS
GL_JE_LINES

13) Posting
------------------------------------
GL_BALANCES


Ur's
AmarAlam

Finding Responsibility of a Form

0 comments

Below is the Query, which helps you to find all the responsibilities of a Form, to which it has been attached.

**********************************************************************************************
SELECT   FORMS.form_name,
         FORMSTL.user_form_name,
         RESTL.responsibility_name,
         FORMSTL.language
  FROM   fnd_form FORMS,
         fnd_form_tl FORMSTL,
         fnd_form_functions FUNC,
         fnd_menu_entries MENU,
         fnd_responsibility RES,
         fnd_responsibility_tl RESTL
 WHERE       FORMSTL.user_form_name LIKE 'CUM Workbench%'
         AND FORMS.form_id = FORMSTL.form_id
         AND FUNC.form_id = FORMS.form_id
         AND MENU.function_id = FUNC.function_id
         AND RES.menu_id(+) = MENU.menu_id
         AND RES.responsibility_id = RESTL.responsibility_id(+)


Ur's
AmarAlam

On-Hand quantity details as per Oracle Form

1 comments
Below is the PL/SQL, which gives you the On-hand Quantity details as per oracle form.

Oracle form show details like On-Hand Quantity, Available to reserve, Quantity Reserved,Quantity Suggested, Available to Transact and Available to Reserve.

All These details can be fetched using API => inv_quantity_tree_pub.query_quantities

****************************************************************************
DECLARE
   x_return_status         VARCHAR2 (50);
   x_msg_count             VARCHAR2 (50);
   x_msg_data              VARCHAR2 (50);
   v_item_id               NUMBER;
   v_organization_id       NUMBER;
   v_qoh                   NUMBER;
   v_rqoh                  NUMBER;
   v_atr                   NUMBER;
   v_att                   NUMBER;
   v_qr                    NUMBER;
   v_qs                    NUMBER;
   v_lot_control_code      BOOLEAN;
   v_serial_control_code   BOOLEAN;
BEGIN
   SELECT   inventory_item_id, mp.organization_id
     INTO   v_item_id, v_organization_id
     FROM   mtl_system_items_b msib, mtl_parameters mp
    WHERE       segment1 = :item_number
            AND msib.organization_id = mp.organization_id
            AND mp.organization_code = :organization_code;


   v_qoh := NULL;
   v_rqoh := NULL;
   v_atr := NULL;
   v_lot_control_code := FALSE;
   v_serial_control_code := FALSE;


   fnd_client_info.set_org_context (1);


   inv_quantity_tree_pub.query_quantities (
      p_api_version_number           => 1.0,
      p_init_msg_lst                        => 'F',
      x_return_status                      => x_return_status,
      x_msg_count                         => x_msg_count,
      x_msg_data                           => x_msg_data,
      p_organization_id                  => v_organization_id,
      p_inventory_item_id              => v_item_id,
      p_tree_mode                         => apps.inv_quantity_tree_pub.g_transaction_mode,
      p_is_revision_control             => FALSE,
      p_is_lot_control                     => v_lot_control_code,
      p_is_serial_control                 => v_serial_control_code,
      p_revision                              => NULL,                          -- p_revision,
      p_lot_number                        => NULL,                        -- p_lot_number,
      p_lot_expiration_date            => SYSDATE,
      p_subinventory_code            => NULL,                 -- p_subinventory_code,
      p_locator_id                         => NULL,                        -- p_locator_id,
      p_onhand_source                 => 3,
      x_qoh                                   => v_qoh,                    -- Quantity on-hand
      x_rqoh                                  => v_rqoh,         --reservable quantity on-hand
      x_qr                                     => v_qr,
      x_qs                                     => v_qs,
      x_att                                     => v_att,               -- available to transact
      x_atr                                    => v_atr                 -- available to reserve
   );


   DBMS_OUTPUT.put_line ('On-Hand Quantity: ' || v_qoh);
   DBMS_OUTPUT.put_line ('Available to reserve: ' || v_atr);
   DBMS_OUTPUT.put_line ('Quantity Reserved: ' || v_qr);
   DBMS_OUTPUT.put_line ('Quantity Suggested: ' || v_qs);
   DBMS_OUTPUT.put_line ('Available to Transact: ' || v_att);
   DBMS_OUTPUT.put_line ('Available to Reserve: ' || v_atr);


EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line ('ERROR: ' || SQLERRM);
END;


****************************************************************************


Ur's
AmarAlam