Sum Debit and Credit where code between 1001001001 and 1001001999 in Report

Hi all
I Create a Simple Report
Which is
SELECT initcap(Acc_name),to_char(acc_id),to_char(acc_id),control_detail,+
Opening_balance, NVL(cb.C,0) as Credit, NVL(Cb.D,0) as Debit,+
Opening_balance+NVL(cb.D,0)-NVL(Cb.C,0) Closing_balance,+
Cb1.dr,cb1.cr,+
Opening_balance+NVL(cb.D,0)-NVL(Cb.C,0)+nvl(cb1.Dr,0)-nvl(cb1.Cr,0)Ending+
from COA,+
*(Select cb_acc_id,sum(nvl(dabit,0)) D ,sum(nvl(credit,0)) C from cb*
where vdate < :Date_from+
Group by cb_acc_id)CB,+
*(Select cb_acc_id,sum(nvl(dabit,0))Dr ,sum(nvl(credit,0))Cr from Cb*
Where vdate between nvl(:Date_from,vdate) and nvl(:date_to ,vdate)+
Group by cb_acc_id)CB1+
Where acc_id = cb.cb_acc_id (+) and+
acc_id =cb1.cb_acc_id (+)+
CONNECT BY PRIOR acc_id = CATAGORY_id+
START WITH acc_id between 01 and 1000+
ORDER SIBLINGS BY acc_id+
Now i need To sum Debit and Credit where code between 1001001001 and 1001001999
Need Help
Regard
Shahzaib ismail

Hi,
Usually it can be determined using the field shkzg. If it contain 'S' its debit and if it contains 'H' then its credit.
Before showing the amount you need to do like;
IF wa_gl-shkzg = 'H'.
wa_gl-dmbtr = wa_gl-dmbtr * (-1). " dbmtr - amount
ENDIF.
This will solve your problem.
Regards
Karthik D
Edited by: Karthik D on Jun 3, 2009 12:29 PM

Similar Messages

  • Select where timestamp between date1 and date 2

    try a lot of variations but still dont work
    this was my last shot, then i come here ask for help
    the field DATAHORAS is timestamp
    data1 and dat2 will come from a form
    To_Date(S.DATAHORAS, 'dd/mm/yyyy hh24:mi:ss')
    Between Cast(To_Date(:data1) As TimeStamp) And Cast(To_Date(:data2) As TimeStamp)
    thanks in advanced

    No. You don't need to. But....
    Edit: I was originally using a stupid example using DUAL which was completely misleading - sorry.
    Originally I used the example below to show that you don't have to do an explicit conversion.
    Things will still work comparing timestamps and dates.
    SQL> select systimestamp, sysdate, sysdate+1
      2  from dual
      3  where systimestamp between sysdate and sysdate + 1;
    SYSTIMESTAMP                        SYSDATE              SYSDATE+1
    09-FEB-10 13.58.35.712017 +00:00    09-FEB-2010 13:58:35 10-FEB-2010 13:58:35But then I added an explain plan to show that implicit conversions were going on:
    1  explain plan for
      2  select systimestamp, sysdate, sysdate+1
      3  from dual
      4* where systimestamp between sysdate and sysdate + 1
    SQL> /
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 4192335797
    | Id  | Operation        | Name              | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |                   |     1 |     1   (0)| 00:00:01 |
    |*  1 |  FILTER          |                   |       |            |          |
    |   2 |   INDEX FULL SCAN| SYS_IOT_TOP_57625 |     1 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       1 - filter(SYS_EXTRACT_UTC(SYSTIMESTAMP(6))<=SYS_EXTRACT_UTC(SYSDATE@
                  !+1) AND SYS_EXTRACT_UTC(SYSTIMESTAMP(6))>=SYS_EXTRACT_UTC(SYSDATE@!))
    15 rows selected.
    SQL>However, this example is misleading because it's not the same implicit conversion you get with a proper table with a timestamp column:
    SQL> create table t1
      2  (col1 timestamp);
    Table created.
    SQL> ed
    Wrote file afiedt.buf
      1   explain plan
      2   for
      3   select *
      4   from   t1
      5   where col1 between to_date('08-JAN-2010','DD-MON-YYYY')
      6*             and     to_date('09-JAN-2010','DD-MON-YYYY')
    SQL> /
    Explained.
    SQL>
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3617692013
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |    13 |     2   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| T1   |     1 |    13 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       1 - filter("COL1">=TIMESTAMP' 2010-01-08 00:00:00' AND
                  "COL1"<=TIMESTAMP' 2010-01-09 00:00:00')
    Note
       - dynamic sampling used for this statement
    18 rows selected.
    SQL>Which is really what you want.
    It has an implicit conversion on the date parameters and no implicit conversion on the column which would prevent index usage if there were an index.
    Interestingly if you explicitly convert the dates to a timestamp, then you can get an extra filter predicate comparing the two parameters:
    SQL> explain plan
      2  for
      3  select *
      4  from   t1
      5  where col1 between cast(to_date('08-JAN-2010','DD-MON-YYYY') as timestamp)
      6             and     cast(to_date('09-JAN-2010','DD-MON-YYYY') as timestamp);
    Explained.
    SQL>
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3332582666
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |    13 |     2   (0)| 00:00:01 |
    |*  1 |  FILTER            |      |       |       |            |          |
    |*  2 |   TABLE ACCESS FULL| T1   |     1 |    13 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       1 - filter(CAST(TO_DATE(' 2010-01-08 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss') AS timestamp)<=CAST(TO_DATE(' 2010-01-09 00:00:00',
                  'syyyy-mm-dd hh24:mi:ss') AS timestamp))
       2 - filter("COL1">=CAST(TO_DATE(' 2010-01-08 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss') AS timestamp) AND "COL1"<=CAST(TO_DATE(' 2010-01-09
                  00:00:00', 'syyyy-mm-dd hh24:mi:ss') AS timestamp))
    Note
    PLAN_TABLE_OUTPUT
       - dynamic sampling used for this statement
    23 rows selected.oracle version 11.1.0.6
    Sorry about the mistakes in previous version of this reply.
    Edited by: DomBrooks on Feb 9, 2010 2:25 PM

  • How to achieve that "SELECT * FROM table WHERE age BETWEEN 18 AND 23 AND n"

    How to achieve the SQL like that "SELECT * FROM table WHERE age BETWEEN 18 AND 23 AND name = 'Will' " with BDB C-API
    The primary key in the primary database is 'age' ,and the secondary key in the secondary index is 'name' ,in a lot of examples ,there are all simple , but how to do that complex one.thx~

    but this means that the prepared statement is created
    each time I call my method and so I'm not sure that
    the optimizer will find it easy to cope with.You are right, the optimizer won't find that easy to deal with (presuming that is even relevant for your driver/database.) But most optimizers won't do anything with statements that change and that is what you are doing.
    You could create several prepared statements which have a common number of bind variables. For example 10 statements with from 1 to 10 bind values. This will work if most of the queries use those.

  • 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

  • Credit Management: Difference Between Static and Dynamic Credit Check

    Hi,
    Could anyone tell the difference Between Static and Dynamic Credit Check?
    According to website: http://www.sap-basis-abap.com/sd/difference-between-static-and-dynamic-credit-check.htm ... this is the answer:
    ====================
    Simple Credit Check : Tr.Code - FD32
    It Considers the Doc.Value + Open Items.
    Doc.Value : Sales Order Has been saved but not delivered
    Open Item : Sales Order has been saved , Delivered, Billed & Transfered to FI, but not received the payment from the customer.
    Static Credit Check it checks all these doc value & check with the credit limit
    1) Open Doc.Value / Sales Order Value : Which is save but not delievered
    2) Open Delivery Doc.Value : Which is delivered but not billed
    3) Open Billing Doc.Value : Which is billed but not posted to FI
    4) Open Item : Which is transfered to FI but not received from the customer.
    Dynamic Credit Check         1) Open Doc
                                                2) Open Delivery
                                                3) Open Billing
                                                4) Open Items
                                                5) Horizon Period = Eg.3Months
    Here the System will not consider the above 1, 2, 3 & 4 values for the lost 3 months.    
    ====================
    Question 1: Could you further explain the above information, if there is any?
    Question 2:: What is the Tcode to customize settings of:
    a) Simple Credit Check (isn't this same with b) below?)
    b) Static Credit Check
    c) Dynamic Credit Check

    Hi Tanish,
    Diff between Static and Dynamic Filters.
    Example One at report Level.
    Create a variable for a Infoobject say ,Material .
    1)In the Query Designer and if u restrict it to some 10 materials at query level, the report will display for only those 10 materials only.This is Static Filter.UR AHrdcoding it to those materials.You cant change them at Query Run time.i.e not changeable by user.
    2)If u give the variable as input ,and when u run the query ,u can can choose the material,may 10 may be 1 or may 20 .It is dynamic.Changeable by user at run time
    Example Two at DTP and Start Routine Level,say Document Type.
    1)If u give filters in Start routine it is Static as u cannot change it in Production,not changeable by user.
    2)f u give filters in DTP it is Dyanamic as u can change it in Production.U can give any doc type,Changeable by user at run time.
    Hope it is Understood.
    Rgds
    SVU

  • Sharing code between Flex and AIR versions using library project

    Hello everyone,
    I'm developing an application that has both Flex and AIR versions. In order to share code between these apps, I created a library project and added all my code there. Now I've set the library project as a dependency for both Flex and AIR projects. Since there are some components that use the DataService object, I've added fds.swc and fds_rb.swc and fiber_rb.swc modules to the libs directory of the library project. No compile errors. Now, if I try to run my Flex application, I'm getting this error:
    Variable mx.data::LocalStoreFactory is not defined.
    I know that this error comes up when playerfds.swc is not present in the path. But that is not the case here. I have added playerfds.swc, fds.swc and related lib files to the build path.
    If I go back and add the playerfds.swc file to the original library project, the error no longer appears. This is not a proper solution for me, since I need to share this project with AIR version also, and I cannot have both playerfds.swc and airfds.swc in the same project.. Has anyone faced an issue like this before?? What am I doing wrong??

    Hello everyone,
    I'm developing an application that has both Flex and AIR versions. In order to share code between these apps, I created a library project and added all my code there. Now I've set the library project as a dependency for both Flex and AIR projects. Since there are some components that use the DataService object, I've added fds.swc and fds_rb.swc and fiber_rb.swc modules to the libs directory of the library project. No compile errors. Now, if I try to run my Flex application, I'm getting this error:
    Variable mx.data::LocalStoreFactory is not defined.
    I know that this error comes up when playerfds.swc is not present in the path. But that is not the case here. I have added playerfds.swc, fds.swc and related lib files to the build path.
    If I go back and add the playerfds.swc file to the original library project, the error no longer appears. This is not a proper solution for me, since I need to share this project with AIR version also, and I cannot have both playerfds.swc and airfds.swc in the same project.. Has anyone faced an issue like this before?? What am I doing wrong??

  • I can not find my itune credit where did it go and how do I get it back?

    I put my credit card on my account and then toolkit off. I used it for a purchase. Now that I have removed my credit card from my apple ID I can't find or use the itune credit I had before. Anyone help me please.

    I did notice that you are on a Mac.
    Did you read my above reply?
    This change happened because the View menu got a cleanup
    *[https://bugzilla.mozilla.org/show_bug.cgi?id=513168 bug 513168] - Remove "Stop" and "Reload" from View menu
    *[https://bugzilla.mozilla.org/show_bug.cgi?id=519937 bug 519937] - Remove "Back", "Forward" and "Home" from History menu
    (<i>Please do not comment in bug reports: https://bugzilla.mozilla.org/page.cgi?id=etiquette.html</i>)
    On a Mac the menu bar is maintained by the Mac OS, so the extension that can be used on other platforms to bring back this menu item won't work and because of that I didn't post it.
    There is an extension to bring back the Reload and Page Source items in the View menu.
    * Comeback View Menuitems: https://addons.mozilla.org/firefox/addon/comeback-view-menuitems/

  • Log and Capture - where are the cuts and renames stored

    I'm having a problem where I'm loosing the cuts and clip renames

    Sorry about that (I'm new to FCP)
    Log and transfer sequentially renames all of the clips when I point to the AVCHD directory on my mac (which I copied from the camera). It, unfortunatly, doesn't add any leading 0's, and it sorts alphabetically, so my clips are out of order (1, 10, 11, 12, 13...2, 20). The process that I have been following, in order to get them back into order, is to add leading 0's to make them the same length (eg Clip# 1 becomes Clip# 001...). This is a real pain and I would welcome suggestions on how to improve this process. I would be much happier if it used the start time of the clip (or even the sequential 5-digit clip number that comes off of the camera)
    In 'Log and Transfer' I am setting in and out points on the clips. When I add them to the import batch the utility only brings in the video between the points.
    My problem is that, on a few occations, I have gone through the hour or so that it takes to do this only to find that the changes are gone when I reloaded the project. Most of the time it works fine but, if I knew how / where it stored this info, I would be able to verify it and make sure that it's archived...
    Thanks again for your help
    John

  • Pages and Numbers not sync between ipad and macbook pro. icloud problem?

    My Pages and Numbers are stopped synchronizing via icloud between ipad and macbook pro. Everytime I edit something to Pages or Numbers on my ipad, my ipad failed to upload the edited version to icloud. what happened?

    I have a slightly different problem with Numbers and Pages failing to sync between a Macbook and iPad via iCloud. I have checked all the obvious settings. I think the problem may be that the Macbook username is my email address, whereas the iPad username is my wife's email address. However, both addresses are named alibis for exactly the same email address from our internet provider – eg we get the same emails, despite appearing to have different addresses. So I don't understand why the iPad cannot pick up Numbers or Pages files that have been opened and saved in iCloud on my Macbook. Other apps, such as iCal, sync perfectly, but i guess they don't use iCloud. Any help appreciated!
    (We have tried emailing Numbers files to the iPad, but that is very slow and innefective.) 

  • After Update of iPad and MacBookPro no communication between AppleTV and Devices

    After Update of my iPad 2 with iOS 6.0 and OS to 10.8.2 there is no communication between AppleTV and these devices.

    Start with this and follow all of the links and see it any of these suggestions work.
    http://support.apple.com/kb/ts1368

  • Connection errors (lots and lots of them) between HDV and FCP 6

    So this is a tragedy for me so far. I have a $3500 Cannon XH A1, and an equally expensive Macbook Pro. The problem is, I can't get a connection via firewire between the two. I've changed the presets a bunch of times to what I think the correct specs are, nothing has worked. But when I flip on the the right settings on my school's computers (which run FCP 5), it works fine.
    I'm out of ideas. I've updated everything, I even tried this pointless apple tutorial telling me to delete QT receipts. Can anyone help me?

    Well, it might take a bit of time to straighten out, but probably not a tragedy.
    First, was your move to 10.5.1 a clean install? If you just installed over the old OS, problems can arise. Worst case scenario is you'll have to strip the drive, reinstall the OS and updates, then install FCS 2 and the updates.
    But, some things to try first:
    Shut everything, computer, camera, etc. off
    Connect the camera to the mac via firewire, and remove any other firewire connections, even if the other connected equipment will be off (unless, of course, you'll be capturing to an external firewire drive).
    Turn the camera on to VCR mode, load the tape. (I'm assuming you want to capture TO FCP, not print back to video.
    Now turn on the Mac, fire up FCP. If any projects open with it, close them.
    Now, choose an Easy Setup; probably HDV 1080i60, or another HDV preset.
    Next, open a new empty project, and open the log and capture window.
    Are you now able to control the camera from the keyboard? And, are you able to see your footage in the log and capture window? If so, proceed with the capture.
    If this doesn't work, you may want to erase and reinstall everything on a clean drive.

  • Why does my email address and text message alternate between mine and my husbands name?

    Whenever I send an email or a text message, the name of the sender alternates between me and my husband - I'm so confused!

    Hello,
    Mail Preferences>Composing>Addressing:... is Send new Mail from set to a specific address or from Account of last viewed mailbox?
    In Address Book do you have a combined entry for you & husband?

  • Where-Used between ESR and Integration Builder

    Hello everyone,
    i am wondering if there is a possibility of finding out where and if esr-content is used in the Integration Builder (Conf.time)?
    I often face the problem that i have got ESR-Content in front of me, where i don't know if, and if yes, where this content, for example a Service Interface, is used in Configuration-Time!
    How can i determine this?
    Thanks in advance!
    Kind regards,
    Markus

    HI Markus
    in ID use following path..
    Object--> Find.
    it will open search requirement window..
    in that select receiver determination if you want to check outbound service interface from IR.. or select Interface determination in case you want to check for inbound service interface..
    suppose in IR side you have outbound service interface : CreateCustomerOutbound
    then in ID go to find and select receiver determination and in interface provide  CreateCustomerOutbound
    this will search all scenario where CreateCustomerOutbound is being used .. likewise you can narrow it down in Find option to get the required results in less time..
    but no direct method for search..
    Thanks,
    Bhupesh

  • Time between submission and publication?, Time between submission and publication?

    The forum seems to suggest that it takes about 7 days for Apple to vet and put up a book in the iBookstore. I noticed mine (submitted Feb. 7, I believe) is "expected Feb 28," or 21 days. Is that just the outside estimate? What is the experience of others who have published here?
    Thanks.

    Where did you guys get your estimated publishing date..... does Apple contact you?
    I may have published a couple of drafts, as the error codes during publishing kinda threw me off....

  • Firefox Sync doesn't sync bookmarks between smartphone and tablet.Works fine between desktop and mobiles.

    I have a desktop,smartphone and tablet.They all have the latest FX35.They are all signed in and connected to Sync.Sync is the latest version and it works with email and password, instead of pins.On all devices, Sync is configured to sync all items(bookmarks,tabs etc).
    When I enabled Sync on smartphone and tablet, they got my desktop's bookmarks without a problem.They appear in a folder named desktop bookmarks.All the changes reflect properly between smartphone-desktop and tablet-desktop, but, the bookmarks do not sync between smartphone-tablet.
    When I open a tab on the smartphone, after a while it appear on tablet's Synced Tabs page.Vice verse is true also.So at least some syncing exists between smartphone-tablet.
    Is it possible to create a bookmark on smartphone and have it appear on the tablet and vice verse,just like the synced tabs work ? I tried deleting the sync account and creating a new one, but I still don't see my smartphone's bookmarks on the tablet.
    It would be even better if there was an option to choose which device can override another device's bookmarks.I don't really need desktop bookmarks on smartphone, but I'm too scared to delete them.I'm afraid it will also delete them from desktop... ?
    Thanks.

    HI GeorgePeterson:
    So "new" aka "Firefox Accounts based sync" syncs desktop<->tablet and desktop<->phone but not phone<->tablet. Hmmm I actually have tested this S5<->Nexus 5<->desktop (Mac) and it worked.
    soooo the big question :-)
    # What desktop OS version (e.g. Mac OS X 10.10, 10.8, Windows (Windows 7, 8), Ubutuntu crafty codger ), what tablet and OS version(e.g. Nexus 7 2013, Android 5 Lollipop), what phone (e.g. Samsung Galaxy S5 Android 4.4.2)
    I will re-test too!
    Cheers!
    ...Roland

Maybe you are looking for

  • Firefox 21 slow on startup, checked articles, dis all addins still slow ie is lightning fast on startup!

    Firefox 21 is really slow on startup, I have disabled all addons, checked memory, optimized win 7, ran system mechanic but it is still slow, changed home page . IE 8.9.10 is lightning fast on startup.

  • How to transfer some tracks to OSX?

    Yesterday I found music tracks on an iPod nano that belonged to my late sister. Tracks of music she composed and played by herself. I'd like to back up those as this is the only existing copy. What is the way to copy those tracks without any risk to

  • OSX Lion fonts show up as unix files

    We have a brand new iMac with Lion pre-installed. When trying to install our fonts, a lot of them show up as unix files. Mostly Postscript Type 1 fonts like: Zapf Chancery Friz Quadrata Souvenier Avant Garde Interstate Revue Berkley Old Style Impact

  • Phatfusion sortable expands my webpage-CAN'T FIX HELP

    HELP.......please. I have a photo of before and after attached to show you what I'm talking about. I have a web template that I'm using and when I go to insert the phatfusion sortable my page expands really wide and my header and overall page is all

  • Syncing Email messages between two mac

    Can I get my email to sync between my imac and macbook? For instance, if i delete an email on one mac, i want it deleted on the other as well. or if i move an email to a different mailbox on one mac, i want it moved on the other mac as well. Thanks C