Seperator in report

I have an Apex page which has a report region on. The source of the report region is some SQL which summarises data in a table, grouping by date, something like this -
26-October-2008 Record 1
26-October-2008 Record 2
26-October-2008 Record 3
27-October-2008 Record 1
27-October-2008 Record 2
Is there any way to split the data in groups by date? So I end up with something like this -
26-October-2008 Record 1
26-October-2008 Record 2
26-October-2008 Record 3
27-October-2008 Record 1
27-October-2008 Record 2
i.e. so the data looks a little neater

Hi,
This is what I've done:
SQL Statement:
SELECT DEPTNO,
ENAME,
DENSE_RANK() OVER(PARTITION BY DEPTNO ORDER BY DEPTNO, ENAME) X,
COUNT(*) OVER(PARTITION BY DEPTNO) Y
FROM EMP
ORDER BY 1, 2I then created a new Template (through Shared Components, Templates) - using the following:
Template Type: Report
Create: From Scratch
Name: Any name you like
Theme: Your current theme
Template Class: Custom 1
Template Type: Named Column (row template)
When this was created, I used the following settings:
Row Template 1:
<tr><td>#1#</td><td>#2#</td><tr>
<tr><td colspan=2><hr style="width:100%"></td><tr>Row Template 1 Condition: Use Based on PL/SQL Expression
Row Template 1 Expression:
#X# = #Y#Row Template 2:
<tr><td>#1#</td><td>#2#</td><tr>Row Template 2 Condition and expression left blank
Before Rows:
<table>
<col style="width:100px;">
<col style="width:200px;">
<tr><td><b>ID</b></td><td><b>Employee</b></td></tr>After Rows:
</table>I left the pagination settings empty, but these can be copied from another report template if they are needed
The sql statement will generate a rownumber within each "group" (column X) and a count of the number of items within the group (column Y). The template will then compare these two values and, if they match, we are on the last row of the group, so we output a HR tag (Row Template 1). If they don't match, then just output a normal row (Row Template 2).
Andy

Similar Messages

  • Reports fetching both PR ans PO values as planned cost

    Hello Gurus,
    SAP PS standard reports like POC, S_ALR_873013531 are fetching PR+PO value in planned cost. How can we restrict it to get only PO value
    Srinag

    Dear Srinag,
    As per my understanding of your problem, report is S_ALR_87013531 where plancost shows sum of PR and PO. Now if you want PR and PO value seperately use report  S_ALR_87013558 where values are comming in RenOrdPlan(Remaining Planning)
    Commitment (PR+PO) and actual. etc now if you want to PR and PO commitment seperately then use report CJI5.
    I think this will help you little bit
    Regards,
    Nilesh

  • Report tree query

    Hi All,
    I want to execute seperately a report which is displayed in report tree,
    the program name it shows is something like FBRX01GLPCTSFINSTAT-FA-X.
    What does this name signifies ?
    Thanks.

    Report Tree:
    An ABAP reporting tree program that allows the user to press enter or double click on any line. The report is updated with new internal table data and re-written. The cursor and paging returns to the exact same line the user was on, even though the report was re-written from the internal table. Input fields are filled with data based on ENTER of DOUBLE CLICK. [+] and [-] is displayed on each line and changes if user selects to expand/collapse.
    Here, you specify the name of the tree to be used for report selection in the application menu. SAP supplies one default tree per application, but customers can create their own trees and overwrite the SAP tree.
    Under Extras -> Control, you can define whether the reports in the tree are to be displayed in a selection window or on a separate screen. To suppress the processing of report trees for the relevant application by choosing Inactive . When you call report selection in the application menu, the list selected in the report list is then displayed.
    It is also possible to deactivate the report tree for any end-user in any application by setting the user parameter 'KBT' to 'X'.
    Transporting the Tree Sructure
    When you change a tree, it is included in a transport request (transport object R3TR SRTR). The following are then transported:
    • The tree structure all the texts
    • Node entries (the names of the reports and variants)
    The following are not automatically transported:
    • User-specific settings (initial position, sub.trees, visible entries)
    • Saved lists
    When you change a node, it is also included in a transport request. The following are then transported:
    • Node entries (the names of the reports and variants)
    Manual Transport (for Special Cases)
    The tree structure is stored in the table SERPTREE. A tree structure can only be transported as a whole, and the transport request should contain the following entry:
    • R3TR TABU SERPTREE and SERPT. Function R transports all trees from the source system and overwrites those in the target system.
    • R3TR TABU SERPTREE und SERPT. Function K transports only those trees specified on the next screen. You must enter function R. You can only specify the tree ID; the node ID must be specified generically.
    If you want to overwrite a tree structure in the target system, the node contents (table SREPOVARI, see below) and the user-specific views (table SERPENTR and SREPOUSER, see below) should also be transported, or at least deleted in the target system.
    Transporting Node Contents
    The contents of report tree nodes (reports and variants) are stored in the table SREPOVARI. In this case, you should make the following entry in the transport request:
    • R3TR TABU SREPOVARI. Function R transports the contents of all nodes of all trees from the source system and overwrites those in the target system.
    • R3TR TABU SREPOVARI. Function K transports only the node contents specified in the next screen. You enter function R here.
    If you want to overwrite a node in the target system, the user-specific views (table SREPOUSER, see below) should also be transported, or at least deleted in the target system.
    Transporting User-Specific Views
    The views of the report tree are stored in the table SERPENTR. You must make the following entry in the transport request:
    • R3TR TABU SERPENTR. Function R transports the views of all users of all trees from the source system and overwrites those in the target system.
    • R3TR TABU SERPENTR. Function K transports only those views specified on the next screen. You enter function R here.
    The views of the nodes are stored in the table SREPOUSER. You must make the following entry in the transport request:
    • R3TR TABU SREPOUSER. Function R transports the view of all users of all nodes from the source system and overwrites those in the target system.
    • R3TR TABU SREPOUSER. Function K transports only those views specified on the next screen. You enter function R here.
    Delete country-specific reports from report tree
    Example
    Deleting country-specific personnel reports from the report tree, for example, deleting the reports for USA.
    Further notes
    Selection criteria on the selection screen:
    • Reports to be deleted: Specify the report name (optional)
    • Report tree: for example, SAP1 for the tree displayed when you choose Information systems -> Gen.report selection.
    • Delete also in user trees: Default = checkbox selected.
    • Change database: Test mode = Checkbox not selected, i.e. no database updates.
    When you execute the report, you get a list of all countries for which country-specific reports can be deleted. You then select the countries for which you want to delete reports.
    • To delete single reports, choose Country-spec. report. To delete all country-specific reports for the countries selected, choose Delete tree area.
    • When you choose Delete tree area, you are prompted to confirm the deletion. The selected reports are then deleted and the system displays a log of the deleted reports (also in test mode).
    Working with Reports in the Report Tree
    Prerequisites
    Once you have accessed General Report Selection, you can expand the report tree structure to find the reports you want to start and perform other related functions:
    You can:
    • Start reports
    • Start reports in the background
    • Find reports
    • Display report attributes
    • Display report variants
    • Display report documentation
    • Access and start reports that do not appear in the report tree
    Procedure
    Starting Reports
    1. Expand the report tree structure until you reach the required report
    2. Position the cursor on the report and choose Execute (or double-click on the report)
    If the report has no selection screen, the resulting list is displayed immediately.
    If the report has a selection screen, go to step 3.
    3. Enter your selection criteria and choose Execute
    For an example of how to start a report in General Report Selection, see:
    Starting a Report in the Report Tree: Example
    Starting Reports in the Background
    Only reports, for which variants exist, can be started in the background. You must also schedule a background job.
    To start a report in the background:
    1. Expand the report tree structure until you reach the required report
    2. Position the cursor on the report and choose Execute in background
    For more information about working with variants and scheduling background jobs, see:
    Variants
    Background Processing
    Searching For Reports
    To find a particular report in the report tree structure:
    1. Choose Edit  Find  Objects
    2. Enter your search criteria
    You can enter basic search criteria and, for ABAP reports only, additional search criteria.
    Basic Search Criteria
    Search criterion Remarks
    Report name This is the technical name of the report (for ABAP report, Report Writer reports, and transactions), or the user group for queries.
    Extended report name This is the technical name of the report (for drilldown reports or report portfolio reports), or the query name for queries.
    Title This is the report title. Here, the system searches for a title that matches the user's entry exactly.
    Node This is the technical name of a node in the report tree.
    You can specify additional selection criteria for ABAP reports as specified in the program attributes:
    Additional Search Criteria
    Search criterion
    Application
    Logical database
    Created by
    Last changed by
    To determine the area in which you want to search for a report, check the appropriate boxes as follows:
    Restrict Search Area
    Restrict to… Action
    Whole report tree Enter the technical name of the root node and select Find in subordinate nodes.
    Sub-tree Enter the technical name of the sub-tree node and select Find in subordinate nodes.
    Node Enter the technical name of the node and select Find in subordinate nodes.
    You can search for a report using one or more character strings that appear in the report documentation, but this is very time-intensive.
    You can also perform generic searches using *.
    3. Choose Execute
    The list of results is sorted by node.
    Displaying Report Attributes
    To display the attributes of a report in the report tree structure:
    1. Position the cursor on the relevant report
    2. Choose Edit  Node attributes
    You see the following information (if present):
     Report type
     Technical name of the underlying executable program
     Extended report name
     Report variant
    Checkboxes also indicate whether:
     The report is started using a variant
     The selection screen of the report is skipped
    Displaying Report Variants
    If a report has variants, these are listed as subordinate nodes. You can start variants just like any other reports.
    To display the variants of a report in a different way:
    1. Position the cursor on the relevant report
    2. Choose Goto  Variants
    3. Ensure that the Variants field is left blank and get a list of possible entries
    4. Choose Display
    You see a list of variants defined for the report.
    If you want to start a report in the background, you must create a variant first.
    For more information about working with variants, see:
    Variants
    Displaying Report Documentation
    To display detailed documentation about a report:
    1. Position the cursor on the relevant report
    2. Choose Goto  Documentation
    Starting Reports not in the Report Tree
    If the report you want to start is not in the report tree, and you cannot access it through other menus, you can start it by running the underlying executable program. To do this, you need to know the program name:
    1. Choose Goto  General reporting
    2. Enter the program name
    3. Choose Execute
    For further information about working with reports, see:
    Reports
    Starting a Report in the Report Tree: Example
    To get a list of the remaining leave entitlement of various employees:
    1. On the General Report Selection screen, expand the tree structure by choosing Human Resources  Time management  Absence
    2. Place the cursor on the Leave Overview report and choose Execute (or double-click the report)
    3. Enter your selection criteria and execute the report
    The system displays the results on the screen.
    Report Variants
    Definition
    Group of selection criteria that has been saved. A report can have several different variants, with each variant retrieving different types of information. For example, a vendor report might have one variant for U.S. vendors and another variant for European vendors.
    Use
    Instead of entering the same values in the selection criteria input fields each time you execute a report, you can enter the values once and then save the selection criteria as a variant. The next time you execute the report, you only need to enter the variant name, not the selection criteria. If you use variants, the selection criteria screen is already filled with data.
    To execute certain reports, you must use a variant. In this case, a system message prompts you to do so. Although you are not always required to use variants or selection criteria, it is a good idea to use them when possible. Your resulting lists will be smaller and take less time for the system to process.
    Background Processing
    Use
    In background processing, the SAP System automatically runs any report or program that you can start interactively.
    When you schedule a job in the background processing system, you must specify:
    • The ABAP report or external program that should be started
    • The start time
    • The printing specifications
    The background processing system starts your job and runs the program(s) that you specify. Afterwards, you can check whether your job was executed successfully and display a log of any system messages.
    Suppose you need to run a report of customers whose bills are overdue.You can:
    o Start the report yourself from the ABAP Editor. If you do this, the system runs the report interactively, in a session at your PC or workstation. While the report is being processed, your computer response time may be slower.
    o Or, you can have the background processing system run the report. To do this, you must create a background job that tells the system what you want it to do.
    The background processing system runs your "late bills" report according to your instructions. The list generated by the report is either printed directly or is waiting for you in the SAP output controller (see Using the Output Controller).You can also check in the background processing system whether the report ran correctly.
    Features
    • Running a report in the background does not tie up the SAP sessions you are currently working with.
    When you start a report interactively, your current SAP session is blocked for further input for as long as the report runs.
    When you start the report in the background, running the report does not influence your interactive work with the SAP System.
    • You can shift the execution of reports to the evening or other periods of low load on the SAP System.
    You can schedule a report or external program to run at any time that the SAP System is active. You can also set up reports to run automatically on a regular basis (for example, on the last day of each month).
    • Background processing is the only way you can execute long-running jobs.
    To prevent tying up system resources with interactive sessions for long reports, the SAP System has a built-in time limit on interactive sessions. If a single ABAP report runs for more than 5 minutes continuously in an interactive session, the SAP System terminates the report automatically.
    The background processing system executes long-running ABAP reports more efficiently. Often, such reports are automatically scheduled for execution in the background. In this case, you do not need to schedule them for background processing yourself.
    Reports
    Use
    When you are working in the SAP System, you may want to access information from the database. To do this, you use reports.
    In this documentation, report refers to the report program, and list refers to the output – that is, the results of the report.
    Some reports display information; others allow you to perform analyses.
    A report must be started, or executed. In many cases, the SAP System automatically executes a report. Sometimes, however, you will want to execute a report yourself.
    In addition to report programs, the SAP System provides numerous reporting tools, each of which has its own set of procedures for executing report programs.
    This documentation describes report programs only. For an introduction to the SAP reporting tools, refer to the Reporting Made Easy guidebooks (Release 4.0B). You can find these guidebooks at: www.saplabs.com/rme .
    <b>Kindly reward this if found useful</b>

  • Not enough memory to manipulate image

    I created a report to print out 10 graphs(control image).
    But the program gives error:not enough memory to manipulate image. I did the same in other programs, I have the same number of graphs, there was no problem.
    what's the real reason of this error?
    I attach my printing routine here.
    Attachments:
    print_graphs.vi ‏57 KB

    I seperated the report into two(each with 5 graphs).the error persisted. then I open some other Labview program and run it with printing command. it did not print any thing, nor did it give any error.
    then when I ended the program and shut down LABVIEW, it gave out a warnning said: internal error occurred.
    I did not know what exacly the error is. I did try to to report the error to NI. and after that when I reopen my program (which gave out "not enough memory to manipulate images" error), and re-run it. it worked and I could print. the error did not appear this time. But I'm not sure if it would come out again later.

  • Currency Translation question

    When the currency translation is executed..it overwrite the reporting currency by new amount.
    Q1>>How to find out additive impact by each each account for currency translation changes.?
    For example I have 1000 accounts, which for which currency translation is executed. Can I know the currency translation changes per each account seperately for reporting purpose?
    Client wants to do the complete audit trail of amount posted by currency translation. is it possible..
    How it is possible. Is it possible thru movement type to track the currency translation by each account?
    Q2>>DATASRC dimension has a property IS_CONSOLIDATED? has some one used it before? What it is used for?
    Please explain a bit..because the documentation from SAP is very brief..
    Apprecaite inputs...

    Hi Doodwala,
    I'm not sure I'm following your question 1. Do you mean that you want to track the difference between the new and old reporting currency amount when the LC amount changes? Or do you want to track the change in the translated amount if the rate changes (or more likely using a different rate)?
    If your audit requirement is to track every record change then it is going to be very arduous to do this in a custom way. I'd recommend looking into the delivered audit trail functionality to see if that meets your requriements. There is a bit of information about this functionality here: [http://help.sap.com/saphelp_bpc70sp02/helpdata/en/e1/8999faf82c4a61acd65683a8cedafe/frameset.htm]
    Question 2 was asked and answered in this thread: [IS_CONSOLIDATED in DATASRC;
    Ethan

  • Captivate 7 and the Aggregator Project

    I would like to know if I can build an aggregator project consisting of 7 modules in Captivate 7. Each module has its’ own quiz. Each quiz is scored seperately and reports score to the LMS seperately.
    I tried this in Captivate 4 and 5, but could not get the individual scores to report to the LMS, only a score for a single test would report. Because my users are nurses, they have very limited amount of time available to take these courses. Currently, I build indiviual courses and post them requiring the nurses to access each course and registar seperately.  If there are 7 modules, they have to make sure they registar for all 7, take all 7, and get all 7 results posted to their transcripts for continuing education credits. If I can combine them into 1 aggregator project, but still be able to have 7 different quizzies that all report to the LMS apon completion, this would lower the amount of time that our nurses have to spend finding, registering for, and taking multiple courses in our current environment.  We can do it in Lectora, but the cost of the software and yearly license fees is very costly.  To be able to do this in Adobe Captivate would allow us to keep our costs down in software, licenses, and human capital. Any help is greatly appreciated.

    You need to build this course as a multi-SCORM package.  The Aggregator tool is not for building SCORM courses for an LMS.  Use the Adobe Multi-SCORM Packaging tool instead.

  • 9iJSP Report output to a comma seperated file

    Hi,
    Is it possible to create a comma seperated file with output data from a 9iJSP report. If yes, can anyone tell me how ??
    thanks in advance
    Unmesh

    Hello Unmesh,
    If your JSP report has a paper layout, then you can use Reports Builder or the client/servlet/runtime executables to generate the paper layout to CSV formatted output with the DESFORMAT=DELIMITEDDATA and DELIMITER=, command-line options. If you have only a web layout , it will generate its output only in HTML format.
    You can add a paper/web layout to your JSP report, if it already doesn't have one, by opening it in Reports Builder, and inserting a report block in the paper layout view/web source view. This JSP report can then be used both to generate to CSV format using rwservlet, and to the web when deployed as a JSP.
    Thanks,
    The Oracle Reports Team.

  • Download report from answers in CSV( Comma seperated)

    Hi
    I am trying to download the report from answers in .csv format
    the . csv file is tab seperated
    But the requirement is to have comma seperated
    Is there any option in obiee to change the delimiter as comma
    Kindly help me
    Regards
    Abdul

    Thanks for the link. But I am not sure of which file to edit.
    Can u please tell the exact file where to change
    I am using obiee 10g
    Regards
    Abdul

  • Seperator in BI report

    Hi All,
    How can i change the seperator in my BI report,say for example i have it as 1.000,00 in my report,i would like to change it to 1,000.00.
    Thanks,
    Sriram

    Sriram,
    Change the properties of the Key figure infoobject in Additional Properties tab.
    Have a look at user specific data ( Own Data )
    Regards,
    RK Ghattamaneni.

  • Report over two tables with shuttle seperated values listed per row

    Hy,
    I have created an application with 3 Tables: products (P_ID), applications(A_ID), crosstable (ID, A_ID, P_ID) for the assignment.
    In the app it´s possible to define the involved products for each application.
    Now I need a summary page, where all involved products, for each application are listed.
    My problem is, the table application (column:products) includes only tangent product PK, seperated by comma as a result of a shuttle field.
    For the summary report i need all app informations incl. product real names, correctly listed, each in a row.
    Exists a simple chance without BI-Publisher to create this report, maybe with decode or similar.
    Thanks Tom

    Hello,
    Did you already have a look at apex_util.string_to_table (and table_to_string)?
    I guess that could help you.
    An example is here: Using Shuttles and multiple values.
    Regards,
    Dimitri
    -- http://dgielis.blogspot.com/
    -- http://www.apex-evangelists.com/
    -- http://www.apexblogs.info/

  • How to create a report where records are seperated

    Hi
    I am busy creating a Shareholders GL Account CR based off OACT, OJDT, JDT1. The fields to be displayed on the report will be OJDT.RefDate, OJDT.Memo, Amount (Formula = JDT1.Debit - JDT1.Credit), Balance (Running Total based off @Amount field, summed and to change when group OACT.AcctCode changes).
    I have created a group based off OACT.AcctCode (so I can get seperate records for each Shareholder Account), I have created parameters from and to as well as date from and to (but these might need to change)
    Now when running just for x1 Shareholder record it pulls through the correct final amount as in SBO (but dates are not as what they should be, not in order), if I pull all Shareholders accounts all the records show but not on seperate pages (like a page break for each record). What I am wanting is that for every record they will have their page range (exampke 1 to 5 then 1 to 2 etc), then a page break and the new Shareholder record will start from the top again with the Page Headers etc.
    With this in mind when running the report it will need to be run between dates + Shareholders accounts and all Shareholders accounts shown in the Group Box on the left of the preview window, when selecting the Shareholder account on the left you can view the relevant details, when clicking onto a new Shareholder account it will show you the new record on a new page.
    Can anyone point me in the right direction?
    Regards
    Kurt Walters

    Hi Julie
    Thanks very much for the reply, it is much appreciated, I will try your resolution and let you know.
    Regards
    Kurt

  • Is there any report which I can see the clearing items seperately

    Dear Experts,
    Is there any standard report which I can see manual clearing postings with chargoff amount.
    Normally this is posting with document type-AB. There are other documents with AB as reversal documents,
    settlements and other expenses. So we cannot differentiate by document type.
    Is there any other way to develop this report?
    Regards
    Shanu

    Dear Shanu,
    Goto to Layout there is field called Doc Status.
    In the status if it is A - Clearing Document and B means Reset Clearing Document.
    Sorry i was wrong it will not give you the required format.
    We have to look some other way
    Edited by: lolu jo on Apr 12, 2011 11:12 PM

  • Emp seperation report (How can I get inactive emp separately)

    Hi.. Frdzs,
    We have employee separation report in this my client requirement is he want to generate inacive (status) separately, regarding this I have taken STATUS as out field but through this I'm getting all status (acive, Inactive, etc).
    So, pls let me know how can I get employees report status wise.
    Awaiting for ur reply.
    $Lakshmi

    Hi,
    Have you selected the Value 1 in the Employee Status field. Then definetly, you will get the Employee list who are all in the Inactive State.
    Good Luck
    Om
    Reward it, if u feel helpful.

  • Passing Multiple comma seperated values to a report

    Hi,
    I have a form that a user can select multiple customer ids by checking the check box. I need to pass these values to report to be used in the IN clause of query. eg.
    select a, b, c
    from test
    where a in ('01', '03', ...)
    how can i do that
    Faisal

    Hi Faisal
    I've used the solution discussed here and works fine.
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:110612348061
    Regards.
    Cecilio

  • Need india based tax reports of VAT,Excise duty, etc seperately

    Hi All,
    I need India based reports like RG1, Input tax in the given time, output tax in the given time.

    Hi Nagaraju...
    You can try this one....Basicaly this report give you all the details regarding your purchase and all that...
    *Declare @DateFrom Datetime*
    *Declare @DateTo Datetime*
    *set @DateFrom = '20101001'*
    *set @DateTo = '20111005'*
    *SELECT T20.Cardcode,T20.CardName, T11.[TaxId11], T11.[AddrType], T20.[Address], T20.[BillToDef] INTO #TIN FROM OCRD T20  INNER JOIN CRD7 T11 ON T20.CardCode = T11.CardCode WHERE T11.Address IS NULL OR T11.Address = '' AND T11.AddrType='S' AND T20.Cardtype='S'*
    *Select *,*
    *CASE*
          *WHEN (Basic + BED + SAD + ECess + HCess) <> 0 AND ROUND(CST / (Basic + BED + SAD + ECess + HCess),2) = .02 THEN CST*
          *ELSE NULL*
    *END 'CST2%',*
    *CASE*
          *WHEN (Basic + BED + SAD + ECess + HCess) <> 0 AND ROUND(CST / (Basic + BED + SAD + ECess + HCess),2) = .03 THEN CST*
          *ELSE NULL*
    *END 'CST3%',*
    *CASE*
          *WHEN (Basic + BED + SAD + ECess + HCess) <> 0 AND ROUND(CST / (Basic + BED + SAD + ECess + HCess),2) = .04 THEN CST*
          *ELSE NULL*
    *END 'CST4%',*
    *CASE*
          *WHEN (Basic + BED + SAD + ECess + HCess) <> 0 AND ROUND(VAT / (Basic + BED + SAD + ECess + HCess),2) = .04 THEN VAT*
          *ELSE NULL*
    *END 'VAT4%',*
    *CASE*
          *WHEN (Basic + BED + SAD + ECess + HCess) <> 0 AND ROUND(VAT / (Basic + BED + SAD + ECess + HCess),2) = .125 THEN VAT*
          *ELSE NULL*
    *END 'VAT12.5%',*
    *CASE*
          *WHEN Basic <> 0 AND ROUND(BED / Basic ,2) = .08 THEN BED*
          *ELSE NULL*
    *END 'BED8%',*
    *CASE*
          *WHEN Basic <> 0 AND ROUND(BED / Basic ,2) = .10 THEN BED*
          *ELSE NULL*
    *END 'BED10%',*
    *CASE*
          *WHEN (Basic + BED + SAD + ECess + HCess) <> 0 AND ROUND(VAT / (Basic + BED + SAD + ECess + HCess),2) = .135 THEN VAT*
          *ELSE NULL*
    *END 'VAT13.5%'*
    *FROM*
    *SELECT DISTINCT*
    *(Select CompnyName from OADM) Company,*
    *T0.DocNum AS 'Invoice / Bill No.',*
    *T0.DocDate as ' Invoice / Bill Date',*
    *T0.CardName as 'Seller Name',*
    *(Convert(varchar,T6.Block) + ', '+Convert(Varchar,T6.Address)+', '+Convert(Varchar,T6.City)+', '+Convert(Varchar,T6.Zipcode)+' '+Convert(Varchar,T6.Country)) 'Seller Address',*
    *T7.Name 'State',*
    *SUM( T1.LineTotal )  as 'Basic' ,*
    *SUM(T1.[VatSum])   as 'TotalTax',*
    *SUM( T1.LineTotal +T1.[VatSum]) as 'InclTax',* 
    *T0.[TotalExpns] 'Freight Charge',*
    *T1.[TaxCode],*
    *T0.NumAtCard 'Vendor Ref. No',*
    *T5.DocNum as 'P.O/Memo No',*
    *T5.DocDate as 'P.O/Memo Date' ,*
    *T8.[SeriesName] 'Purpose',*
    *T17.Taxid11'Tin No',*
    *(Select distinct isnull(Sum(PCH4.taxsum),0) from PCH4 where PCH4.statype=-90 and PCH4.docentry=T0.Docentry  )BED,*
    *(Select distinct isnull(Sum(PCH4.taxsum),0) from PCH4 where PCH4.statype=-60 and PCH4.docentry=T0.Docentry )ECess,*
    *(Select distinct isnull(Sum(PCH4.taxsum),0) from PCH4 where PCH4.statype=10 and PCH4.docentry=T0.Docentry )SAD,*
    *(Select distinct isnull(Sum(PCH4.taxsum),0) from PCH4 where PCH4.statype=1 and PCH4.docentry=T0.Docentry )VAT,*
    *(Select distinct isnull(Sum(PCH4.taxsum),0) from PCH4 where PCH4.statype=4 and PCH4.docentry=T0.Docentry )CST,*
    *(Select distinct isnull(Sum(PCH4.taxsum),0) from PCH4 where PCH4.statype=5 and PCH4.docentry=T0.Docentry )ServiceTax,*
    *(Select distinct isnull(Sum(PCH4.taxsum),0) from PCH4 where PCH4.statype=6 and PCH4.docentry=T0.Docentry )ECessForService,*
    *(Select distinct isnull(Sum(PCH4.taxsum),0) from PCH4 where PCH4.statype=7 and PCH4.docentry=T0.Docentry )HCess,*
    *(Select distinct isnull(Sum(PCH4.taxsum),0) from PCH4 where PCH4.statype=8 and PCH4.docentry=T0.Docentry )Surcharge,*
    *(Select distinct isnull(Sum(PCH4.taxsum),0) from PCH4 where PCH4.statype=25 and PCH4.docentry=T0.Docentry)Freight,*
    *(Select distinct isnull(Sum(PCH4.taxsum),0) from PCH4 where PCH4.statype=15 and PCH4.docentry=T0.Docentry )ADC,*
    *(Select distinct isnull(Sum(PCH4.taxsum),0) from PCH4 where PCH4.statype=16 and PCH4.docentry=T0.Docentry )CustomeECess,*
    *(Select distinct isnull(Sum(PCH4.taxsum),0) from PCH4 where PCH4.statype=12 and PCH4.docentry=T0.Docentry )CVD,*
    *(Select distinct isnull(Sum(PCH4.taxsum),0) from PCH4 where PCH4.statype=22 and PCH4.docentry=T0.Docentry )CustomHECess*
    *FROM  OPCH  T0*
    *INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry*
    *INNER JOIN PCH12  T3 ON T3.DocEntry = T0.DocEntry*
    *LEFT OUTER JOIN PDN1 T4 ON T4.TrgetEntry = T0.DocEntry*
    *LEFT OUTER JOIN OPOR T5 ON T5.DocEntry = T4.BaseEntry*
    *INNER JOIN OCRD T6 ON T0.Cardcode= T6.Cardcode*
    *Left Outer JOIN OCST T7 ON T7.Code =T3.State AND T7.Country=T6.Country*
    *INNER JOIN NNM1 T8 ON T8.Series = T0.Series*
    *LEFT OUTER JOIN #TIN T17 ON T0.CardCode=T17.Cardcode*
    *INNER JOIN PCH4 T13 ON T0.DocEntry=T13.DocEntry*
    *WHERE*
    *     T0.DocDate >= @DateFrom  AND  T0.DocDate <= @DateTo*
    *     AND T13.StaType=1     *
    *GROUP BY*
    *T0.DocEntry,*
    *T0.DocNum,*
    *T0.DocDate,*
    *T0.CardName,*
    *(Convert(varchar,T6.Block) + ', '+Convert(Varchar,T6.Address)+', '+Convert(Varchar,T6.City)+', '+Convert(Varchar,T6.Zipcode)+' '+Convert(Varchar,T6.Country)),*
    *T7.Name ,*
    *T1.[TaxCode],*
    *T0.NumAtCard,*
    *T5.DocNum,*
    *T5.DocDate,*
    *T8.[SeriesName],*
    *T17.Taxid11,*
    *T0.[TotalExpns]*
    *)#Purchase*
    *UNION ALL*
    *Select *,*
    *CASE*
          *WHEN (Basic + BED + SAD + ECess + HCess) <> 0 AND ROUND(CST / (Basic + BED + SAD + ECess + HCess),2) = .02 THEN CST*
          *ELSE NULL*
    *END 'CST2%',*
    *CASE*
          *WHEN (Basic + BED + SAD + ECess + HCess) <> 0 AND ROUND(CST / (Basic + BED + SAD + ECess + HCess),2) = .03 THEN CST*
          *ELSE NULL*
    *END 'CST3%',*
    *CASE*
          *WHEN (Basic + BED + SAD + ECess + HCess) <> 0 AND ROUND(CST / (Basic + BED + SAD + ECess + HCess),2) = .04 THEN CST*
          *ELSE NULL*
    *END 'CST4%',*
    *CASE*
          *WHEN (Basic + BED + SAD + ECess + HCess) <> 0 AND ROUND(VAT / (Basic + BED + SAD + ECess + HCess),2) = .04 THEN VAT*
          *ELSE NULL*
    *END 'VAT4%',*
    *CASE*
          *WHEN (Basic + BED + SAD + ECess + HCess) <> 0 AND ROUND(VAT / (Basic + BED + SAD + ECess + HCess),2) = .125 THEN VAT*
          *ELSE NULL*
    *END 'VAT12.5%',*
    *CASE*
          *WHEN Basic <> 0 AND ROUND(BED / Basic ,2) = .08 THEN BED*
          *ELSE NULL*
    *END 'BED8%',*
    *CASE*
          *WHEN Basic <> 0 AND ROUND(BED / Basic ,2) = .10 THEN BED*
          *ELSE NULL*
    *END 'BED10%',*
    *CASE*
          *WHEN (Basic + BED + SAD + ECess + HCess) <> 0 AND ROUND(VAT / (Basic + BED + SAD + ECess + HCess),2) = .135 THEN VAT*
          *ELSE NULL*
    *END 'VAT13.5%'*
    *FROM*
    *SELECT DISTINCT*
    *(Select CompnyName from OADM) Company,*
    *T0.DocNum AS 'Invoice / Bill No.',*
    *T0.DocDate as ' Invoice / Bill Date',*
    *T0.CardName as 'Seller Name',*
    *(Convert(varchar,T6.Block) + ', '+Convert(Varchar,T6.Address)+', '+Convert(Varchar,T6.City)+', '+Convert(Varchar,T6.Zipcode)+' '+Convert(Varchar,T6.Country)) 'Seller Address',*
    *T7.Name 'State',*
    *SUM( T1.LineTotal ) * -1 as 'Basic' ,*
    *SUM(T1.[VatSum]) * -1  as 'TotalTax',*
    *SUM( T1.LineTotal +T1.[VatSum]) * -1 as 'InclTax',* 
    *T0.[TotalExpns] * -1 'Freight Charge',*
    *T1.[TaxCode],*
    *T0.NumAtCard 'Vendor Ref. No',*
    *T1.Baseref as 'P.O/Memo No',*
    *T0.DocDate as 'P.O/Memo Date' ,*
    *T8.[SeriesName] 'Purpose',*
    *T17.Taxid11'Tin No',*
    *(Select distinct isnull(Sum(RPC4.taxsum),0) from RPC4 where RPC4.statype=-90 and RPC4.docentry=T0.Docentry  )* -1 BED,*
    *(Select distinct isnull(Sum(RPC4.taxsum),0) from RPC4 where RPC4.statype=-60 and RPC4.docentry=T0.Docentry )* -1 ECess,*
    *(Select distinct isnull(Sum(RPC4.taxsum),0) from RPC4 where RPC4.statype=10 and RPC4.docentry=T0.Docentry ) * -1 SAD,*
    *(Select distinct isnull(Sum(RPC4.taxsum),0) from RPC4 where RPC4.statype=1 and RPC4.docentry=T0.Docentry ) * -1 VAT,*
    *(Select distinct isnull(Sum(RPC4.taxsum),0) from RPC4 where RPC4.statype=4 and RPC4.docentry=T0.Docentry ) * -1 CST,*
    *(Select distinct isnull(Sum(RPC4.taxsum),0) from RPC4 where RPC4.statype=5 and RPC4.docentry=T0.Docentry ) * -1 ServiceTax,*
    *(Select distinct isnull(Sum(RPC4.taxsum),0) from RPC4 where RPC4.statype=6 and RPC4.docentry=T0.Docentry ) * -1 ECessForService,*
    *(Select distinct isnull(Sum(RPC4.taxsum),0) from RPC4 where RPC4.statype=7 and RPC4.docentry=T0.Docentry ) * -1 HCess,*
    *(Select distinct isnull(Sum(RPC4.taxsum),0) from RPC4 where RPC4.statype=8 and RPC4.docentry=T0.Docentry ) * -1 Surcharge,*
    *(Select distinct isnull(Sum(RPC4.taxsum),0) from RPC4 where RPC4.statype=25 and RPC4.docentry=T0.Docentry) * -1 Freight,*
    *(Select distinct isnull(Sum(RPC4.taxsum),0) from RPC4 where RPC4.statype=15 and RPC4.docentry=T0.Docentry ) * -1 ADC,*
    *(Select distinct isnull(Sum(RPC4.taxsum),0) from RPC4 where RPC4.statype=16 and RPC4.docentry=T0.Docentry ) * -1 CustomeECess,*
    *(Select distinct isnull(Sum(RPC4.taxsum),0) from RPC4 where RPC4.statype=12 and RPC4.docentry=T0.Docentry )* -1 CVD,*
    *(Select distinct isnull(Sum(RPC4.taxsum),0) from RPC4 where RPC4.statype=22 and RPC4.docentry=T0.Docentry )* -1 CustomHECess*
    *FROM  ORPC  T0*
    *INNER JOIN RPC1 T1 ON T0.DocEntry = T1.DocEntry*
    *INNER JOIN RPC12  T3 ON T3.DocEntry = T0.DocEntry*
    *INNER JOIN OCRD T6 ON T0.Cardcode= T6.Cardcode*
    *Left Outer JOIN OCST T7 ON T7.Code =T3.State AND T7.Country=T6.Country*
    *INNER JOIN NNM1 T8 ON T8.Series = T0.Series*
    *LEFT OUTER JOIN #TIN T17 ON T0.CardCode=T17.Cardcode*
    *INNER JOIN RPC4 T13 ON T0.DocEntry=T13.DocEntry*
    *WHERE*
    *     T0.DocDate >= @DateFrom  AND  T0.DocDate <= @DateTo*
    *     AND T13.StaType=1     *
    *GROUP BY*
    *T0.DocEntry,*
    *T0.DocNum,*
    *T0.DocDate,*
    *T0.CardName,*
    *(Convert(varchar,T6.Block) + ', '+Convert(Varchar,T6.Address)+', '+Convert(Varchar,T6.City)+', '+Convert(Varchar,T6.Zipcode)+' '+Convert(Varchar,T6.Country)),*
    *T7.Name ,*
    *T1.[TaxCode],*
    *T0.NumAtCard,*
    *T1.baseref,*
    *T8.[SeriesName],*
    *T17.Taxid11,*
    *T0.[TotalExpns]*
    *)#MEMO*
    *DROP TABLE #TIN*
    you can thet the table name for A/R Sales and get the salres report too for the same.
    Edited by: itskumaramit on Mar 19, 2011 3:43 AM

Maybe you are looking for

  • Get the class file name of the JSP page

    Hi I'm wondering how I can get the class name associated with the current JSP page... I found on this forum how get the name of current JSP page, but it doesn't help me... Thanks

  • Posting date in Dunning Document

    Hello Everybody, I need to know how I can put my desired posting date in a dunning document ,which is generated through tcode FPVA and FPVB. As of now it is automatically taking the present date(date at which tranaction is run) as posting date. It wo

  • Air runtime crashing-any ideas how to fix?

    Working on a MacBook Pro, I recently upgraded to Lion. Prior I had little or no difficulties launching a program (Cricut Craft Room) that needs Adobe Air to work. Since Lion upgrade lots of Air crashes and application unexpectedly quits. I've tried u

  • Mvt type creation

    dear sirs, pl. let me know the steps to create a new movement type. i tried with OMJJ and by copying the existing mvt type, but while copying it self i am getting an error <b>Specify the key within the work area Message no. SV033 Diagnosis You have a

  • I give up on my N78-3

    I've had the N78 for 8 weeks now and I've just sent it in to Nokia for repairs. I'm fully aware that my N78 really just needs a firmware update but I've run out of ideas. Nokia Customer Care acknowledges there are problems but no one knows if or when