Wednesday, April 15, 2015

Reports



Reports
Application Developer -> Concurrent -> Executable
  • First we develop a report in report builder 6i as per the client requirements.
  • After that we will transfer the .rdf file into respective directory through WINSCP 3 or FTP or TOAD or   SECURECRT (SSH) or FILEZILLA
  • And then we will define EXCUTABLE there we have to specify the shortname, application, execution method and execution filename (Report_name or package or procedure)
  • And then we will define concurrent program there we mention concurrent program name, shortname, application, executable name, incompatibilities and parameters.
  • And then add this concurrent program to request group
  • And then add this request group to particular responsibilities
  • The user who is having these responsibilities he can only submit the request. 
If we develop a report in the purchase order then we will move the .rdf file into PO-TOP/reports/US.

Ø  How can you Implement MultiOrg in Reports?
Before report:
                        Srw.user_exit (‘fnd srwinit’)
                        Fnd_profile.get (‘user name’,:p_user_name);
                        Fnd_profile.get (‘Resp_name’, p_resp_name) ;( I want responsibility also)
            After report:
                        Srw.user_exit (‘fnd srwexit’);
            User parameters:
                        P_conc_request_id

Ø  Formula column:

o   For doing mathematical calculations and returning one value

Ø  Summary Column:

o   For doing summary calculations such as summations etc

Ø  Placeholder Column:

o   We can get running totals and etc
Ø  These columns are useful for storing the value in a variable. Used to assign a value through formula column

 

Ø   How to get page number and total pages in Oracle Reports?

Page Number: SRW.GET_PAGE_NUM (page_num)
Total pages: Records count / Maximum Records Per Page 
Note: Record Count Can be obtained by running actual query for count of records in before report, and MaxRecordsPage can get from the MAXIMUM_RECORDS_PER_PAGE property.

Ø  Matrix report: To create a matrix report, you need at least four groups: one group must be a cross-product group, two of the groups must be within the cross-product group to furnish the "labels," and at least one group must provide the information to fill the cells.  The groups can belong to a single query or to multiple queries.

Lexical & Bind Parameters in Reports

 

Ø  Lexical Parameters:

·         Lexical parameter is a replacement of text string in select statement, it is preceded by & (ampersand).
·         For this we need to create user parameter. It should be character and it is initialized.
·         We need to pass the values at runtime for lexical parameter.
·         Lexical references are placeholders for text that you embed in a SELECT statement. 
·         You can use lexical references to replace the clauses appearing after SELECT, FROM, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH.
·         For columns, you must enter Value if Null, and for parameters, you must enter Initial Value. Report Builder uses these values to validate a query with a lexical reference.

 

Ø  Bind Parameters:

·         Bind parameter is a replacement of single value or expression in select statement. It is preceded by : (colon).
·         It can be number, date, or character data type. It cannot be used in FROM clause.
·         Bind references (or bind variables) are used to replace a single value in SQL or PL/SQL, such as a character string, number, or date.  Specifically, bind references may be used to replace expressions in SELECT, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH clauses of queries. 
·         Bind references may not be referenced in FROM clauses or in place of reserved words or clauses.
·         You create a bind reference by entering a colon (:) followed immediately by the column or parameter name.  If you do not create a column or parameter before making a bind reference to it in a SELECT statement, Report Builder will create a parameter for you by default.

Ø   What are SRW package and some procedures in SRW? 

·         It is the standard reports package and it has many procedures like USER_EXITS, DO_SQL, RUN_REPORT, MESSAGE, TRACE, BREAK, SET_ATTR


Ø   How do you submit concurrent request from a PL/SQL code?
Declare
V_request_id number;
Begin
V_request_id := FND_REQUEST.SUBMIT_REQUEST(APPL_SHORTNAME,CONC_PROGRAM_SHORTNAME,DESC,PARAM);
Commit;
If v_request_id > 0 then
Dbms_output.put_line (‘Successfully Submitted’);
Else
            Dbms_output.put_line (‘Not Submitted’);
End if;
End;
Note: If it is success then it returns the submitted request, otherwise it is 0.

Ø   How can we execute the query in the report trigger? And what is use of SRW.DO_SQL?
·         Using SRW.DO_SQL we can execute the DDL and DML queries. This procedure executes the specified SQL statement from within Report Builder. The SQL statement can be DDL, or DML (statements that manipulate data). 

Ø  User Exit: User exit is a program and it is used to pass the control from oracle reports to any other 3GL and there it will capture the data and return to the oracle reports.
We have 5 types of user exists.
SRW.USER_EXIT ('FND SRWINIT'); --BeforeReport
SRW.USER_EXIT ('FND SRWEXIT'); --AfterReport
SRW.USER_EXIT ('FND FLEXSQL’);
SRW.USER_EXIT ('FND FLEXIDVAL’);
SRW.USER_EXIT ('FND FORMAT_CURRENCY’);
FND SRWINIT: We will call the user exit always from before report trigger. It will captures the all the user profiles.
Syntax:    Srw.user_exit (‘fnd srwinit’)
FND SRWEXIT: This will call from after report trigger.
                             It will freeze the memory which has been occupied by the user profiles.
Syntax:  srw.user_exit(‘fnd srwexit’)
FND FLEXSQL: This is one of the user exits will be executed in before report trigger
                              It will retrieve key flex field segment values.
FND FLEXIDVAL:  It will call from formula column.        It populated KFF value in output.
FND FORMAT_CURRENCY:   It is used to format the currency.
P_CONC_REQUEST_ID: We have to define this parameter in report. It captures Concurrent Program request id, based on this request id user exist will be executed.
            Begin
                        FND_CLIENT_INFO.SET_ORG_CONTEXT (PROFILE NAME);
            End;
Ø  P_CONC_REQUEST_ID:
·           Bind parameter, this will automatically retrieve the request id of concurrent program. And this request id will be use to do some concurrent processing operations. This parameter captures user concurrent program request id from SRS window in oracle application.
Ø   How to get profile values?
·         FND_PRFILE.PUT (NAME in varchar2, VAL in varchar2);
·         FND_PROFILE.GET (NAME in varchar2, VAL out varchar2);
·         FND_PROFILE.VALUE (NAME in varchar2);
·         PUT - sets a profile option to a value for this session, but doesn't save to the database
·         GET - gets the value of a profile option
·         VALUE - returns the value of a profile options

Ø   What are report triggers?
·         There are five types of report triggers
 1.    Before parameter form        It fires before run time parameter form is displayed
 2.   After parameter form           It fires after the parameter form is displayed
        3.   Before report                        It fires before the report executes, that is after queries are parsed but before                                                                                                       records are fetched from database
 4.   Between pages                       It fires before each page is formatted or displayed, except the first page
5.    After report                           It fires after you exit the live Previewer.

Ø   What is an anchor?         
>        It determines the horizontal and vertical position of an object.
>        Anchors fasten an edge of one object to an edge of another object, ensuring that they maintain their positions relative to its parent.                         

Ø  Request set: It is nothing but collection of concurrent programs and report where we can run the programs parallel and sequence.
1)The difference between request group and request set is both will be use combine the programs in request group we can submit only one request set or we can submit multiple requests parallel  at a time
2) We can attach request group to responsibility but can’t attachment request set

Ø  Place holder, Summary and Formulae Columns?
·         Summary Column: A summary column performs a calculation based on another column’s value. Function are sum, count, average, minimum, maximum, first, last, %of total, std. deviation, variance.
·         Formula Column: A formula column is used to perform user-specified calculations on the data and it can be either report level or group level is used to get the values from one or more columns.
·         Placeholder Column: A placeholder column is nothing but an empty container when created at design time. It is populated at runtime with values calculated by the PL/SQL code from another object such as a formula column.
A placeholder column can be set with values from:
Before report trigger
A placeholder column is used to hold the value of certain calculation or a variable that is being carried out from a formula column. A place holder can be defined as a number, character or date type, depending upon the type of value which will be stored into it.

Ø   What is use of SRW.MESSAGE?
·         This procedure displays a message with the message number and text that you specify.  The message is displayed in the format below. After the message is raised and you accept it, the report execution will continue.
·         Syntax: SRW.MESSAGE (msg_number NUMBER, msg_text CHAR);

·          What is a format trigger?
·         A format trigger is a PL/SQL function. It is executed before an object is formatted. 
·         A trigger can be used to dynamically change the formatting attributes of the object. 
·         A format trigger is used when we want to display a particular field, if certain conditions are met.

select.. into ... for assignment purposes.
Or
create a global variable and do the assignment.

Ø  How do we hide fields in a Report?
Using the Format Trigger we can hide the fields. Or Using “Conditional Formatting” triggers
/* suppose that you are building a master/detail report and, if no detail records are retrieved for a master record, you do not want the boilerplate labels to appear. To do this, you first create a summary column called MYCOUNT with a Function of Count in the source group of the master repeating frame. In the format trigger for the group frame that surrounds the detail repeating frame and its labels, you enter the following:
*/
           function my_formtrig return BOOLEAN is
           begin
                       if :mycount = 0 then
                                   return (false);
                       else
                                   return (true);
                       end if;
           end;

Ø  How should i get a image from database to report?
·         In Layout Model -> File-->Import-->Image -> it’s asking the Path where your image is located. Give the Appropriate Location then image is loaded from database into layout model.

Ø  What is the frame & repeating frame?
·         A frame is a holder for a group of fields. A repeating frame is used to display a set of records when the number of records that are to be displayed is not known before.

Ø  How can a break order be created on a column in an existing group?
·         By dragging the column outside the group

Ø  Static & Dynamic LOV

·         The static LOV contains the predetermined values while the dynamic LOV contains values that comes at run time

Ø  If 2nd parameter value is based on 1st parameter then how do u declare it?
Let v2 be the value set definition of 2nd parameter and v1 be the value set definition for the first parameter then, In the value set definition of v2 = value $FLEX$.v1

OM: Reports

FORECAST VS ACTUAL REPORT
Description   : To find the variance between plan and actuals
Parameters    : Org_Id, Organization_id , Month1(MON-YYYY), Month2(MON-YYYY)
Report Format:
                  Month1                                               Month2
Item, Descr, PlanQty, OrdQty, DespQty, Variance, PlanQty, OrdQty, DespQty ,Variance
Logic         :
Condition
Column
Get Info
OOL.ordered_quanatity
Orders booked
OOH.booked_flag=’Y’
Orders<>cancelled 
OOH.cancelled_falg=’N’
Month 1
to_char(OOH.ordered_date,’MON-YYYY’) = :p_month1
Month 2
to_char(OOH.ordered_date,’MON-YYYY’) = :p_month2
M1_Plan_Qty
TI_APS_FORECAST_MKT.MONTH = :P_MONTH1
M1_Ord_qty
OOL.ORDERED_QUANTITY where to_char  (OOH.ordered_date, ’MON-YYYY’) = :p_month1
M1_Desp_Qty
OOL.ORDERED_QUANTITY where  to_char (OOH.ordered_date, ’MON-YYYY’) = :p_month1
AND to_char (OOH.actual_shipment_date, ’MON-YYYY’) = :p_month1   
M1_Variance (%)
( M1_OrdQty / M1_PlanQty ) * 100
M2_Plan_Qty
TI_APS_FORECAST_MKT.MONTH = :P_MONTH2
M2_Ord_qty
OOL.ORDERED_QUANTITY where  to_char (OOH.ordered_date, ’MON-YYYY’) = :p_month2
M2_Desp_Qty
OOL.ORDERED_QUANTITY where to_char (OOH.ordered_date, ’MON-YYYY’) = :p_month2
AND to_char (OOH.actual_shipment_date, ’MON-YYYY’) = :p_month2   
M2_Variance (%)
( M2_OrdQty / M2_PlanQty ) * 100
















Tables Related:
MTL_SYSTEM_ITEMS, TI_APS_FORECAST_MKT, OE_ORDER_HEADERS_ALL, OE_ORDER_LINES_ALL    

 

Daily Order Load with Backlog
Description   : TO find Daily Order Load With Back Log
Get item wise order load for the month and with back log in tons, meters, and nos.
WSH_WV_UTILS.CONVERT_UOM will return the qty in to_uom from from_uom.
WSH_WV_UTILS.CONVERT_UOM_RATE will return the conversion rate throughout variable.
Parameters    : Org_Id, Organization_id, Customer_Name
Report Format:
CommonInforamtion: Item code, Description, Customer_name
Curr Month    : Ord_Qty, Despacthed_Qty, Cur_Pending_Qty
Prev Month    : Ord_Qty, Despacthed_Qty, Prev_Pending_Qty
Final Pending Qty: Cur_Pending_Qty + Prev_Pending_Qty
Logic         :
Condition
Column
Get Info
OOL.ordered_quanatity
Orders booked
OOH.booked_flag=’Y’
Orders<>cancelled 
OOH.cancelled_falg=’N’
curr_month
to_char(ooh.ordered_date,’mon’) = to_char(sysdate,’mon’)
Prev_month
to_char(ooh.ordered_date,’mon’) = to_char(add_moths(sysdate,-1),’mon’)
Desp_Qty
To_char(ool.actual_shipment_date,’mon’) = to_char(sysdate,’mon’)
Pending_Qty
OrdQty – DespQty


Tables Related:
MTL_SYSTEM_ITEMS, RA_CUSTOMERS, OE_ORDER_HEADERS_ALL, OE_ORDER_LINES_ALL

 

RMA ORDERS RECEIVED FOR THE SPECIFIC PERIOD
Parameters    : P_Org_Id, P_Organization_id, P_ORDER_TYPE_ID, P_Customer_Name,
                            P_From_Date, P_To_Date
Description   : RMA ORDERS RECEIVED FOR THE PERIOD
Report Format : Customer_Name, Item code, Description, Width, Thick, PackType,
                            RMA Quantity, Order Date                     
Condition
Column
RMA QTY
Ordered_Quantity
oett.order_type_id
So_order_types_all sota,oe_order_type_tl oett
where sota.order_type_id = oett.transaction_type_id
and oett.name like ‘%RMA%’
Ooh.Order_date
Between :p_form_date and :p_to_date
Orders Fulfilled 
OLA.FLOW_STATUS_CODE =’CLOSED’
Group by
Org_id,Organization_id,Item
Tables Related:
MTL_SYSTEM_ITEMS, MTL_DESCR_ELEMENT_VALUES, RA_CUSTOMERS, OE_ORDER_HEADERS_ALL, OE_ORDER_LINES_ALL

 

SHIPMENT REPORT – CUSTOMER WISE / ORDER TYPE WISE
Parameters    : P_Org_Id, P_Organization_id, P_Customer_Name, P_From_Date,P_To_Date 
Description   : Shipments for the period group by customer/order_type
Report Format :
General : (Customer wise)
Detailed Report: (CUSTOMER WISE / ORDER TYPE WISE)
CUSTOMER, ORDER_TYPE, order date, order number, item code, Description, Shipped Qty
Summary: (CUSTOMER WISE / ORDER TYPE WISE)
CUSTOMER, ORDER_TYPE, Item code, Description, Shipped Qty
 
Condition
Column
Get Info
ool.ordered_quanatity
Orders booked
ooh.booked_flag=’Y’
Orders<>cancelled 
Ooh.cancelled_falg=’N’
Shipped_qty
Ool.actual_shipment_date between :p_fom_date and :p_to_date
Tables Related:
MTL_SYSTEM_ITEMS, RA_CUSTOMERS, OE_ORDER_HEADERS_ALL, OE_ORDER_LINES_ALL, OE_TRANSACTION_TYPES_TL

ONHAND (Available) QTY REPORT
Parameters    : P_Org_Id,P_Organization_id ,P_SUBINV_CODE
Description   : Available Quantities based on today’s situation
Report Format : Sub Inventory Code, Item code, Description, QOH,
Condition
Column
RMA QTY
Ordered_Quantity
oett.order_type_id
So_order_types_all sota,oe_order_type_tl oett
where sota.order_type_id = oett.transaction_type_id
and oett.name like ‘%RMA%’
Ooh.Order_date
Between :p_form_date and :p_to_date
Orders Fulfilled 
OLA.FLOW_STATUS_CODE =’CLOSED’
Group by
Org_id,Organization_id,Item
Tables Related:
MTL_SYSTEM_ITEMS, MTL_RESERVATIONS, MTL_ONHAND_QUANTITIES
(The link between MTL_RESERVATIONS and OE_ORDER_LINES tables is OE_ORDER_SOURCES)

 

NO TRANSACTION ITEMS
Parameters    : P_Org_Id, P_Organization_id, P_ORDER_TYPE_ID, P_Customer_Name,
                            P_From_Date, P_To_Date
Description   : find the items that are not having any type of transaction on them for the day1 in an organization
Report Format : Customer_Name, Item code, Description, Width, Thick, PackType,
                            RMA Quantity, Order Date                     
Logic:
Items form mtl_system_items msi
Minus
Items in mtl_material_transactions mmt
Query:
SELECT  ORGANIZATION_ID,ORGANIZATION_CODE, SEGEMENT1,DESCRIPTION
FROM MTL_SYSTEM_ITEMS MSI, ORG_ORGNIZATION_DEFINITIONS OOD
WHERE TRANSACTION_DATE <=:TO_DATE
AND   OOD.ORGANZIATION_ID =:P_ORGANIZATION_ID
AND   MSI.ORGANITION_ID =:P_ORGANZIATION_ID
MINUS
SELECT
ORGANIZATION_ID,ORGANIZATION_CODE,SEGEMENT1,DESCRIPTION
FROM MTL_MATERIAL_TRANSACTIONS MMT, MTL_SYSTEM_ITEMS MSI,
ORG_ORGNIZATION_DEFINITIONS OOD
WHERE TRANSACTION_DATE <=:TO_DATE
AND   OOD.ORGANZIATION_ID =:P_ORGANIZATION_ID
AND   MSI.ORGANITION_ID =:P_ORGANZIATION_ID
AND   MMT.ORGANITION_ID =:P_ORGANZIATION_ID
AND   MMT.INVENTORY_ITEM_ID = MSI.INVENTORY_ITEM_ID
Tables Related:
MTL_SYSTEM_ITEMS, MTL_MATERIAL_TRANSACTIONS, ORG_ORGANIZATION_DEFINITIONS

 

CESS REPORT
INVOICES CESS tables:
JA_IN_SO_PICKING_LINES, JA_IN_SO_PICKING_TAX_LINES, JA_IN_TAX_CODES
INTERNAL RECEIPTS tables:
RCV_SHIPMENT_HEADERS, LINES, TRANSACTIONS, JA_IN_SO_PICKING_LINES
EXTERNAL RECEIPTS(PO) tables:
RCV_SHIPMENT_HEADERS, LINES, TRANSACTIONS, JA_IN_RECEIPT_LINES, JA_IN_RECEIPT_TAX_LINES,
PO_VENDORS, PO_VENDOR_SITES_ALL, PO_HEADERS_ALL, PO_DISTRIBUTIONS

 

FULL FILL MENT REPORTS
ALLOCATION FORMULA : IF GREATEST((TOTAL REQ/ AVAIL QTY)%) THEN
               ALLOCATE FIRST , AND JUST GO ON.
SHORTAGE FG LEVEL  : ALLOCATE EXISTING FG QTY IN STORE FOR THE TRUCKS.
                     AND GIVES THE SHORTAGE REPORT.
SHORTAGE 1 LEVEL   : ALLOCATE EXISTING  QTY IN STORE FOR THE TRUCKS.
                     AND GIVES THE 1 LEVEL SHORTAGE REPORT.

 

Customer Credit Hold Report: Customer vs OrderHolds
Description: the details of the line items and on hand quantities of holding orders for the specified customer or all.
Parameters:  Organization_id, Cusomer_id
Tables: OOH, OOL,   OE_ORDER_HOLDS,   OE_HOLD_SOURCES,    MTL_ONHAND_QUANTITIES, MTL_RESERVATIONS,   MTL_SYSTEM_ITEMS,   RA_CUSTOMERS

Ø  Can a field be used in a report without it appearing in any data group?
·         Yes
Ø  What is the use of hidden column?
·         A hidden column is used to when a column has to embed into boilerplate text.
Ø  Can a formula column be obtained through a select statement?
·         Yes

Ø  Question: Can u have more than one layout in report
·         It is possible to have more than one layout in a report by using the additional layout option in the layout editor.
·         Yes it is possible to run the report without parameter form by setting the PARAM value to Null

Ø  What are the Default types we have in Concurrent program?
·         Columns/rows:  These two fields we mansion the no’s of columns/rows if we went to display per page to the concurrent program output.
·         Note:- by default is landscape   columns -132, rows-45

Ø  How do you print the report in the character mode?
·         Change the module level property of mode to character
Ø  How to create and trigger multiple layouts based on a condition in a report’s output using XML Publisher.

1)    After developing the Report definition file (.rdf), add one more parameter as shown below.


2)    This parameter value should be assigned to Place holder column (CP) like follows. We can assign Parameter value either in the “After Parameter Form” or “Before Report” Triggers. In the below illustration, it is assigned in the “Before report” Trigger.


            Note: - place holder column should be placed at Report level.

 

3)    Create the desired number of layouts in XML Publisher for the rtf as shown below.
4)    Now add condition (If) Field for handling the multi layouts. Depending on the output of the condition, the corresponding layout will be selected for the report output.




5)    Double click on if condition which was added in the above step. Then the following screen will be displayed.
 
6)   Click On Add help text Button which will display the below screen.
 

è What are the steps involved in development of a xml report?
to generate an XML report u can create an RDF report from report builder and then while registering it as a concurrent program choose output type as XML...this way you can create an XML report

è What is the purpose of XML report when compared to reports 6i & discoverer?
XML/BI Publisher gives the flexibility to users’ in order to select the output type in EXCEL/HTML/PDF/FO, etc as per their requirement. If a User ran a report in PDF and wants to get the same in EXCEL, its not required for them to re-run the report, Instead they can republish it using Republish option in Tools and can select the output type whatever is required.

XML/BI Publisher reports give you additional features for Reports 6i. You can get the XML Report in EXCEL/HTML/PDF etc as per the output type selected. Data Model in Reports 6i RDF will be the same but you don’t require a Layout model in the RDF File. You instead create the Layout in a Word Document using the XML Publisher Desktop installed. You can directly implement XML Publisher and is not required to implement Discoverer again.

Before the release of Discoverer 10g, Discoverer is a license free version and after its release the license has become too costly due to which the clients are going for XML Publisher reports ignoring Discoverer.

Advantages of XML/BI Publisher:
* Cost for implementing is very less compared to the license of Discoverer.
* Can create complex layouts same as we do it in Report 6i, where as complex reporting is not possible in Discoverer.
* Can run the report in 5 different Output Formats and export them.
* If you require the report in 5 different output types, you don’t need to run the report 5 times. You can run the report once and can republish it again in other types.
* You don’t require any different web browser for running the report; it can be directly run on the Concurrent Environment itself.
* You can code the report to dynamically select the layouts (templates) in XML Publisher, Similar to the functionality of Format Trigger in Reports 6i which is not possible in Discoverer.

Limitations/Disadvantages of XML/BI Publisher: 
* It’s not recommended for ad-hoc reporting like Discoverer. 
* Its very hard to debug a report unlike Discoverer.
* We can’t draw Pie Charts/Graphs as like in Discoverer.


No comments:

Post a Comment