Performance Issue on "Planning Manager" program

Hi,
In order management --- the "Planning Manager" request is taking lot of time to run when we create 100,000 lines of sales orders at a time( I mean,this causes the planning manager to run slower). Can you please help me out how can i increase the planning manager request to run fast(performance)?.
Thanks In Advance,
Balu

Duplicate post:
Performance issue on AFPO
Performance issue on AFPO

Similar Messages

  • Performance Issues in weblogic managed server

    Hi,
    We are facing performance issues in our managed servers in weblogic domain and in logs it is showing this error continuously.
    <Oct 2, 2013 10:39:27 AM MST> <Error> <WebLogicServer> <BEA-000337> <[STUCK] ExecuteThread: '47' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "700" seconds working on the request "Workmanager: OIMMDBWorkManager, Version: 0, Scheduled=false, Started=true, Started time: 700360 ms
    ", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
    Thread-294 "[STUCK] ExecuteThread: '47' for queue: 'weblogic.kernel.Default (self-tuning)'" <alive, suspended, blocked, priority=1, DAEMON> {
        -- Blocked trying to get lock: java.io.PrintStream@41a53700[not locked]
        java.io.PrintStream.println(PrintStream.java:755)
        com.wyndham.operations.user.eventHandlers.PostCreateOperationsEventHandler.execute(PostCreateOperationsEventHandler.java:60)
        oracle.iam.platform.kernel.impl.OrchProcessData.runPostProcessEvents(OrchProcessData.java:1225)
        oracle.iam.platform.kernel.impl.OrchProcessData.runEvents(OrchProcessData.java:665)
        oracle.iam.platform.kernel.impl.OrchProcessData.executeEvents(OrchProcessData.java:268)
        oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.resumeProcess(OrchestrationEngineImpl.java:810)
        oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.notifyParentProcess(OrchestrationEngineImpl.java:971)
        oracle.iam.platform.kernel.impl.OrchProcessData.runEvents(OrchProcessData.java:665)
        oracle.iam.platform.kernel.impl.OrchProcessData.executeEvents(OrchProcessData.java:268)
        oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.resumeProcess(OrchestrationEngineImpl.java:810)
        oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.resumeChildProcess(OrchestrationEngineImpl.java:880)
        oracle.iam.platform.kernel.impl.OrchProcessData.handleAdditionalChanges(OrchProcessData.java:552)
        oracle.iam.platform.kernel.impl.OrchProcessData.runEvents(OrchProcessData.java:665)
        oracle.iam.platform.kernel.impl.OrchProcessData.executeEvents(OrchProcessData.java:268)
        oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.resumeProcess(OrchestrationEngineImpl.java:815)
        oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.resumeProcess(OrchestrationEngineImpl.java:843)
        oracle.iam.platform.kernel.impl.OrhestrationAsyncTask.execute(OrhestrationAsyncTask.java:97)
        oracle.iam.platform.async.impl.TaskExecutor.executeUnmanagedTask(TaskExecutor.java:99)
        oracle.iam.platform.async.impl.TaskExecutor.execute(TaskExecutor.java:52)
        oracle.iam.platform.async.messaging.MessageReceiver.onMessage(MessageReceiver.java:60)
        sun.reflect.GeneratedMethodAccessor1493.invoke(Unknown Source)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        java.lang.reflect.Method.invoke(Method.java:575)
        com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
        com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
        com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:86)
        com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
        com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
        com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:102)
        com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
        com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:151)
        $Proxy460.onMessage(Unknown Source)
        weblogic.ejb.container.internal.MDListener.execute(MDListener.java:518)
        weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:467)
        weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:327)
        weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4638)
        weblogic.jms.client.JMSSession.execute(JMSSession.java:4134)
        weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3820)
        weblogic.jms.client.JMSSession.access$000(JMSSession.java:115)
    We have performed workload manager tuning in weblogic console as below.
    The property ‘Maximum Threads Constraint’ of work managers OIMMDBWorkManager = 80 and OIMUIWorkManager = 20
    Please suggest the solution.

    Hi,
    If you look more closely at the STUCK Thread stack trace, you will notice that the thread is attempting to acquire a LOCK on the following Object monitor: java.io.PrintStream@41a53700. The native thread state is also in a BLOCKED state.
    My primary recommendation is to generate a full JVM Thread Dump (next re-occurence) so we can identify the potential culprit Thread holding such lock. One more thing, please see if you have multiple snapshots of this thread 294?
    I also recommend to review the following source code:
    com.wyndham.operations.user.eventHandlers.PostCreateOperationsEventHandler.execute(PostCreateOperationsEventHandler.java:60)
    Sharing the same Stream object in this case would trigger thread lock contention given java.io.PrintStream has built-in synchronization ex:
       public void println(String x) {
      synchronized (this) {
         print(x);
         newLine();
    Regards,
    P-H
    http://javaeesupportpatterns.blogspot.com

  • Performance issues with Planning data load & Agg in 11.1.2.3.500

    We recently upgraded from 11.1.1.3 to 11.1.2.3. Post upgrade we face performance issues with one of our Planning job (eg: Job E). It takes 3x the time to complete in our new environment (11.1.2.3) when compared to the old one (11.1.1.3). This job loads then actual data and does the aggregation. The pattern which we noticed is , if we run a restructure on the application and execute this job immediately it gets completed as the same time as 11.1.1.3. However, in current production (11.1.1.3) the job runs in the following sequence Job A->Job B-> Job C->Job D->Job E and it completes on time, but if we do the same test in 11.1.2.3 in the above sequence it take 3x the time . We dont have a window to restructure the application to before running Job E  every time in Prod. Specs of the new Env is much higher than the old one.
    We have Essbase clustering (MS active/passive) in the new environment and the files are stored in the SAN drive. Could this be because of this? has any one faced performance issues in the clustered environment?

    Do you have exactly same Essbase config settings and calculations performing AGG ? . Remember something very small like UPDATECALC ON/OFF can make a BIG difference in timing..

  • Performance Issue in Document Management of SAP Solution Manager

    Hi
    We have 10k+ documents in our current project and searching any specific document takes time of around 1-2 min. Searching document via SOLAR_EVAL or Menu-->Find Document of Solarxx is giving same output in terms of response time, later being slightly better. Other projects which have comparatively less documents, etc are fine in search response times and other functionalities implemented in system like issue mgmt, etc are also ok in terms of performance.
    Can anyone please advice how this performance issue of searching specific document can be resolved?
    What first thing which hits me is cleaning SolMan KW and either archiving/deleting old versions of document (because snapshots of every change in single document is stored in solman). If this can really help in making performance better for searching documents, please advice in detail as how this can be done or share any document.
    If anyother way this can be achieved, please let me know that also.
    Points will be awarded.
    Thanks in advance.
    Regards,
    SM

    Hi
    1) Is deleting older documents is definitely going to improve response time of searching. You said 'yes' but just wanted to double sure.
    Yes
    2) This program deletes all unsed and de-linked document. I can understand 'De-linked' but not 'Unused'
    i meant the samething
    3) Deleting documents based on user id is big problem. We have almost 800 Users in SolMan, who has used this project form last 5+ years. So all these 800 users have to go into multiple selection of user id
    Try giving *
    4) I tried this on our sandbox (SP19 Level) which has shown all unused documents which can be deleted. But this deletion has to be done one-by-one. In our production, if we have 10K+ documents, i assume almost thousand or more will be residing as de-linked in KW
    Try giving *
    5) Any Documentation available on this program.
    Learnt by experience but you can check some sapnotes below
    Note 1124579 - Using SOLMAN_UNUSED_DOCUMENTS to delete unused documents
    Note 1377997 - SOLMAN_UNUSED_DOCUMENTS: No deletion conf. for each doc.
    Hope above clarifies
    Regards
    Prakhar

  • Performance Issue in Solution Manager

    Hi experts,
    Recently my solman had poor performance when I access solman_setup and configure the managed system. I have updated the database statistics as
    http://scn.sap.com/thread/3294503, but the issue persists. I access SM50 and  make s screenshot as blew:
    It seems that the report CL_DIAGLS_LMDB_UTIL===========CP and CL_ACE_CONTROLLER=============CP didn't run normally. Could you please give me some advise and then I can have a check? Thank you very much.
    Best Regards,
    Pany Pan

    Hi Rana,
    Thank you for your reply, the system information is displayed as blew:
    And the kernel release is 720_64_EXT_UC, patch 500.
    Secondly, the MOPZ is used frequently, and the SLD of solman is down, too. Has it any relation with  MOPZ? The note you mentioned above is applied for solman 7.0, so I think it's not available for my system.
    There is one dump in ST22 today, as below:
    Please give me some advise, thank you.
    Regards,
    Pany

  • Performance issue - Hyperion Planning Web

    Hi,
    We are using Hyperion Planning 3.5 and Essbase 6.5.
    Our Application & Database servers are located in Dublin,USA.We access the application through web.All users access the application from the same Dublin location have no issue with the Application performance.But user's who access the application from outsideDublin(eg - Greensboro) are finding major issues with the application performance.Specifically with webforms and while running businessrules.And the issue occurs only during the peak of budget season when most of the users access application.
    Client state that,
    "The system is much slower out in the field than here in Dublin.It literally takes 15 – 20 minutes just to make a change and then after all that, it takes an hour to see the results only to find that they had to re-enter something. It’s really a very tedious process"
    Please advise.

    I am not really sure what I can suggest as you on such an early version, you could have a look at :- http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/html_hp_admin/ch13s16.html
    The information relates to version 9.3, it may be applicable to your version but I can't confirm that.
    You could also look into increasing the java heap size for the planning web application, though I can't remember the exact process on your version, if planning is not run as a service the settings are probably in one of the start up scripts for planning.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How do you take care of performance issues in your ABAP programs?

    HI,
    SEND ME REPLAY

    hi,
    This topic has been discussed often in these forums.Check these links:
    Re: Monitoring & Performance Tuning
    Re: Query Enhancement and performance
    Re: performance tuning related issues
    Re: Performance analysis
    Re: BW performance
    In specific check this:
    take a look
    Business Intelligence Performance Tuning [original link is broken] [original link is broken] [original link is broken]
    and e-learning
    https://www.sdn.sap.com/irj/sdn/developerareas/bi?rid=/webcontent/uuid/fe5b0b5e-0501-0010-cd88-c871915ec3bf [original link is broken]
    'intermediate course'
    also take a look
    Prakash's weblog
    /people/prakash.darji/blog/2006/01/27/query-creation-checklist
    /people/prakash.darji/blog/2006/01/26/query-optimization
    BW Performance Tuning Knowledge Center - SAP Developer Network (SDN)
    Business Intelligence Performance Tuning [original link is broken] [original link is broken] [original link is broken]
    performance docs on query
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3f66ba90-0201-0010-ac8d-b61d8fd9abe9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cccad390-0201-0010-5093-fd9ec8157802
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ce7fb368-0601-0010-64ba-fadc985a1f94
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c8c4d794-0501-0010-a693-918a17e663cc
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/064fed90-0201-0010-13ae-b16fa4dab695
    oss note
    557870 'FAQ BW Query Performance'
    and 567746 'Composite note BW 3.x performance Query and Web'.
    Also take a look sdn forum performance center
    Business Intelligence Performance Tuning [original link is broken] [original link is broken] [original link is broken]
    there are lots of docs
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5ee957e5-0201-0010-9c83-fe14a43cd04a
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cccad390-0201-0010-5093-fd9ec8157802
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ce7fb368-0601-0010-64ba-fadc985a1f94
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3f66ba90-0201-0010-ac8d-b61d8fd9abe9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4c0ab590-0201-0010-bd9a-8332d8b4f09c
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1955ba90-0201-0010-d3aa-8b2a4ef6bbb2
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c8c4d794-0501-0010-a693-918a17e663cc
    and check oss note
    557870 'FAQ BW Query Performance' and 567746 'Composite note BW 3.x performance Query and Web'
    417307, 409641 etc (search with 'bw performance')
    Regards,
    Jayant

  • Performance issues using multiple CC design programs?

    Hey! I'm Gwidz, and I'm having some performance issues with my adobe programs. I primarily use Photoshop, InDesign and Illustrator for design work. I find that when I have any two of them open, I experience delays in clicking and dragging using my pen tablet, and laggy zooming in/scrolling. This issue disappears when I only have one program open.
    I just bought this laptop to use these programs. Here's the specs:
    Operating system: Windows 8 64 bit
    Processor: 4th gen intel i7 4700HQ
    Ram: 16gb DDR3
    Graphics: NVIDIA GeForce GTX 770M 3GB GDDR5
    Cost me 2000 bucks on amazon, and I'm pretty disappointed in how things are going right now. I definitely don't think it could be a hardware issue, could it?
    I'm using an SSD as my scratch disc, and using the 64 bit versions of all programs that have it. Nothing else running in the background except these programs, and yet still I experience poor performance.
    Admitedly, I'm new to windows 8, and I'm learning everything that I can about it in hopes of resolving this issue.
    If anyone has any advice, any and all is greatly aprpeciated!

    I'm seeing this exact same choppiness and VERY slow response times with the same low use of CPU and memory... WITH JUST ONE APP OPEN!  Illustrator.
    Macbook Retina Pro, 15 inch.
    I've tried with the GPU forced off, and forced on, and on autoswitching.
    I've tried clean reinstalls.  And reboots. Etc.
    This is not hardware related.  It's something utterly flawed with the way Illustrator (and InDesign) draw do things.  They are just grotesquely inefficient.
    The fact that the program/app makes no effort to use more CPU/GPU to speed up responsiveness to the user input is the real indicator of how poorly optimised this code is. 
    After Effects is better.  But it's adaptive degradation STUTTERS grotesquely, and it's actually better to try to turn that off.  Although I'm having a hard time trying to figure out how to turn that off at the moment.. forgotten where I previously found that switch.
    Photoshop is also better. 
    I'm also talking about small files. Nothing in them.  Just start drawing... Stutters... atrocious frame rates for the update of the screen and very poor response rates to input.
    This is 64 bit optimised?  I don't think so.

  • Order Management Performance Issue

    In the Oracle Applications home page, when I login as OM Super User and for order to cash functionality, when I click on Order, Returns > Quick Sales Orders screen, it takes forever to load. When I reboot my client desktop PC machine, it loads quickly.
    Any ideas how to solve this performance issue for Order Management Quick Sales?
    We are running Oracle 12.1.1 EBS on Linux 64 bit OS platform.

    Hi,
    Please see if these documents are applicable.
    Note: 845765.1 - R12: Performance Navigating To Line Item Tab: OE_AK_SOLD_TO_ORGS_V [ID 845765.1]      
    Note: 399998.1 - OEXOEORD: Performance Entering Item On A Sales Order Line
    Regards,
    Hussein

  • Performance issue - DB 9.2.0.3

    Hi,
    Oracle EBS 11.5.9 with DB 9.2.0.3
    Windows 2003.
    Suddenly we are facing performance issue. All concurrent programs started taking long time and even there is slow performance in overall application.
    How i can start diagnostic/ troubleshooting ??
    Any path/guidelines, which i can follow.
    Regards

    Do you run the following concurrent programs on regular basis?
    - Gather Schema Statistics
    - Purge Concurrent Request and/or Manager Data
    How many rows you have in the FND_CONCURRENT_PROCESSES and FND_CONCURRENT_REQUESTS tables? Make sure it does in exceed 50K by running the purge concurrent program.
    Verify that you have no errors in the alert_<SID>.log file.
    I would also suggest you review the following notes:
    Note: 169935.1 - Troubleshooting Oracle Applications Performance Issues
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=169935.1
    Note: 244040.1 - Oracle E-Business Suite Recommended Performance Patches
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=244040.1
    Note: 216205.1 - Database Initialization Parameters for Oracle Applications Release 11i
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=216205.1
    Note: 117648.1 - Troubleshooting Performance Issues in Oracle Applications/ E-Business Suite
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=117648.1

  • Performance Issue in a ABAP Report

    Hi All,
    I am facing a big performance issue in a abap program which produce the cash flow details our group of company. This is the logic I used to develop the report. (It is a SAP Script)
    - First I am getting the closed customer payment records from the table BSAD ( eg: - Type 'DZ')
    - Then I am getting the correcponding invoices from the BSAD using the same BELNR ( eg :- Type <> 'DZ')
    - Then checking the GL Entry (BSIS) for the correspongding records which select in the second stage.
    - In a Z tabel I am keeping the account list by grouping   seperate section ( Eg: - Customer recipts, fixed assets...etc).
    I have done the same thing to get the open Item balances also.
    Report is correct and running perfectly, but my issue is it's takeing long time to process. Because of this I made this report to run as a background job. But still it is taking such a long time. ( For Eg: - If 1000 records selected from the first stage, it will take about more than onr hour to process, which is not good enough to run in a live environment)
    Pls advice me how to improve the preformance of this.

    Hi Ravi,
    I am sorry I had problem in my internet connection yesterday, because of that i couldn't reply u. Here is my code. I don't is there any way to send the code as a attachement since it is a little bit big one. I am going to paste that here any way.
    Here zcashflow_matrix is the "Z" table where I am going to keep my account details by grouping.
    REPORT ZCASH_FLOW.
    INCLUDE <%_LIST>.
    *       Author             Thanura .......                            *
    TYPES   :BEGIN OF ty_voucher1,
              kunnr LIKE bseg-kunnr,
              dmbtr LIKE bseg-dmbtr,
              belnr LIKE bseg-belnr,
              hkont LIKE bseg-hkont,
              shkzg LIKE bseg-shkzg,
              xblnr LIKE bsad-xblnr,
              budat LIKE bsad-bldat,
              blart LIKE bsad-blart,
              bldat LIKE bsad-bldat,
              lifnr LIKE bseg-lifnr,
              END OF ty_voucher1.
    DATA     :it_voucher1 TYPE STANDARD TABLE OF ty_voucher1 ,
               wa_voucher1 TYPE ty_voucher1.
    DATA    : it_voucher2 TYPE STANDARD TABLE OF ty_voucher1,
               wa_voucher2 TYPE ty_voucher1.
    DATA    : it_voucher3 TYPE STANDARD TABLE OF ty_voucher1,
               wa_voucher3 TYPE ty_voucher1.
    Data : w_ITCPO type ITCPO.
    Data : w_ITCPP type ITCPP.
    DATA : w_Rcptamt LIKE bseg-dmbtr,
            w_Netamt LIKE bseg-dmbtr,
            w_IntIncomeAmt LIKE bseg-dmbtr,
            w_IntIncome LIKE bseg-dmbtr,
            w_FixedAmt LIKE bseg-dmbtr,
            w_fixedasst LIKE bseg-dmbtr,
            w_Sundry LIKE bseg-dmbtr,
            w_SundryAmt LIKE bseg-dmbtr,
            w_SuppayAmt LIKE bseg-dmbtr,
            w_Suppay LIKE bseg-dmbtr,
            w_SuppayAmt1 LIKE bseg-dmbtr,
            w_Suppay1 LIKE bseg-dmbtr,
            w_DutyAmt LIKE bseg-dmbtr,
            w_Duty LIKE bseg-dmbtr,
            w_SalaryAmt LIKE bseg-dmbtr,
            w_Salary LIKE bseg-dmbtr,
            w_TaxAmt LIKE bseg-dmbtr,
            w_Tax LIKE bseg-dmbtr,
            w_TaxAmt1 LIKE bseg-dmbtr,
            w_Tax1 LIKE bseg-dmbtr,
            w_SellAmt LIKE bseg-dmbtr,
            w_Sell LIKE bseg-dmbtr,
            w_AdminAmt LIKE bseg-dmbtr,
            w_Admin LIKE bseg-dmbtr,
            w_loanAmt LIKE bseg-dmbtr,
            w_loan LIKE bseg-dmbtr,
            w_ManAmt LIKE bseg-dmbtr,
            w_Man LIKE bseg-dmbtr,
            w_CapitalAmt LIKE bseg-dmbtr,
            w_Capital LIKE bseg-dmbtr,
            w_GroupAmt LIKE bseg-dmbtr,
            w_Group LIKE bseg-dmbtr,
            w_IntAmt LIKE bseg-dmbtr,
            w_Int LIKE bseg-dmbtr,
            w_InterAmt LIKE bseg-dmbtr,
            w_Inter LIKE bseg-dmbtr,
            w_AdPayAmt LIKE bseg-dmbtr,
            w_AdPay LIKE bseg-dmbtr,
            w_GTotal LIKE bseg-dmbtr,
            W_COMPANYNAME like zcompany-copmname.
    DATA : w_ORcptamt LIKE bseg-dmbtr,
            w_ONetamt LIKE bseg-dmbtr,
            w_OIntIncomeAmt LIKE bseg-dmbtr,
            w_OIntIncome LIKE bseg-dmbtr,
            w_OFixedAmt LIKE bseg-dmbtr,
            w_Ofixedasst LIKE bseg-dmbtr,
            w_OSundry LIKE bseg-dmbtr,
            w_OSundryAmt LIKE bseg-dmbtr,
            w_OSuppayAmt LIKE bseg-dmbtr,
            w_OSuppay LIKE bseg-dmbtr,
            w_OSuppayAmt1 LIKE bseg-dmbtr,
            w_OSuppay1 LIKE bseg-dmbtr,
            w_ODutyAmt LIKE bseg-dmbtr,
            w_ODuty LIKE bseg-dmbtr,
            w_OSalaryAmt LIKE bseg-dmbtr,
            w_OSalary LIKE bseg-dmbtr,
            w_OTaxAmt LIKE bseg-dmbtr,
            w_OTax LIKE bseg-dmbtr,
            w_OTaxAmt1 LIKE bseg-dmbtr,
            w_OTax1 LIKE bseg-dmbtr,
            w_OSellAmt LIKE bseg-dmbtr,
            w_OSell LIKE bseg-dmbtr,
            w_OAdminAmt LIKE bseg-dmbtr,
            w_OAdmin LIKE bseg-dmbtr,
            w_OloanAmt LIKE bseg-dmbtr,
            w_Oloan LIKE bseg-dmbtr,
            w_OManAmt LIKE bseg-dmbtr,
            w_OMan LIKE bseg-dmbtr,
            w_OCapitalAmt LIKE bseg-dmbtr,
            w_OCapital LIKE bseg-dmbtr,
            w_OGroupAmt LIKE bseg-dmbtr,
            w_OGroup LIKE bseg-dmbtr,
            w_OIntAmt LIKE bseg-dmbtr,
            w_OInt LIKE bseg-dmbtr,
            w_OInterAmt LIKE bseg-dmbtr,
            w_OInter LIKE bseg-dmbtr,
            w_OAdPayAmt LIKE bseg-dmbtr,
            w_OAdPay LIKE bseg-dmbtr.
    DATA : w_NNetamt LIKE bseg-dmbtr,
            w_NIntIncome LIKE bseg-dmbtr,
            w_Nfixedasst LIKE bseg-dmbtr,
            w_NSundry LIKE bseg-dmbtr,
            w_NSuppay LIKE bseg-dmbtr,
            w_NSuppay1 LIKE bseg-dmbtr,
            w_NDuty LIKE bseg-dmbtr,
            w_NSalary LIKE bseg-dmbtr,
            w_NTax LIKE bseg-dmbtr,
            w_NTax1 LIKE bseg-dmbtr,
            w_NSell LIKE bseg-dmbtr,
            w_NAdmin LIKE bseg-dmbtr,
            w_Nloan LIKE bseg-dmbtr,
            w_NMan LIKE bseg-dmbtr,
            w_NCapital LIKE bseg-dmbtr,
            w_NGroup LIKE bseg-dmbtr,
            w_NInt LIKE bseg-dmbtr,
            w_NInter LIKE bseg-dmbtr,
            w_NAdPay LIKE bseg-dmbtr.
    RANGES : r_bwart FOR  bsad-blart.
    TABLES: bsad.
    *       Internal tables          Begin with IT_                       *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:      p_bukrs LIKE bsad-bukrs OBLIGATORY.
    SELECT-OPTIONS:  s_bldat FOR  bsad-bldat OBLIGATORY.
    * SELECT-OPTIONS:   s_hkont FOR bsad-hkont .
    PARAMETERS:      p_gjahr LIKE bkpf-gjahr OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1 .
    * PARAMETERS : w_local   TYPE char1 RADIOBUTTON GROUP g1 DEFAULT 'X'. .
    * PARAMETERS : w_curr  TYPE char1 RADIOBUTTON GROUP g1 .
    w_ITCPO-TDNEWID = 'X'.
    *w_itcpo-tdgetotf   = 'X'.
    *opern form
       CALL FUNCTION 'OPEN_FORM'
        EXPORTING
    *        APPLICATION                       = 'TX'
    *        ARCHIVE_INDEX                     =
    *        ARCHIVE_PARAMS                    =
    *         DEVICE                            = 'PRINTER'
    *        DIALOG                            = ' '
          form                                 = 'ZCASHFLOW_FORM1'
    *        LANGUAGE                          = SY-LANGU
             OPTIONS                           = w_ITCPO
    *        MAIL_SENDER                       =
    *        MAIL_RECIPIENT                    =
    *        MAIL_APPL_OBJECT                  =
    *        RAW_DATA_INTERFACE                = '*'
    *        SPONUMIV                          =
    *      IMPORTING
    *        LANGUAGE                          =
    *        NEW_ARCHIVE_PARAMS                =
    *        RESULT                            =
    *      EXCEPTIONS
    *        CANCELED                          = 1
    *        DEVICE                            = 2
    *        FORM                              = 3
    *        OPTIONS                           = 4
    *        UNCLOSED                          = 5
    *        MAIL_OPTIONS                      = 6
    *        ARCHIVE_ERROR                     = 7
    *        INVALID_FAX_NUMBER                = 8
    *        MORE_PARAMS_NEEDED_IN_BATCH       = 9
    *        SPOOL_ERROR                       = 10
    *        CODEPAGE                          = 11
    *        OTHERS                            = 12
       IF sy-subrc <> 0.
    *   message id sy-msgid type sy-msgty number sy-msgno
    *           with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    PERFORM select_data_closed.
    PERFORM select_data_open.
    * calculate the net figures
    w_NNetamt = w_Netamt + w_ONetamt.
    w_NIntIncome = w_IntIncome + w_OIntIncome.
    *w_NInCompRct = w_InCompRct + w_OInCompRct.
    w_NfixedAsst = w_fixedAsst + w_OfixedAsst.
    w_NSundry = w_Sundry + w_OSundry.
    w_NSuppay = w_Suppay + w_OSuppay.
    w_NSuppay1 = w_Suppay1 + w_OSuppay1.
    w_NDuty = w_Duty + w_ODuty.
    w_NSalary = w_Salary + w_OSalary.
    w_NTax = w_Tax + w_OTax.
    w_NTax1 = w_Tax1 + w_OTax1.
    w_NSell = w_Sell + w_OSell.
    w_NAdmin = w_Admin + w_OAdmin.
    w_NCapital = w_Capital + w_OCapital.
    w_Nloan = w_loan + w_Oloan.
    w_NMan = w_Man + w_OMan.
    w_NGroup = w_Group + w_OGroup.
    w_NInt = w_Int + w_OInt.
    w_NInter = w_Inter + w_OInter.
    w_NAdPay = w_AdPay + w_OAdPay.
    w_GTotal = ( w_NNetamt + w_NIntIncome + w_NfixedAsst + w_NSundry ) - (
    w_NSuppay + w_NSuppay1 + w_NDuty + w_NSalary + w_NTax + w_NTax1 +
    w_NSell + w_NAdmin + w_NCapital + w_Nloan + w_NMan + w_NGroup + w_NInt +
    w_NInter + w_NAdPay ).
    * Write the Main Account Balance
         CALL FUNCTION 'WRITE_FORM'
           EXPORTING
             element  = 'MAIN'
             function = 'SET'
             type     = 'BODY'
             window   = 'MAIN'.
         IF sy-subrc <> 0.
    **   message id sy-msgid type sy-msgty number sy-msgno
    **           with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
         ENDIF.
    w_ITCPP-TDNEWID = 'X'.
       CALL FUNCTION 'CLOSE_FORM'
          IMPORTING
             RESULT                         = w_ITCPP
    *        RDI_RESULT                     =
    *      TABLES
    *        OTFDATA                        =
    *      EXCEPTIONS
    *        UNOPENED                       = 1
    *        BAD_PAGEFORMAT_FOR_PRINT       = 2
    *        SEND_ERROR                     = 3
    *        SPOOL_ERROR                    = 4
    *        CODEPAGE                       = 5
    *        OTHERS                         = 6
       IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
    FORM select_data_closed.
       SELECT SINGLE copmname INTO w_companyname
          FROM zcompany
           WHERE  copcode = p_bukrs.
    * Select the receipts
       SELECT SUM( dmbtr ) AS dmbtr belnr kunnr hkont shkzg xblnr budat
    blart bldat
       INTO CORRESPONDING FIELDS OF TABLE it_voucher3
       FROM  bsad
       WHERE   bukrs = p_bukrs AND gjahr = p_gjahr
               AND augdt IN s_bldat
               AND blart = 'DZ'
    *            AND blart = 'DZ' and shkzg = 'S'
               GROUP BY kunnr belnr hkont shkzg xblnr budat blart bldat.
       SORT it_voucher3 BY kunnr.
       LOOP AT it_voucher3 INTO wa_voucher3.
    * Select the invoices
         SELECT SUM( dmbtr ) AS dmbtr belnr kunnr hkont shkzg xblnr budat
    blart bldat
         INTO CORRESPONDING FIELDS OF TABLE it_voucher1
         FROM  bsad
         WHERE   bukrs = p_bukrs AND gjahr = p_gjahr
                 AND augdt IN s_bldat
                 AND blart <> 'DZ' AND
                 augbl = wa_voucher3-belnr AND
                 kunnr = wa_voucher3-kunnr
                 GROUP BY belnr kunnr hkont shkzg xblnr budat blart bldat.
         LOOP AT it_voucher1 INTO wa_voucher1.
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_Rcptamt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX001' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_Rcptamt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX001' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_Netamt = w_Netamt + w_Rcptamt.
                  continue.
                ENDIF.
           ELSE.
                 w_Netamt = w_Netamt + w_Rcptamt.
                 continue.
           ENDIF.
    * Interest Income
          SELECT SINGLE dmbtr FROM bsis INTO w_IntIncomeAmt WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX002' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_IntIncomeAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX002' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_IntIncome = w_IntIncome + w_IntIncomeAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_IntIncome = w_IntIncome + w_IntIncomeAmt.
                 continue.
           ENDIF.
    * Sale Of fixed Assets
          SELECT SINGLE dmbtr FROM bsis INTO w_FixedAmt WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX004' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_FixedAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX004' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_fixedasst = w_fixedasst + w_FixedAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_fixedasst = w_fixedasst + w_FixedAmt.
                 continue.
           ENDIF.
    * Gl Receipts ( Sundry Income)
          SELECT SINGLE dmbtr FROM bsis INTO w_SundryAmt WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX005' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_SundryAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX005' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_Sundry = w_Sundry + w_SundryAmt.
                                continue.
                ENDIF.
           ELSE.
                 w_Sundry = w_Sundry + w_SundryAmt.
                              continue.
           ENDIF.
         ENDLOOP.
       ENDLOOP.
    *Out Flow
    r_bwart-sign = 'I'. r_bwart-option = 'EQ'. r_bwart-low = 'KZ'.
    APPEND r_bwart TO r_bwart.
    r_bwart-sign = 'I'. r_bwart-option = 'EQ'. r_bwart-low = 'VZ'.
    APPEND r_bwart TO r_bwart.
       SELECT SUM( dmbtr ) AS dmbtr belnr lifnr hkont shkzg xblnr budat
    blart bldat
       INTO CORRESPONDING FIELDS OF TABLE it_voucher3
       FROM  bsak
       WHERE   bukrs = p_bukrs AND gjahr = p_gjahr
               AND augdt IN s_bldat
               AND blart IN  r_bwart
    *            AND blart = 'DZ' and shkzg = 'S'
               GROUP BY lifnr belnr hkont shkzg xblnr budat blart bldat.
       SORT it_voucher3 BY lifnr.
       LOOP AT it_voucher3 INTO wa_voucher3.
    * Select the invoices
         SELECT SUM( dmbtr ) AS dmbtr belnr lifnr hkont shkzg xblnr budat
    blart bldat
         INTO CORRESPONDING FIELDS OF TABLE it_voucher1
         FROM  bsak
         WHERE   bukrs = p_bukrs AND gjahr = p_gjahr
                 AND augdt IN s_bldat
                 AND blart NOT IN r_bwart AND
                 augbl = wa_voucher3-belnr AND
                 lifnr = wa_voucher3-lifnr
                 GROUP BY belnr lifnr hkont shkzg xblnr budat blart bldat.
         LOOP AT it_voucher1 INTO wa_voucher1.
    * Supplier Payments  (LOCAL)
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_SupPayAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY001' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_SupPayAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY001' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_SupPay = w_SupPay + w_SupPayAmt.
                                continue.
                ENDIF.
           ELSE.
                 w_SupPay = w_SupPay + w_SupPayAmt.
                              continue.
           ENDIF.
    * supplier Payments  (Foreign )
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_SupPayAmt1 WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY002' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_SupPayAmt1  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY002' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_SupPay1 = w_SupPay1 + w_SupPayAmt1.
                  continue.
                ENDIF.
           ELSE.
                 w_SupPay1 = w_SupPay1 + w_SupPayAmt1.
                  continue.
           ENDIF.
    * duty/clearing expenses
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_DutyAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY003' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_DutyAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY003' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_Duty = w_Duty + w_DutyAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_Duty = w_Duty + w_DutyAmt.
                  continue.
           ENDIF.
    * Salary /EPF/ETF/MSPS/OVERTIME
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_SalaryAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY004' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_SalaryAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY004' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_Salary = w_Salary + w_SalaryAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_Salary = w_Salary + w_SalaryAmt.
                  continue.
           ENDIF.
    * Income Taxes
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_TaxAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY005' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_TaxAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY005' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_Tax = w_Tax + w_TaxAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_Tax = w_Tax + w_TaxAmt.
                  continue.
           ENDIF.
    * other taxes ( VAT: TT:Debit tax )
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_TaxAmt1 WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY006' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_TaxAmt1  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY006' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_Tax1 = w_Tax1 + w_TaxAmt1.
                  continue.
                ENDIF.
           ELSE.
                 w_Tax1 = w_Tax1 + w_TaxAmt1.
                  continue.
           ENDIF.
    * Selling  & Promotional Costs
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_SellAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY007' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_SellAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY007' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_Sell = w_Sell + w_SellAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_Sell = w_Sell + w_SellAmt.
                  continue.
           ENDIF.
    * Admistration costs
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_AdminAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY008' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_AdminAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY008' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_Admin = w_Admin + w_AdminAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_Admin = w_Admin + w_AdminAmt.
                  continue.
           ENDIF.
    * Capital Expenditure
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_CapitalAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY009' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_CapitalAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY009' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_Capital = w_Capital + w_CapitalAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_Capital = w_Capital + w_CapitalAmt.
                  continue.
           ENDIF.
    * Loan repayments
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_LoanAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY010' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_LoanAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY010' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_Loan = w_Loan + w_LoanAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_Loan = w_Loan + w_LoanAmt.
                  continue.
           ENDIF.
    * maangment fees
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_ManAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY011' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_ManAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY011' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_Man = w_Man + w_ManAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_Man = w_Man + w_ManAmt.
                  continue.
           ENDIF.
    * Group charges
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_GroupAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY012' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_GroupAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY012' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_Group = w_Group + w_GroupAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_Group = w_Group + w_GroupAmt.
                  continue.
           ENDIF.
    * Interest Payments
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_IntAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY013' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_IntAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY013' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_Int = w_Int + w_IntAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_Int = w_Int + w_IntAmt.
                  continue.
           ENDIF.
    * Other Intercompany payments
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_InterAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY014' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_InterAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY014' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_Inter = w_Inter + w_InterAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_Inter = w_Inter + w_InterAmt.
                  continue.
           ENDIF.
    * Advacnes/Prepayments
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_AdPayAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY015' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_AdPayAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY015' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_AdPay = w_AdPay + w_AdPayAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_AdPay = w_AdPay + w_AdPayAmt.
                  continue.
           ENDIF.
         ENDLOOP.
       ENDLOOP.
    * Open Item Balances
    ENDFORM.                    " Select_Data
    FORM select_data_Open.
    *   SELECT SINGLE copmname INTO w_companyname
    *      FROM zcompany
    *       WHERE  copcode = p_bukrs.
    * Select the receipts
       SELECT SUM( dmbtr ) AS dmbtr belnr kunnr hkont shkzg xblnr budat
    blart bldat
       INTO CORRESPONDING FIELDS OF TABLE it_voucher3
       FROM  bsid
       WHERE   bukrs = p_bukrs AND gjahr = p_gjahr
               AND augdt IN s_bldat
               AND blart = 'DZ'
    *            AND blart = 'DZ' and shkzg = 'S'
               GROUP BY kunnr belnr hkont shkzg xblnr budat blart bldat.
       SORT it_voucher3 BY kunnr.
       LOOP AT it_voucher3 INTO wa_voucher3.
    * Select the invoices
         SELECT SUM( dmbtr ) AS dmbtr belnr kunnr hkont shkzg xblnr budat
    blart bldat
         INTO CORRESPONDING FIELDS OF TABLE it_voucher1
         FROM  bsid
         WHERE   bukrs = p_bukrs AND gjahr = p_gjahr
                 AND augdt IN s_bldat
                 AND blart <> 'DZ' AND
                 augbl = wa_voucher3-belnr AND
                 kunnr = wa_voucher3-kunnr
                 GROUP BY belnr kunnr hkont shkzg xblnr budat blart bldat.
         LOOP AT it_voucher1 INTO wa_voucher1.
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_ORcptamt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX001' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_ORcptamt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX001' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_ONetamt = w_ONetamt + w_ORcptamt.
                  continue.
                ENDIF.
           ELSE.
                 w_ONetamt = w_ONetamt + w_ORcptamt.
                  continue.
           ENDIF.
    * Interest Income
          SELECT SINGLE dmbtr FROM bsis INTO w_OIntIncomeAmt WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX002' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OIntIncomeAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX002' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OIntIncome = w_OIntIncome + w_OIntIncomeAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_OIntIncome = w_OIntIncome + w_OIntIncomeAmt.
                  continue.
           ENDIF.
    * Sale Of fixed Assets
          SELECT SINGLE dmbtr FROM bsis INTO w_OFixedAmt WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX004' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OFixedAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX004' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_Ofixedasst = w_Ofixedasst + w_OFixedAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_Ofixedasst = w_Ofixedasst + w_OFixedAmt.
                  continue.
           ENDIF.
    * Gl Receipts ( Sundry Income)
          SELECT SINGLE dmbtr FROM bsis INTO w_OSundryAmt WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX005' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OSundryAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'XX005' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OSundry = w_OSundry + w_OSundryAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_OSundry = w_OSundry + w_OSundryAmt.
                  continue.
           ENDIF.
         ENDLOOP.
       ENDLOOP.
    *Out Flow
    Clear r_bwart.
    refresh r_bwart.
    r_bwart-sign = 'I'. r_bwart-option = 'EQ'. r_bwart-low = 'KZ'.
    APPEND r_bwart TO r_bwart.
    r_bwart-sign = 'I'. r_bwart-option = 'EQ'. r_bwart-low = 'VZ'.
    APPEND r_bwart TO r_bwart.
       SELECT SUM( dmbtr ) AS dmbtr belnr lifnr hkont shkzg xblnr budat
    blart bldat
       INTO CORRESPONDING FIELDS OF TABLE it_voucher3
       FROM  bsik
       WHERE   bukrs = p_bukrs AND gjahr = p_gjahr
               AND augdt IN s_bldat
               AND blart IN  r_bwart
    *            AND blart = 'DZ' and shkzg = 'S'
               GROUP BY lifnr belnr hkont shkzg xblnr budat blart bldat.
       SORT it_voucher3 BY lifnr.
       LOOP AT it_voucher3 INTO wa_voucher3.
    * Select the invoices
         SELECT SUM( dmbtr ) AS dmbtr belnr lifnr hkont shkzg xblnr budat
    blart bldat
         INTO CORRESPONDING FIELDS OF TABLE it_voucher1
         FROM  bsik
         WHERE   bukrs = p_bukrs AND gjahr = p_gjahr
                 AND augdt IN s_bldat
                 AND blart NOT IN r_bwart AND
                 augbl = wa_voucher3-belnr AND
                 lifnr = wa_voucher3-lifnr
                 GROUP BY belnr lifnr hkont shkzg xblnr budat blart bldat.
         LOOP AT it_voucher1 INTO wa_voucher1.
    * Supplier Payments  (LOCAL)
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_OSupPayAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY001' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OSupPayAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY001' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OSupPay = w_OSupPay + w_OSupPayAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_OSupPay = w_OSupPay + w_OSupPayAmt.
                  continue.
           ENDIF.
    * supplier Payments  (Foreign )
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_OSupPayAmt1 WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY002' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OSupPayAmt1  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY002' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OSupPay1 = w_OSupPay1 + w_OSupPayAmt1.
                  continue.
                ENDIF.
           ELSE.
                 w_OSupPay1 = w_OSupPay1 + w_OSupPayAmt1.
                  continue.
           ENDIF.
    * duty/clearing expenses
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_ODutyAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY003' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_ODutyAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY003' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_ODuty = w_ODuty + w_ODutyAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_ODuty = w_ODuty + w_ODutyAmt.
                  continue.
           ENDIF.
    * Salary /EPF/ETF/MSPS/OVERTIME
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_OSalaryAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY004' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OSalaryAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY004' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OSalary = w_OSalary + w_OSalaryAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_OSalary = w_OSalary + w_OSalaryAmt.
                  continue.
           ENDIF.
    * Income Taxes
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_OTaxAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY005' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OTaxAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY005' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OTax = w_OTax + w_OTaxAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_OTax = w_OTax + w_OTaxAmt.
                  continue.
           ENDIF.
    * other taxes ( VAT: TT:Debit tax )
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_OTaxAmt1 WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY006' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OTaxAmt1  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY006' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OTax1 = w_OTax1 + w_OTaxAmt1.
                  continue.
                ENDIF.
           ELSE.
                 w_OTax1 = w_OTax1 + w_OTaxAmt1.
                  continue.
           ENDIF.
    * Selling  & Promotional Costs
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_OSellAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY007' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OSellAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY007' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OSell = w_OSell + w_OSellAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_OSell = w_OSell + w_OSellAmt.
                  continue.
           ENDIF.
    * Admistration costs
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_OAdminAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY008' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OAdminAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY008' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OAdmin = w_OAdmin + w_OAdminAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_OAdmin = w_OAdmin + w_OAdminAmt.
                  continue.
           ENDIF.
    * Capital Expenditure
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_OCapitalAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY009' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OCapitalAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY009' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OCapital = w_OCapital + w_OCapitalAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_OCapital = w_OCapital + w_OCapitalAmt.
                  continue.
           ENDIF.
    * Loan repayments
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_OLoanAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY010' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OLoanAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY010' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OLoan = w_OLoan + w_OLoanAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_OLoan = w_OLoan + w_OLoanAmt.
                  continue.
           ENDIF.
    * maangment fees
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_OManAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY011' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OManAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY011' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OMan = w_OMan + w_OManAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_OMan = w_OMan + w_OManAmt.
                  continue.
           ENDIF.
    * Group charges
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_OGroupAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY012' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OGroupAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY012' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OGroup = w_OGroup + w_OGroupAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_OGroup = w_OGroup + w_OGroupAmt.
                  continue.
           ENDIF.
    * Interest Payments
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_OIntAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY013' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OIntAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY013' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OInt = w_OInt + w_OIntAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_OInt = w_OInt + w_OIntAmt.
                  continue.
           ENDIF.
    * Other Intercompany payments
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_OInterAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY014' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OInterAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY014' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OInter = w_OInter + w_OInterAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_OInter = w_OInter + w_OInterAmt.
                  continue.
           ENDIF.
    * Advacnes/Prepayments
    *  Find the corresponding entry in the GL open
          SELECT SINGLE dmbtr FROM bsis INTO w_OAdPayAmt WHERE
    *           hkont = '0010003900' AND
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY015' ) AND  bukrs = p_bukrs  AND
                   gjahr = p_gjahr  AND
                   belnr = wa_voucher1-belnr.
           IF sy-subrc <> 0.
    * If the corresponding entry not found in GL open, look in the GL Closed
          SELECT SINGLE dmbtr FROM bsas INTO  w_OAdPayAmt  WHERE
               hkont IN ( select fglacc from zcashflow_matrix WHERE FCODE =
    'YY015' ) AND bukrs = p_bukrs  AND
                  gjahr = p_gjahr  AND
                  belnr = wa_voucher1-belnr.
                IF sy-subrc = 0.
                  w_OAdPay = w_OAdPay + w_OAdPayAmt.
                  continue.
                ENDIF.
           ELSE.
                 w_OAdPay = w_OAdPay + w_OAdPayAmt.
                  continue.
           ENDIF.
         ENDLOOP.
       ENDLOOP.
    ENDFORM.                    " Select_Data

  • Sale Order Performance Issue.

    Hi,
    We are using EBS 12.0.6 and Database is 10g (10.2.3).
    We are facing performance issue with "Order management Sale Order Form",
    When user click on "Line Items" Tab of "Sale Order Form" and
    In "Main" Tab entring the "Ordered Item" then press tab and entring the "Qty" of item, its takes time 20 to 30 Second for one item if its related Items exists.
    We have 150 entiries against one sale order. Users are facing 20-30 second delay on each entry.
    Please advise how to improve the performance when related Itms exists?
    Thanks,
    Edited by: user12007410 on Feb 4, 2010 12:00 AM

    Pl create a trace file as outlined in MOS Doc 564817.1 (How To Create Forms And Database Level Trace For Receiving Transactions) to help pinpoint what SQL is causing the issue. Then open an SR as this may be a known issue for which a patch exists.
    Pl also verify that database statistics are current - see MOS Doc 169935.1 (Troubleshooting Oracle Applications Performance Issues) - section on "Statistics Gathering"
    HTH
    Srini

  • EBS 12.0.6 Sale Order Performance Issue.

    We are using EBS 12.0.6 and Database is 10g (10.2.3).
    We are facing performance issue with "Order management Sale Order Form",
    When user click on "Line Items" Tab of "Sale Order Form" and
    In "Main" Tab entring the "Ordered Item" then press tab and entring the "Qty" of item, its takes time 20 to 30 Second for one item if its related Items exists.
    We have 150 entiries against one sale order. Users are facing 20-30 second delay on each entry.
    Please advise how to improve the performance when related Itms exists?

    Hi,
    Please see if these documents are applicable.
    Note: 845765.1 - R12: Performance Navigating To Line Item Tab: OE_AK_SOLD_TO_ORGS_V [ID 845765.1]      
    Note: 399998.1 - OEXOEORD: Performance Entering Item On A Sales Order Line
    Regards,
    Hussein

  • Process flow/map performance issues

    We have some issues with our OWB-based application and we're looking to find out if there are different ways we could be using the tool, or features/options we've missed.
    We are trying to maintain a near real time feed of data from a front end system into our warehouse which was built using OWB 10.2.0.3 over a 10.2.0.4 database. The bulk of the application consists of OWB maps with a few hand-written PL/SQL objects, all executed in a series of hierachical OWB process flows. Maps/transformations are executed either sequentially or in parallel where the referential integrity of the model allows.
    The problem is that we have around 150 tables in the datamart which could potentially require updating on each refresh cycle, although in practice only a few tables have any activity on a typical refresh cycle. The cycle consists of loading data into a set of staging tables, and from there the data is transformed into the main schema, often with multiple maps per target table.
    On every cycle we run hundreds of maps, the vast majority of which process zero rows. Each map runs quickly and efficiently in its own right but collectively they add up to a 5 - 10 min cycle even if there is no data to process.
    There are 2 avenues which we'd like to explore and would be grateful if anyone could provide any pointers/suggestions :-
    1) It appears that each map opens and closes its own database session when it executes. I presume this was done because a single process flow could be constructed with maps executing in different target schemas, but we know that's not the case for us. We'd like to know if there is anyway to configure the database connection at a higher level (eg. process flow) so it opens a connection once and executes each of the maps (database packages) in that one session.
    Our DBAs are experimenting with 'shared server' settings at a database level which may help to some degree but won't be the whole story.
    2) Another option is simply to run less maps eg. load the staging area as now, collate stats on which staging tables contain new data, and then apply some logic such that subsequent maps only execute if the relevant staging table(s) contain(s) some new data, otherwise bypass that map.
    We tried experimenting with the 'Pre Mapping Process' operator, but essentially that just generates another function call from the map package, so we still have the overhead of opening a database session for each map to run the package. Minimal gain.
    We thought about adding a function call in the process flow before each map and then branching to either execute/bypass the map as approriate, but the function call still requires opening/closing of a database session each time so, once again, minimal gain.
    What we really want is some way for a map or process flow to check without logging onto the database repeatedly.
    Any ideas on the above, or other potential solutions anyone could suggest, would be greatly appreciated.

    Hi,
    Please see if these documents help.
    Note: 554635.1 - Create Accounting Process Performs Poorly When 100K + Distributions are Passed for an Event
    Note: 954273.1 - Multiple Create Accounting Requests Result In Poor Performance For Online Accruals
    Note: 763500.1 - R12: Performance Issue with Create Accounting
    Note: 733637.1 - R12:Performance Issue When Running Accounting Program Xlaaccup
    Note: 781311.1 - Create Accounting Process Taking A Long Time To Complete After Appying Critical Patches
    Note: 557869.1 - EBS: R12 Oracle Financials Critical Patches
    Regards,
    Hussein

  • Concurrent program performance Issue

    Hi,
    We are currently experiencing performance issue in one of the concurrent program related
    to the HR module. The concurrent request is currently completing in 3 hrs time.
    We have obtained a trace for the concurrent program.
    Please help me analyze the cause of the performance issue from the trace file.
    Trace file below:
    BEGIN SLC_PYINF_USMONACCROH_PKG.SLC_421_HANDLE_OUTBOUND(:errbuf,:rc,:A0,:A1,
    :A2,:A3,:A4,:A5,:A6,:A7,:A8,:A9,:A10,:A11); END;
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 76.08 9602.16 700828 1330818 663813 1
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 76.08 9602.16 700828 1330818 663813 1
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 70
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    SQL*Net message to client 3 0.00 0.00
    SQL*Net message from client 3 0.00 0.00
    PL/SQL lock timer 969 9.83 9485.16
    UPDATE HRAPPS.SLC_PYINF_USMONACCRO_STG SET PROCESS_STATUS = 2
    WHERE
    CONC_REQUEST_ID = :B2 AND SET_SEQUENCE_NUM = :B1 AND PROCESS_STATUS = 1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 24.83 45.67 145127 695479 602714 560730
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 24.83 45.67 145127 695479 602714 560730
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 70 (recursive depth: 1)
    Rows Row Source Operation
    0 UPDATE SLC_PYINF_USMONACCRO_STG (cr=684898 pr=134556 pw=0 time=44759708 us)
    1135266 TABLE ACCESS FULL SLC_PYINF_USMONACCRO_STG (cr=694708 pr=124937 pw=0 time=6874212 us)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file scattered read 15622 1.43 13.94
    db file sequential read 25578 0.52 14.30
    latch: cache buffers lru chain 3 0.00 0.00
    DELETE FROM SLC_PYINF_USMONACCRO_ARC
    WHERE
    EXTRACT_DATE<TRUNC(SYSDATE)-60
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 7.41 15.05 87598 87668 0 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 7.41 15.06 87598 87668 0 0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 70 (recursive depth: 1)
    Rows Row Source Operation
    0 DELETE SLC_PYINF_USMONACCRO_ARC (cr=87668 pr=87598 pw=0 time=15053606 us)
    0 TABLE ACCESS FULL SLC_PYINF_USMONACCRO_ARC (cr=87668 pr=87598 pw=0 time=15053595 us)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 3 0.00 0.00
    db file scattered read 11025 0.61 13.21
    SELECT COUNT(*)
    FROM
    HRAPPS.SLC_PYINF_USMONACCRO_STG WHERE CONC_REQUEST_ID = :B1
    call count cpu elapsed disk query current rows
    Parse 2 0.00 0.00 0 0 0 0
    Execute 2 0.00 0.00 0 0 0 0
    Fetch 2 10.14 10.23 116633 123540 0 2
    total 6 10.14 10.23 116633 123540 0 2
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 70 (recursive depth: 1)
    Rows Row Source Operation
    1 SORT AGGREGATE (cr=61770 pr=58317 pw=0 time=5290475 us)
    560730 TABLE ACCESS FULL SLC_PYINF_USMONACCRO_STG (cr=61770 pr=58317 pw=0 time=1689204 us)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file scattered read 15646 0.27 6.24
    db file sequential read 625 0.00 0.01
    SELECT COUNT(*)
    FROM
    HRAPPS.SLC_PYINF_USMONACCRO_STG WHERE CONC_REQUEST_ID = :B1 AND
    PROCESS_STATUS = 2
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 5.20 8.32 51482 69842 0 1
    total 3 5.20 8.32 51482 69842 0 1
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 70 (recursive depth: 1)
    Rows Row Source Operation
    1 SORT AGGREGATE (cr=69842 pr=51482 pw=0 time=8323369 us)
    560730 TABLE ACCESS FULL SLC_PYINF_USMONACCRO_STG (cr=69842 pr=51482 pw=0 time=2811304 us)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file scattered read 6514 0.30 6.09
    db file sequential read 114 0.00 0.02
    SELECT MAX(SET_SEQUENCE_NUM)
    FROM
    HRAPPS.SLC_PYINF_USMONACCRO_STG WHERE CONC_REQUEST_ID = :B1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 5.34 6.63 58318 61770 0 1
    total 3 5.34 6.63 58318 61770 0 1
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 70 (recursive depth: 1)
    Rows Row Source Operation
    1 SORT AGGREGATE (cr=61770 pr=58318 pw=0 time=6639527 us)
    560730 TABLE ACCESS FULL SLC_PYINF_USMONACCRO_STG (cr=61770 pr=58318 pw=0 time=2250410 us)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file scattered read 7820 0.30 4.46
    db file sequential read 313 0.00 0.05
    SELECT COUNT(*)
    FROM
    HRAPPS.SLC_PYINF_USMONACCRO_STG WHERE CONC_REQUEST_ID = :B2 AND
    SET_SEQUENCE_NUM = :B1 AND PROCESS_STATUS = 1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 4.99 4.88 58315 61770 0 1
    total 3 4.99 4.88 58315 61770 0 1
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 70 (recursive depth: 1)
    Rows Row Source Operation
    1 SORT AGGREGATE (cr=61770 pr=58315 pw=0 time=4887337 us)
    560730 TABLE ACCESS FULL SLC_PYINF_USMONACCRO_STG (cr=61770 pr=58315 pw=0 time=1688451 us)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file scattered read 7824 0.00 3.02
    db file sequential read 313 0.00 0.00
    SELECT COUNT(*)
    FROM
    HRAPPS.SLC_PYINF_USMONACCRO_STG WHERE CONC_REQUEST_ID = :B1 AND
    PROCESS_STATUS = 1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 4.98 4.87 58318 61770 0 1
    total 3 4.98 4.87 58318 61770 0 1
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 70 (recursive depth: 1)
    Rows Row Source Operation
    1 SORT AGGREGATE (cr=61770 pr=58318 pw=0 time=4872548 us)
    560730 TABLE ACCESS FULL SLC_PYINF_USMONACCRO_STG (cr=61770 pr=58318 pw=0 time=1688407 us)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file scattered read 7821 0.00 2.98
    db file sequential read 312 0.00 0.00
    SELECT COUNT(*)
    FROM
    HRAPPS.SLC_PYINF_USMONACCRO_STG WHERE CONC_REQUEST_ID = :B1 AND
    PROCESS_STATUS = -1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 4.45 4.36 58317 61770 0 1
    total 3 4.45 4.36 58317 61770 0 1
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 70 (recursive depth: 1)
    Rows Row Source Operation
    1 SORT AGGREGATE (cr=61770 pr=58317 pw=0 time=4369473 us)
    0 TABLE ACCESS FULL SLC_PYINF_USMONACCRO_STG (cr=61770 pr=58317 pw=0 time=4369425 us)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file scattered read 7823 0.00 2.98
    db file sequential read 312 0.00 0.00
    SELECT COUNT(*)
    FROM
    HRAPPS.SLC_PYINF_USMONACCRO_STG WHERE CONC_REQUEST_ID = :B1 AND
    PROCESS_STATUS < 0
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 4.14 4.24 51481 61770 0 1
    total 3 4.14 4.24 51481 61770 0 1
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 70 (recursive depth: 1)
    Rows Row Source Operation
    1 SORT AGGREGATE (cr=61770 pr=51481 pw=0 time=4243020 us)
    0 TABLE ACCESS FULL SLC_PYINF_USMONACCRO_STG (cr=61770 pr=51481 pw=0 time=4242968 us)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file scattered read 6537 0.06 2.90
    db file sequential read 104 0.00 0.00
    DELETE FROM SLC_PYINF_USMONACCRO_GLI_ARC
    WHERE
    EXTRACT_DATE<TRUNC(SYSDATE)-60
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.63 2.52 7681 7689 0 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 0.63 2.52 7681 7689 0 0
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 70 (recursive depth: 1)
    Rows Row Source Operation
    0 DELETE SLC_PYINF_USMONACCRO_GLI_ARC (cr=7689 pr=7681 pw=0 time=2521592 us)
    0 TABLE ACCESS FULL SLC_PYINF_USMONACCRO_GLI_ARC (cr=7689 pr=7681 pw=0 time=2521583 us)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 1 0.00 0.00
    db file scattered read 976 1.00 2.36
    UPDATE HRAPPS.SLC_PYINF_USMONACCRO_GLI_STG SET PROCESS_STATUS = 2
    WHERE
    CONC_REQUEST_ID = :B1 AND PROCESS_STATUS = 1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 1.89 2.25 5863 16125 60963 52309
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 1.89 2.25 5863 16125 60963 52309
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 70 (recursive depth: 1)
    Rows Row Source Operation
    0 UPDATE SLC_PYINF_USMONACCRO_GLI_STG (cr=11787 pr=1273 pw=0 time=1332023 us)
    122679 TABLE ACCESS FULL SLC_PYINF_USMONACCRO_GLI_STG (cr=16291 pr=5859 pw=0 time=48501241 us)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file scattered read 745 0.01 0.76
    db file parallel read 1 0.00 0.00
    db file sequential read 5 0.00 0.00
    SELECT B.ATTRIBUTE1 ,B.ATTRIBUTE2 ,B.ATTRIBUTE3 ,T.FLEX_VALUE_MEANING ,
    T.DESCRIPTION
    FROM
    FND_FLEX_VALUES_TL T ,FND_FLEX_VALUES B WHERE B.FLEX_VALUE_ID =
    T.FLEX_VALUE_ID AND T.LANGUAGE = USERENV ('LANG') AND TRIM(UPPER
    (B.FLEX_VALUE)) = TRIM(UPPER (:B1 )) AND B.ENABLED_FLAG = 'Y' AND UPPER
    (B.VALUE_CATEGORY) = UPPER ('SLCHR_INTERFACE_CLEANUP')
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 2 0.00 0.00 0 0 0 0
    Fetch 2 0.25 0.86 1640 3286 0 2
    total 5 0.25 0.86 1640 3286 0 2
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 70 (recursive depth: 1)
    Rows Row Source Operation
    2 NESTED LOOPS (cr=3286 pr=1640 pw=0 time=866461 us)
    2 TABLE ACCESS FULL FND_FLEX_VALUES (cr=3280 pr=1637 pw=0 time=848331 us)
    2 TABLE ACCESS BY INDEX ROWID FND_FLEX_VALUES_TL (cr=6 pr=3 pw=0 time=18101 us)
    2 INDEX UNIQUE SCAN FND_FLEX_VALUES_TL_U1 (cr=4 pr=2 pw=0 time=9705 us)(object id 849241)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 4 0.00 0.02
    db file scattered read 208 0.30 0.71
    SELECT PHASE_CODE, STATUS_CODE, COMPLETION_TEXT, PHASE.LOOKUP_CODE,
    STATUS.LOOKUP_CODE, PHASE.MEANING, STATUS.MEANING
    FROM
    FND_CONCURRENT_REQUESTS R, FND_CONCURRENT_PROGRAMS P, FND_LOOKUPS PHASE,
    FND_LOOKUPS STATUS WHERE PHASE.LOOKUP_TYPE = :B3 AND PHASE.LOOKUP_CODE =
    DECODE(STATUS.LOOKUP_CODE, 'H', 'I', 'S', 'I', 'U', 'I', 'M', 'I',
    R.PHASE_CODE) AND STATUS.LOOKUP_TYPE = :B2 AND STATUS.LOOKUP_CODE =
    DECODE(R.PHASE_CODE, 'P', DECODE(R.HOLD_FLAG, 'Y', 'H',
    DECODE(P.ENABLED_FLAG, 'N', 'U', DECODE(SIGN(R.REQUESTED_START_DATE -
    SYSDATE),1,'P', R.STATUS_CODE))), 'R', DECODE(R.HOLD_FLAG, 'Y', 'S',
    DECODE(R.STATUS_CODE, 'Q', 'B', 'I', 'B', R.STATUS_CODE)), R.STATUS_CODE)
    AND (R.CONCURRENT_PROGRAM_ID = P.CONCURRENT_PROGRAM_ID AND
    R.PROGRAM_APPLICATION_ID= P.APPLICATION_ID ) AND REQUEST_ID = :B1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 971 0.25 0.16 0 0 0 0
    Fetch 971 0.53 0.65 0 13605 0 971
    total 1943 0.78 0.81 0 13605 0 971
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 70 (recursive depth: 1)
    Rows Row Source Operation
    971 TABLE ACCESS BY INDEX ROWID FND_LOOKUP_VALUES (cr=17489 pr=0 pw=0 time=877481 us)
    2913 NESTED LOOPS (cr=16518 pr=0 pw=0 time=1643550 us)
    971 NESTED LOOPS (cr=11663 pr=0 pw=0 time=658551 us)
    971 NESTED LOOPS (cr=5837 pr=0 pw=0 time=95374 us)
    971 TABLE ACCESS BY INDEX ROWID FND_CONCURRENT_REQUESTS (cr=2924 pr=0 pw=0 time=63054 us)
    971 INDEX UNIQUE SCAN FND_CONCURRENT_REQUESTS_U1 (cr=1953 pr=0 pw=0 time=43874 us)(object id 240792)
    971 TABLE ACCESS BY INDEX ROWID FND_CONCURRENT_PROGRAMS (cr=2913 pr=0 pw=0 time=28198 us)
    971 INDEX UNIQUE SCAN FND_CONCURRENT_PROGRAMS_U1 (cr=1942 pr=0 pw=0 time=17956 us)(object id 849182)
    971 TABLE ACCESS BY INDEX ROWID FND_LOOKUP_VALUES (cr=5826 pr=0 pw=0 time=558105 us)
    971 INDEX RANGE SCAN FND_LOOKUP_VALUES_U1 (cr=4855 pr=0 pw=0 time=539171 us)(object id 906518)
    971 INDEX RANGE SCAN FND_LOOKUP_VALUES_U1 (cr=4855 pr=0 pw=0 time=172115 us)(object id 906518)
    SELECT MAX(LT.SECURITY_GROUP_ID)
    FROM
    FND_LOOKUP_TYPES LT WHERE LT.VIEW_APPLICATION_ID = :B2 AND LT.LOOKUP_TYPE =
    :B1 AND LT.SECURITY_GROUP_ID IN (0,
    TO_NUMBER(DECODE(SUBSTRB(USERENV('CLIENT_INFO'),55,1), ' ', '0', NULL, '0',
    SUBSTRB(USERENV('CLIENT_INFO'),55,10))))
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1945 0.11 0.11 0 0 0 0
    Fetch 1945 0.18 0.10 0 3890 0 1945
    total 3891 0.29 0.21 0 3890 0 1945
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 70 (recursive depth: 1)
    Rows Row Source Operation
    1945 SORT AGGREGATE (cr=3890 pr=0 pw=0 time=142954 us)
    1945 FIRST ROW (cr=3890 pr=0 pw=0 time=96520 us)
    1945 INDEX RANGE SCAN (MIN/MAX) FND_LOOKUP_TYPES_U1 (cr=3890 pr=0 pw=0 time=89938 us)(object id 906517)
    INSERT INTO HRAPPS.SLC_HRINF_INT_SUMMARY (INT_SUMMARY_ID,
    INT_SUMMARY_CREATE_DATE ,INT_SUMMARY_LAST_UPDATE_DATE, INTERFACE_NAME ,
    HANDLER_CONC_REQUEST_ID, INT_CONC_REQUEST_ID ,SET_SEQUENCE_NUMBER,
    SET_RECORD_COUNT, INT_FROM_DATE ,INT_TO_DATE, INT_STATUS_1_STATE,
    INT_STATUS_1_MESSAGE ,INT_STATUS_1_STARTED, INT_STATUS_1_COMPLETED ,
    INT_STATUS_1_SUCCESS_COUNT, INT_STATUS_1_ERROR_COUNT ,INT_STATUS_2_STATE,
    INT_STATUS_2_MESSAGE ,INT_STATUS_2_STARTED, INT_STATUS_2_COMPLETED ,
    INT_STATUS_2_SUCCESS_COUNT, INT_STATUS_2_ERROR_COUNT ,INT_STATUS_3_STATE,
    INT_STATUS_3_MESSAGE ,INT_STATUS_3_STARTED, INT_STATUS_3_COMPLETED ,
    INT_STATUS_3_SUCCESS_COUNT, INT_STATUS_3_ERROR_COUNT ,INT_STATUS_4_STATE,
    INT_STATUS_4_MESSAGE ,INT_STATUS_4_STARTED, INT_STATUS_4_COMPLETED ,
    INT_STATUS_4_SUCCESS_COUNT, INT_STATUS_4_ERROR_COUNT ,INT_STATUS_5_STATE,
    INT_STATUS_5_MESSAGE ,INT_STATUS_5_STARTED, INT_STATUS_5_COMPLETED ,
    INT_STATUS_5_SUCCESS_COUNT, INT_STATUS_5_ERROR_COUNT )
    VALUES
    (:B7 , :B6 , :B6 , :B5 , :B4 , NULL , NULL, NULL, :B3 , :B2 , :B1 , NULL ,
    NULL, NULL , NULL, NULL , :B1 , NULL , NULL, NULL , NULL, NULL , :B1 , NULL
    , NULL, NULL , NULL, NULL , :B1 , NULL , NULL, NULL , NULL, NULL , :B1 ,
    NULL , NULL, NULL , NULL, NULL )
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.01 0.12 12 1 12 1
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 0.01 0.12 12 1 12 1
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 70 (recursive depth: 1)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 12 0.02 0.12
    Thanks & Regards,
    Rup

    Hi;
    Please check our previous topic
    Concurrent manager real time tune
    Oracle apps database
    tune concurrent manager
    Oracle apps database
    Concurrent Manager very slow
    Concurrent Manager very slow........
    Regard
    Helios

Maybe you are looking for

  • Email link pops up window in IE

    I have selected text and used the mailto:[email protected] link to create an email link. I have tried static text and dynamic text and in IE, the mail client pops up, but so does an annoying window with "Navigation to Website was cancelled". It seems

  • Apple TV--accessing desktop MacPro on network

    Hello all, I just recently purchased Apple TV and just finished hooking it up. Seems like so far it works great, and I can access any of my itunes library that is on my MacBook Pro...however is there a way to access my itunes library that is on my Ma

  • HCM PF - Skip employee and processes selection

    Hi , In HCM PF we can skip the employee selection . Can we also skip process selection. We place the HCMPF link on sharepoint where it says something like "change employee group" as an example. There is no point in selection the processes again on SA

  • System Landscape security

    Hi, We have a system landscape having systems based on Java stack(EP,BI Java), Java+ABAP(XI,SRM) stack and ABAP(ECC) stack. We have Windows Active Directory as the LDAP server. We need to implement a security concept for the entire landscape. Require

  • Installing CS5 on my new computer

    I have just replaced my computer with CS5 installed with a new computer (Win 7).  How do I install CS5 on my new computer using the existing license I have?