QUERY FOR CUSTOMERS FULL DEBIT AND CREDIT WITH CLOSING BALANCE

Hi Friends,
   I need query for CUSTOMERS FULL DEBIT AND CREDIT WITH CLOSING BALANCE for selection criteria from date and to date.
   I know the Trial Balance Report will sort out this issue... but i need routeday wise report
1. Business Partner Master Data - i created one UDF field called U_Routeday (MONDAY, TUESDAY, WEDNESDAY,THURSDAY,FRIDAY)
2. The query should be like selection criteria 
                              - Routeday [%0]
                              - Posting Date [%1]                           
                              - Posting Date [%2]
CardCode
Debit
Credit
Balance
D10503
25031.50
24711.50
2962.00
D10641
5466.00
7460.00
285.00
D10642
2866.00
142.00
give any helpful query ASAP... Thanks in advance

Hi,
Try this query:
Declare
@fromdate as datetime
Declare
@Todate as datetime
Declare
@Code as nvarchar(25)
set
@fromdate = ( select min(Ta.[RefDate]) from OJDT ta where
Ta.[RefDate] >= [%0])
set
@Todate = ( select max(Tb.[RefDate]) from OJDT tb where Tb.[RefDate]
<= [%1])
set
@code = (select max(Tc.[ShortName]) from JDT1 tC where Tc.[ShortName]
= [%2])
SELECT
[Name] as AcctName, [Jan]= sum([1]), [Feb]= sum([2]), [Mar]=
sum([3]), [Apr]= sum([4]),  [May]= sum([5]), [June]= sum([6]),
[July]= sum([7]), [Aug]= sum([8]), [Sept]= sum([9]), [Oct]=
sum([10]), [Nov]= sum([11]), [Dec]= sum([12]), total = sum
(isnull([1],0)+ isnull([2],0) + isnull([3],0) + isnull([4],0) +
isnull([5],0) + isnull([6],0) + isnull([7],0) + isnull([8],0) +
isnull([9],0)+ isnull([10],0) + isnull([11],0) + isnull([12],0))
from
(SELECT
T0.[ShortName] as Name, sum(T0.[Debit]-T0.[Credit]) as T,
month(T2.[RefDate]) as month FROM JDT1 T0  INNER JOIN OACT T1 ON
T0.Account = T1.AcctCode INNER JOIN OJDT T2 ON T0.TransId =
T2.TransId WHERE T2.[RefDate] between @fromdate and @todate and
T0.[ShortName]  = @code  GROUP BY T0.[ShortName],T2.[RefDate] ) S
Pivot
(sum(T)
For  Month IN ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12])) P
group
by [Name],[1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12]
Let me know your result.
Thanks & Regards,
Nagarajan

Similar Messages

  • Opening debit and credit in trial balance

    Hi experts
    My client wants to see the trial balance as below.
    Account Head     Opening Debit     Opening Credit     Period Debit     Period Credit     Closing Debit     Closing Credit
    i have searched but i could not get the above format. Can I get the above format to see the trial balance in sap.
    or if i need to develop the same then what would be the table and field so that i can make the functional spec.
    As I am new in sap , I need your help.
    Regards
    Deb

    S_PL0_86000030 - G/L Account Balances (New)

  • Show debit and credit of documents

    Hi,
    what is the transaction with which i can show the debit and the credit of each document.
    for e.g with FBL3N we can show documents but we must enter inside for showing details (debit and credit).
    for having a quick consultation of documents how to do?
    please help,
    regards

    Hi,
    what is the transaction with which i can show the debit and the credit of each document?
    for e.g with FBL3N we can show documents but we must enter inside for showing details (debit and credit).
    please help,
    regards

  • FI Customer Account Statement with Debit and Credit Columns

    Hi SAP Expert,
    We are using form (developed from T-code: SE71) to send customer account statment for only open items this is working fine.
    Now My wants customer account statement for all transactions but with debit and credit in a separate columns. is there any way we fulfill these kind of request?
    if any particular logic then let me know please.
    thanks in advance
    b/r
    prashant rane

    Dear Vivek,
    You logic is helpful can I apply this in SE71 form development?
    Below is my customer layout format
    Document # | Document Date | Reference | Debit Amt | Credit Amt |
    In bottom toal Debit / credit balance figure
    can I use any code/login is SE71 form or I will need to create any development report which involves user exit?
    I am looking for SE71 optios first
    thanks in advance
    Prashant Rane

  • How to know debit and credit transaction key for movement type

    Hi,
    With T. code OMWB  account assignment simulation we can see all the accounts which are involve for debit and credit enties   but I want to know is there any T. code or method  with which we can know  which transaction key will be debit and which will be credited  like  for movement type  101 the transaction keys are GBB, BSX  WRX  etc.  i want o know whethere GBB a

    Hi,
      Thanks for your reply,  but with this we can see the for GBB which is the credit account and which account is use for debit entry,  like this for all transaction event key like WRX, BSX etc. we can see the G/L account use for Debit and credit,  but i want to know for particular selction of Plant, material , movement type,  my GBB account will have entry in debit account or credit account  How we can know this.
    regards,
    zafar

  • Debit and credit accounts with a movement type

    Hi,
        I want to know how we can get detiils about whenver there is a goods movement then which account will be debited and which account will be credited,  in  OMWB,  we can see all the account but how to know which will be debited and which will be credited.
      regards,
       zafar

    Hi,
       When I check in OMWB - Simulation for one material for movement type 201,
    Posting Lines Text                     VlGCd       AGC        VCl       PK                 Acct Deb.              PK                     Acct Cr.
    Inventory posting                        0001        -e-           2000    89                     300002                99                        300002
    Offsetting entry for inventory    0001                        2000     81                    --Missing-             91                        --Missing
    Offsetting entry for inventory    0001                        2000     81                    --Missing-             91                         --Missing
    Gain/loss from revaluation          0001          -e-         2000    83                         233000            93                           233000
    Inventory posting                        0001         -e-          2000     89                         300002          99                             300002
    Cost (price) differences              0001         -e-          2000    83                          893022         93                             893022
    Offsetting entry for inventory     0001        VBR         2000    81                          890000          91                               890000
    Inventory posting                          0001         -e-          2000                                                       99                                300002
    and when I have done one goods movement for materai; with movement type 201,  the accounting entry is generated as below
    MS10     1     99          300002     Intermediate Goods S     44.00-     INR     
    MS10     2     81          890000     Consumption of SFG     44.00     INR     
    as per this from account 300002  amount 44 is deducted  and in account 890000 Amount 44 is added     
    now i have not clear  in simulation it is showing so amny accounts  then how to know whcih account is getting updated debit and credi   also what is meaning of  -e- IN agc, 
      regards,
       zafar

  • F110- not able to clear the debit and credit entry with the same reference

    Hi,
    I am not able to clear the debit and credit entry with the same reference in F110 even after having the payment terms as immediate payment, payment method is maintained in document no and vendor master data. Both debit and credit entry is appearing in FBL1N as an open item but it is not appearing in F110.
    In Log message appear as 8 days grace period is existing whereas as payment term is just 0001- immediate payment.
    Kindly advice me what could be wrong.
    Thanks,
    Manya.

    Hi,
    Credit and debit balance in vendor account are not cleared automatically when only vendor line item has payment method and credit memo has not payment method. Also when there is not payment method maintained in vendor master data.
    In such case to avoid payment to vendor when vendor has debit balance we perform debit balance check.
    In second scenario when u2018individual paymentu2019 is selected in vendor master data vendor invoice and credit memo are not cleared automatically in F110.
    To setoff vendor credit and debit balance in F110 you to uncheck u2018individual paymentu2019 check in vendor master data > company code data > payment data.
    Thanks!
    Raju

  • Not able to generate total for debit and credit columns in FSG

    SR 3-1507064871
    Version - 12.0.6
    Created a FSG report using "Note 311912.1 - How to Create FSGs to show Debit and Credit Balances in Different Columns"
    But not being able to get the totals of the columns.
    When trying to do totals, it always sum up and brings the result as zero.
    Edited by: user10637798 on Mar 15, 2010 3:17 AM

    Please relink all executables on test and retest the issue
    if issue still exist then
    please see
    A Few Tests Might Be Corrupted When Running A Diagnostics Test [ID 1377769.1]
    please reapply those patches with adpatch option given in the doc and retest the issue on test
    AppsMAsti
    Sharing is Caring

  • Debit and credit note - integration between mm & sd with fi

    Hi,
    How does the information flow from MM & SD to FI in the process of raising a DEBIT and CREDIT NOTES' respectively?
    (I'm aware of the fact that we need to define the document types "KG" and "DG" and raise the aforementioned by using F-41 & F-27).
    However, my doubts are:
    1. At what point do we need an FI-MM and FI-SD integration in raising the debit and credit notes'.
    2. What is the role of an MM and SD end user along with FI end user in raising the DEBIT AND CREDIT notes, i.e., how do we deal with the inventory in MM in the process of PURCHASE RETURNS and the goods and value of goods sold as far as SALES RETURNS IS concerned, i.e., once purchase returns and sales returns are booked in the relevant deparments, at what point does an accounts executive or FI end user come into picture to raise the aforementioned.
    Regards
    Sandhya

    Hi,
    How does the information flow from MM & SD to FI in the process of raising a DEBIT and CREDIT NOTES' respectively?
    (I'm aware of the fact that we need to define the document types "KG" and "DG" and raise the aforementioned by using F-41 & F-27).
    However, my doubts are:
    1. At what point do we need an FI-MM and FI-SD integration in raising the debit and credit notes'.
    2. What is the role of an MM and SD end user along with FI end user in raising the DEBIT AND CREDIT notes, i.e., how do we deal with the inventory in MM in the process of PURCHASE RETURNS and the goods and value of goods sold as far as SALES RETURNS IS concerned, i.e., once purchase returns and sales returns are booked in the relevant deparments, at what point does an accounts executive or FI end user come into picture to raise the aforementioned.
    Regards
    Sandhya

  • Use of cost relevant Item categories L2N and G2N for debit and credit memo

    Dear Forum memebers,
    For  credit and debit memo  one of the customised client repot is showing  cost value which is not expected for credit and debit memo in the invoice register.
    This is due to use of L2N and G2N which are cost relevant item categories.
    Why should debit and credit memo item category should be cost relevant.??
    Best Regards,
    Kanwal

    Well if your company do not want to adjust the cost of goods sold when any credit / debit is raised, then yes you can go ahead.
    Thanks
    Sai
    Edited by: Sai on Nov 18, 2009 7:47 PM

  • Query for the FULL AND FINAL SETTLEMENT REPORT

    Hi,  any one  has the query for the FULL AND FINAL SETTLEMENT REPORT in oracle hrms??

    Hi,
    I go through that .class file and find that they have used below package in that.
    PAY_IN_TERM_RPRT_GEN_PKG
    Hope this will help you.

  • New pricing procedure for debit and credit memo

    Hello Sir,
    After defining new pricing procedure of debit and credit memo for retro billing.copy control using pricing type b in VTFF but it take billing pricing in credit and debit memo.not in new pricing .Is am missing something please suggest proper solution .

    Thanks for precious time given please go through this
    Tax Calculate
    Basic
    10.0000
    100.0000
    12%
    1.2000
    12.0000
    2%
    0.0240
    0.2400
    1%
    0.0120
    0.1200
    Total
    11.2360
    112.3600
    12.50%
    1.4045
    14.0450
    Net
    12.6405
    126.4050
    tax calculate like this but it come
    Basic
    10.0000
    100.0000
    12%
    1.2000
    12.0000
    2%
    0.0240
    0.2400
    1%
    0.0120
    0.1200
    Total
    11.2360
    112.3600
    so,plz suggest how it calculate including vat
    vat/cst

  • Report FS Item debit and credit separated

    Dear Gurus,
    In FI Financial Statement Variant is usual to separate debit and credit balance in diferent nodes for some accounts. This is done because debit is taken as asset and credit as liability.
    I'm triying to do this in FS Item Hierarchy, but unable. Consolidation database stores total account balance (debit + credit), and query shows the same information. I tried with the sign in the FS item definition, but it changes in both nodes.
    Any clues on how to do this?
    Thanks in advance for your help.
    Best regards,
    Manuel.

    Hello Manuel,
    Thanks for your detailed information. Now it's more understandable what you meant.
    OK. Here we go.
    There are 2 characteristics in SEM-BCS which may change the sign of the incoming during data load amounts : MovementType and FS item itself. Debit sign represent plus and credit sign u2013 minus. The signs may act together: if the data load method usage of both signs is set up, then the resulting amount is determined as following:
    Resulting amount = Incoming amount * SignOfItem * SignOfMoveType.
    Certainly, itu2019s possible to use a sign only one of the characteristics or not to use at all.
    Again, it is related only to the uploaded information. And the sign of the turnover should be determined by the supplying system, since itu2019s clear that on the asset account might be credit activities, and for example, on a liability account u2013 debit activity.
    The system expects the internal presentation of amounts in the database as conforming the accounting logic (with small numbers of exceptions):
    Assets in B/S and Expenses in I/S as positive and
    Equity and liabilities in B/S and Revenues in I/S u2013 negative.
    The external presentation of  reports depend completely on:
    1.     hierarchies built on FS items (if used in queries)
    2.     structure of queries.
    Theoretically, I may construct a BEx query where all positive amounts will be in one column and all negatives u2013 in another one.
    >
    > As a workaround, I think that the following will do (if possible): 0BCS_C50 infocube has only total balance for each account. The solution would be to show total balance in assets if credit balance or show total balance in liabilities if debit balance.
    Then, if to remember about internal presentation of the amounts in the B/S, it's easier to apply the following logic:
    Negative amounts on the assets accounts is to be reclassified to liabilities and
    Positive amounts on the liabilities accounts  is to be reclassified to assets.
    Reclasses in SEM-BCS may do such a job.

  • Microsoft Query for Office 2013 Home and Business

    Where can I get Microsoft Query for Office 2013 Home and Business version?  I have used it for years on my old XP machine with Office 2003.
    Thank you, Sue

    Hi,
    You seem got an error like "Microsoft query could not be started because it isn’t installed" when you used it. 
    It may be not installed yet. We can go to "Control Panel\All Control Panel Items\Programs and Features\Office 2013 Home and Business\change\Microsoft tools\MS query" and check if it is installed/enabled.
    If it is not installed, please use the Install CD/ full installation copy to reinstall it.
    http://social.technet.microsoft.com/Forums/office/en-US/eb7bfe7d-8fa4-4faf-8563-13ae8b04346d/microsoft-query-could-not-be-started-because-it-isnt-installed?forum=excel (It
    also applies to Excel 2013)
    Regards,
    George Zhao
    TechNet Community Support

  • Debit and Credit notes not to update COPA cost of sales when doing price ad

    Hi Experts,
    Please help me to fix the below issue.
    When we correct price adjustments on customer accounts we use debit and credit notes to do these price corrections. We first process a ZCR order type with reference to the original invoice to reverse the transaction and then we process a debit meme request ZDR with the correct details to invoice the customer correctly.
    These credit and Debit memo request are purley for pricing problems and do not effect cost of sales. Currently these Debit and credit memos are updating the cost of Sales value field (COS on Market Price - VV013) .
    This creates a problem since the credit and debit memo happen in subsequent months e.g. The credit memo is reversed at the old cost of sales value since SAP keeps a reference to the cost of sales at that time but the debit memo creates the cost sales at the new standard cost which is obviously not the same as the original cost of sales. We therefore sit with differences which will not equal FI since FI cost of sales was updated with the goods issue price in the month that the goods issue happened.
    We therefore need to zerorise the following value fields when doing ZDR dedit memo and billing type ZL2 and ZCR credit memo billing type ZG2.
    Gross Weight in KG VV004
    Invoiced Qty KG net VV002
    Invoiced Qty in L VV001
    Invoiced Qty in L15 VV003
    Invoiced Quantity VV005
    COS on Market Price VV013
    VV001 to VV005 are quantity fields and VV013 is Value field.
    Please help me how to fix the issue.
    Regards,
    Amar.

    Hi,
    Sorry, I probably confused things by mentioning Revenue. Your settings are correct, with Revenue defined as a revenue element (11) rather than a cost element (1).
    With respect to WIP (P&L), I would create it as a cost element, since it represents the absorption of cost centre costs and materials into the production of goods, even though the goods are not yet complete. When the goods are completed they will be credited in CO-OM and debited to stock using a similar entry. The impact of these credits (to WIP or to Stock) is to move costs out of CO-OM into the goods produced (CoGS). In CO-OM, the net result of Costs less credits to WIP/Stock, indicates the efficiency of your cost centres or the accuracy of your standards.
    I would also create the manufacturing variance accounts as Cost Elements and settle them back to your production costs centres (or possibly CO-PA if you used it), since they are also a reflection of the efficiency of your cost centres - i.e. if a Cost Centre manager is not achieving the standards, (s)he should be accountable for the variance, and if you are concerned about reconciling CO-OM and the costs in P&L, you won't reconcile if the variances aren't posted back to CO.
    Regards,
    Marc

Maybe you are looking for

  • Bug report 01

    Bug report 01 In the ScoreWindow, with the INbutton activated, and with the WholeNoteSymbol selected in the PartBox : Playing a note on an external MIDI-keyboard will insert a note with any note length, EXCEPT the selected whole (1/1) note. Anybody e

  • Need a help to Update Infotype.....

    Hi Experts, *am developing HR-ABAP Report inthat, i have data in 2 internal tables, through these (itabs) i want to* *insert the data into 2 Ztables(Respective tables) and then i want to Update one Custom Infotype.* how can i procedure for this? is t

  • Why does Magic Bullet Looks not work

    Help, I am having troubles with the plugin Magic Bullet Looks working with FCP X. I understand it is up to Apple to update and fix this. Andy news on this issue? Tjapko

  • SAPscript layout -Repeating Main window in same page

    Hi, I have a requirement in sapscript layout to duplicate content within a page in two sections, of which the content can span across multiple pages. Can anyone give an idea how this can be achieved. This particular layout has 3 sections: 1st window

  • Grading in Color from Premiere Pro

    Hello all! I was asked to do some grading on a short film (shot in HDV). Unfortunately the film was edited in Premiere Pro and I would like to use Color (as we all know it is superior). At first I was going to just export the EDLs and import them int