Improve autosubmit performance in ADF JSF in Jdev 11g R1.

we are using autosubmit for taking item value w,th button, cascade list etc. (at inputtext item, list item).
But low bandwith our user feel a slowness when navigate out of items.
mouse cursor is turn to waiting even for inputtext.
is there any way to improve the perfromance of autosubmit operations.
Thanks...

Yes. I see.
our server web logic 10.1.3.1 and network bandwith depends on gigabit ethernet.
I came form Oracle forms backgound.
In my opinion ADF model layer is more capeable tan oracle forms.
But for view layer I can't say the same thing. (especially JSF, ADF RC)
In oracle forms you are not considering partial page rendering, auto submit, partial trigger, model view layer synchronisation etc.
this information is needed high level programmer experience.
ADF model layer rescue us from transection management, data inegrity problems.
But view layer couses programmers to learn tons of (unnecessery) new details. (That problem not just about ADF JSF. it is web (html, javascript) problem.)
ADF view layer is slower than forms appet at runtime also.
I thing ADF needs a more rebust and easy userinterface layer.

Similar Messages

  • Implementing shortcut keys ion JSF pages Jdev 11g

    How we can implement shortcut keys ion JSF pages Jdev 11g ?
    We are doing a Oracle Forms to Java migration and our users are getting use to use function keys.
    how we can map a commit action on the form to "CTRL + F7 key" (for example)
    Thanks.

    Hi,
    This is not possible directly. With JSF technology you are limited with browser capabilities which are HTML + Javascript. So you cannot communicate directly with i.e. commit function only with i.e. HTML form action or AJAX based javascript function...
    regards,
    Branislav

  • ADF JSF with JDev 10.1.3

    In my questions I will demonstrate by using two tables, Region for Master table and Countries for Details table.
    Lets say i have a field in Countries table called RegionId which is a Foreign key of Id in Region table.
    I would like to Retrieve a read-only table in JSF, so what i was doing is Draging the view from component pallete and droping it into JSP page.
    now to the point i was failed on doing i would like to reneder the RegionId value on the page to show as the name of the Region.
    so i tried to do it with No success .
    This issue was so simple in JDev 9.0.4 version impementing it once and for all on the DataModel (BC4J Level) and then when ever been called to the View Object the field was render already:
    http://www.oracle.com/technology/products/jdev/howtos/jsp/renderers.html
    thank you

    Well I have to say, that after a while developing with this technique of rendering the fields.
    It's not the right way to work. especially not IT system.
    Your suggestion to make a new view object that combines 2 other view object was too heavy on the system and slower my performances very badly.
    I think Oracle Must give a better solution to this Topic, which is the one of the first things any developer work with when talking about IT.
    I tried again to take two tables, let's say Dept and Emp.
    Dept has: Id,NAME
    Emp has: ID,NAME,DEPT_ID
    The only thing I wanted to do is show Emp table as ADF table.
    Then retrieve DEPT_ID to be shown as NAME (Dept: NAME of course).
    What I was doing is drag the Field from Data Control Palette into the DEPT_ID.
    the Problem is that the Itetrator took the first Value from Dept and didn’t do it for all the Emp Rows which was different Emp in different Dept.
    Hope to find a better solution to such an easy and small issue.

  • Slow response when calling a web service from an ADF client in JDev 11g

    I have generated a web service (WS) for a stored procedure package with 3 functions. The WS has less than 1 second response times when I use the standard WS testing facility. I then created a data control for the WS selecting the default values in the JDev wizard. When I test the functions from a very basic ADF client the response times for the same functions are between 3-4 seconds i.e. very SLOW compared to the actual response time of WS. I need some advice on how to investigate this performance degredation as seen from the ADF client.
    Could the problem be that the data control was created from a web service in the same project? Maybe it is necessary to have them in separate projects or create a proxy?
    I created and tested the web service with the standard WS test tool and then simply went on to create a data control from this web service for use from a ADF client.
    Some background info:
    I saw the following warning in step 8 of the WS creation wizard:
    "The configured policy store location at "C:\Oracle\Middleware\jdeveloper\j2ee\home\gmds" is invalid. Application cannot read policies from this location. Check that the directory name is correct and the location exists."
    Also I can confirm that there is no j2ee directory in my environment.
    The application server logs the following for each call from the ADF client:
    009-apr-01 15:55:22 oracle.adf.model.connection.webservice.impl.WebServiceConnectionMessages debugGetSaajInteraction
    INFO: Creating a SaajInteraction for oracle.j2ee.ws.model.OperationImpl@1c81d2c
    2009-apr-01 15:55:22 oracle.adf.model.connection.webservice.impl.WebServiceConnectionMessages debugGetSaajInteractionResult
    INFO: Created [email protected]79edc for oracle.j2ee.ws.model.OperationImpl@1c81d2c
    2009-apr-01 15:55:22 oracle.j2ee.ws.rm.LogMessages logExceptionAsWarning
    VARNING: Internal error: oracle.wsm.policy.model.PolicyModelException: WSM-01647 : There are no policies that match the specified category wsrm and resource pattern {1}.
    2009-apr-01 15:55:22 oracle.fabric.common.AbstractSecurityInterceptor init
    INFO: AbstractSecurityInterceptor:init(), client.mode.jse==ture and isJEE==true, probably is a case of JEE client calling JSE client
    2009-apr-01 15:55:22 oracle.wsm.agent.WSMAgent init
    INFO: WSMAgent is initialized for category=management, function=agent.function.client, topologyNodePath=null, isJ2EE=true
    2009-apr-01 15:55:22 oracle.fabric.common.AbstractSecurityInterceptor init
    INFO: AbstractSecurityInterceptor:init(), client.mode.jse==ture and isJEE==true, probably is a case of JEE client calling JSE client
    2009-apr-01 15:55:22 oracle.wsm.agent.WSMAgent init
    INFO: WSMAgent is initialized for category=security, function=agent.function.client, topologyNodePath=null, isJ2EE=true
    2009-apr-01 15:55:24 oracle.wsm.common.logging.WsmMessageLogger logSevere
    ALLVARLIG: error in the Oracle WSM Policy Resolver Initialization, because incorrect configuration is passed: {0} {1}
    Edited by: user10601664 on Apr 8, 2009 7:11 AM

    Find solution. Check this thread:
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/faq%2b-%2bmodels%2b-%2badaptive%2bweb%2bservice
    The com.sap.tc.webdynpro.model.webservice.api.IWDWSInvocationModifier interface can be implemented by an application using the Adaptive Web Service model in order to modify the web service invocation object just before it's execution. Invocation modifiers need to be registered with the executable model class for which invocation is to be modified:
    Request_NumberToWords requestMO = new Request_NumberToWords(model);
    requestMO.wdSetInvocationModifier(
      new IWDWSInvocationModifier() {
        public void doModifyInvocation(Object port) {
          HTTPControlInterface httpItf = HTTPControlFactory.getInterface(port);
          //timeout for this WS invocation is 120 sec; don't use global config. setting of WS-Runtime
          httpItf.setSocketTimeout(120000);
        public void doModifyAfterInvocation() {}
    Best regards.

  • ADF-JSF: Application Performance Issue

    Hello!
    My question or set of questions will be a bit vague...I am simply not sure where to look for problem(s). So here is what I have. Application implemented with ADF-JSF (JDEV ver:10.1.3.2.0). It basically has 5 pages. Each page containes user input form, commandButton and result table. Functionally, each page is a 'search page' that returns results based on what user specified in the form. Components on each page are bound to VO that is based on EO (DB table). Tables have at least 2.5M records up to 16M. Certain indexes exist (for most common searches) to improve the performance. However, there have been performance issues found and largely they would be grouped into the following:
    1. User is on page A, performs the search, goes to page B (via link) and performs other search, then goes back to A and similar search takes much longer to return results. Seems to me that this moght be related to memory. Maybe results of the previous search are cashed and it takes new search to retreive results longer as the VO cashe needs to be cleared first. Does that make sense?
    2. User is on page A and then goes to B. Leaves browser for 10-20 minutes and tries to go back to A. It takes up to a minute before page reloads with the previously displayed results. I am thinking this has to be related to page lifecycle where AM tries to re-execute bindings ( I do not think it is passivation issue though). What is the best practice to control the lifecycle?
    Any pointer on where to look for the solution is very welcome.
    Rade

    Carl,
    To use Tom Kyte's analogy, you are firing a gun into a room full of people hoping to hit the bad guy. You haven't seemed to have gotten any information about where the performance issues lie. It could be in the DB, network, ADF Business Components, JSF layer, other stuff monopolizing resources, etc, etc. I have ADF BC apps developed in 10.1.3.3 that run quite well.
    So, I would recommend you spend some time investigating where the performance problems lie. Try turning on logging output, check machine utilization - use your investigative techniques to find the bad guy so you can then work on fixing him.
    John

  • Cannot deploy ADF JSF project from JDeveloper 10.1.3.3.0 to AS 10.1.2.0.2

    Hi All,
    I've a small deployment issue which you guys might be able to help me with.
    I've developed an ADF BC JSF project using JHeadstart 10.1.3.2.50 and it was running fine on my self contained OC4J instance. But when I try to deploy it across to my Oracle 10G AS version 10.1.2.0.2., it had the following errors:
    ----- START OF LOG ------
    Initializing log
    Servlet interface for OC4J DCM commands
    Command timeout defined at 600 seconds
    Executing DCM command...
    Executing command redeploy D:\OraHome_3 D:\jdevstudio10133\jdev\mywork\PAM2070C\ViewController\deploy\webapp1.ear webapp1 UNDEFINED
    Command = REDEPLOY
    Reading application's ear file
    Ear file was successfully read
    Opening connection to Oc4jDcmServlet
    Setting userName to ias_admin
    Sending command to DCM servlet
    HTTP response code = 200, HTTP response msg = OK
    Command was successfully sent to Oc4jDcmServlet
    Receiving session id from servlet to check command status
    Session id = c0a8238746b50fc1d5b78e274fcfb38b81a490036726
    Please, wait for command to finish...
    Checking command status...
    Setting userName to ias_admin
    Setting Cookie to JSESSIONID=c0a8238746b50fc1d5b78e274fcfb38b81a490036726
    Checking command status
    HTTP response code = 200, HTTP response msg = OK
    Command has finished
    Receiving command exit value
    Receiving command output
    **** No output was received from command
    Closing connection to Oc4jDcmServlet
    #### DCM command did not complete successfully (-8)
    #### HTTP return code was -8
    Exit status of DCM servlet client: -8
    Elapsed time for deployment: 18 seconds
    #### Deployment incomplete. #### 15/05/2008 17:00:33
    ---- END OF LOG ----
    Has anyone been able to deploy ADF JSF project with JHeadstart using JDeveloper 10.1.3.3.0 to Oracle 10G AS 10.1.2.0.2? I'm using window environment. Any feedback is much appreciated. Thank you for your assistance and have a nice day.
    Kind Regards,
    John

    Hi all,
    I had also tried out something else...
    I am now portalizing the ADF application using PortalFacesBridge and portlet.xml. Then I deploy it on the Local OC4J of my system and expose it as a WSRP Portlet using the url: 'http://hostname:portname/warFileName/info and generating a WSDL URL...
    I am then using this WSDL URL to regester this portalized application on the Oracle Portal10.1.4 which i am able to accomplish successfully...
    However after regestration, when I try to view this on the portal page, It is throwing the following error:-
    Error: Could not get markup. The cookie or session is invalid or there is a runtime exception.
    Also I would like to add that this method was working perfectly fine previously...
    What might be the clue for this sudden error...
    Any kind of help is greatly appriciated... Thanks...

  • How to improve the performance in AM level

    Hi,
    I am using Jdeveloper 11.1.1.2.0 and weblogic server 10.3.2.
    How to improve the performance in AM level.
    Actually i have approx 10 lacs Data but when search the record then it is taking more time.
    I have following the link..
    http://www.gebs.ro/blog/oracle/adf-view-object-performance-tuning-analysis/
    but there is no effect in the performance level for seaching.
    So please help me ..
    Thanks
    Anup

    Hi Timo,
    In search page,i m giving empId and click on search button then to execute query it is taking more time.I have override the VOImpl executeQuery(). then it is taking more time
    @Override
    public void executeQuery() {
    setNamedWhereClauseParam("bind_draft", "D");
    setNamedWhereClauseParam("bind_complete","%");
    setNamedWhereClauseParam("bind_reject","%");
    setNamedWhereClauseParam("bind_approve","A");
    setNamedWhereClauseParam("bind_review","R");
    super.executeQuery();
    this method super.executeQuery() is calling and after 5 minutes heap space is comming on cosole as well as page also.
    Thanks
    Anup

  • ADF/JSF page loads when any command button is clicked

    Hello All,
    I am lost in the ADF/JSF page flow (using Jdev 10.1.3). Following are the tags (in order) in my page;
    (WHEN THIS PAGE LOADS, IT GOES TO THE DATABASE TO GET VALUES (for the drop down lists that will appear on the page); THIS SHOULD HAPPEN JUST ONCE AND AT THIS POINT)
    <f:view>
    <afh:body>
    <afh:html>
    <af:form>
    <af:panelpage>
    <f:facet name="contextSwitcher">
    <af:panelHorizontal> has a af:commandLink </af:panelHorizontal>
    </f:facet>
    <f:facet name="messages">
    <af:messages/>
    </f:facet>
    <af:panelform>
    <h:panelGrid columns="2" cellspacing="14">
    has 2 panelgroups (one group has *2 SelectOneChoice lists (that need to be populated by fetching data from database* and the other group has 2 CommandButtons - 'Go' and 'Cancel") (GO BUTTON SETS THE SHOWPANEL() TO TRUE)
    (WHEN GO BUTTON IS CLICKED, THE PAGE GOES TO THE DATABASE (AS IT DID ON PAGE LOAD). *THIS SHOULD NOT BE HAPPENING*. ONLY THE METHOD (action="#{muBean.doWork}" )THAT IS ASSOCIATED WITH GO BUTTON ACTION SHOULD BE CALLED)
    </h:panelGrid>
    <h:panelGrid columns="2" cellspacing="14" rendered="#{myBean.showPanel}"> (THIS ONE IS RENDERED WHEN SHOWPANEL() METHOD IS TRUE)
    has 3 inputText fields
    </h:panelGrid>
    <af:table var="someTable" rendered="#{myBean.showPanel}"> (THIS ONE IS RENDERED WHEN SHOWPANEL() METHOD IS TRUE)
    has a bunch of af:columns
    </af:table>
    <af:panelHorizontal rendered="#{myBean.showPanel}"> (THIS ONE IS RENDERED WHEN SHOWPANEL() METHOD IS TRUE)
    has 3 af:commandButtons - submit, save, add row
    (WHEN submit or save or add row BUTTON IS CLICKED, THE PAGE KIND OF LOADS AND GOES TO THE DATABASE (AS IT DID ON PAGE LOAD). *THIS SHOULD NOT BE HAPPENING*. ONLY THE METHOD THAT IS ASSOCIATED WITH submit/save/add row BUTTON ACTION SHOULD BE CALLED)
    </af:panelHorizontal
    </af:panelForm>
    </af:panelPage>
    <!-- Footer -->
    <jsp:include page="/pages/includes/footer.jspx"/>
    </af:form>
    <f:verbatim>
    <script type="text/javascript" src="../script/tree.js"></script>
    </f:verbatim>
    </afh:body>
    </afh:html>
    </f:view>
    </jsp:root>
    _*why is it that when the command buttons are clicked, the whole page is loaded? Only the methods associated with the action (action="#{newMapRequestItem.addARow}" ) should be called.*_
    _*IS THERE A WAY TO AVOID THIS WITHOUT USING PARTIAL PAGE RENDERING ?*_
    _*DOES MY TAG NESTING LOOK OK?*_
    Edited by: user12054715 on Mar 24, 2010 12:00 PM

    Can somebody please address this?
    Thanks,

  • Invoke secured WS from ADF JSF Page

    Hello,
    How can I invoke secured Web Service from simple adf jsf page?? Service is secured by wss_username_token_service_policy.
    I'll be glad if somebody could give me some tutorial how to build this page. I mean inputs for username and password.
    Best regards,
    MK

    Hi,
    I've read your article: http://www.oracle.com/technology/products/jdev/howtos/1013/protectedws/access_protected_web_services_from_adf.htm I added to the Model - Web Service Data control and as a service give a link to my composite application deployed on soa_server (http://localhost:8001/soa-infra/services/default/registerMyPassComposite/registerMyPassWebService?WSDL). When i click on Define Web Service security I only have a window to add policies and there is no wizard steps as you shown i your article Figure 9. I cannot chose Authentication type but I can only define policies for my dataControl.
    How to resolve it?

  • Performance Problem ADF-UIX Appl. with Bea 8.1

    Hello JDev & J2EE Folks,
    I'm running into a performance problem with an ADF-UIX Application (JDev Version 10.1.2.0.0) under Bea 8.1. Application Server. It seems that the the same application is running at least factor 5 slower than on OC4J. I didn't experience such a difference with the older JDev9i Applications, seems to be an issue with 10g. Not done much investigation so far. Are there any ideas or suggestions out there? Anyone who had a similar problem?

    Hi ,
    Did you get this resolved? Can you share? Thanks!

  • Improve PC Performance transcript of Meet the Experts online chat event

    On June 1st, HP hosted an online chat event on improving PC performance. Below is a transcriptof that session. 
    Please note that I have altered the transcript so that follow up questions areincluded in the logical order.
    I am in the process of planning the next chatevent. I would love to hear what topics would interest you, what day of theweek and time is best for you, and if you think an hour is too long. 
    So, if you get a minute, please let me know.
    Here's the transcript:
     SiobhanF-HP: Welcome!
    SiobhanF-HP: If you want to ask a question, you must be a member of the HP Support Forums. If you want to join, go here https://passport2.hp.com/hppcf/createuser.do
    SiobhanF-HP: Our team of experts is here and ready to tackle your toughest questions.
    SiobhanF-HP: Bryan_N began tinkering with computers in the early 80s with the Atari 400. He has been at HP for almost 10 years and is focused on notebooks and Wireless Wide Area Networks (WWAN.)
    SiobhanF-HP: RasterBlaster, aka Randy, also began his fascination with computers 30 years ago when he spent $550 for an Atari 400. He has been addicted to desktop computers ever since and has worked at HP for 16 years.
    SiobhanF-HP: Mister Do, aka Kevin, has worked for HP for 11 years. He is a desktop guy and has been ripping PCs apart to see how they work and get better performance out of them for more than 20 years.
    SiobhanF-HP: Sanchertx, aka Ralph, is another 20 year PC veteran. He has worked at HP for 15 years and focuses on improving notebook and network performance.
    SiobhanF-HP: Huffer, aka Steve, is an attorney by day and a PC enthusiast by night. Although Steve does not work for HP, he is an avid member of the Support Forums. His forte is troubleshooting hardware and software issues, and he uses Linux as a personal operating system instead of Windows.
    DexterM: Hello people. I believe that the main reason PC's slow down is because of files leftover after program uninstalls. Many programs leave behind files that store user settings and preferences of the programs even after "complete" uninstallation. Is there any way to completely remove them during uninstallation?
    Bryan_N: To DexterM Hi Dexter, Some applications have specific removal tools to fully clean them out, such as the Norton Removal Tool. You can go to symantec.com and search for "Norton Removal Tool". There are also third party applications for cleaning out abandoned registry files, such as CrapCleaner which is what I have used personally. It can be found at ccleaner.com
    nseidl33: Can I add more memory to my notebook? If I do, will it void the warranty?
    Sanchertx: To nseidl33 hello Nseid133, no you will not void the warranty - you should make sure the specs match up if you buy memory from someone other than HP. That said, you may be required to remove the memory in the event there is a troubleshooting session with HP Support.
    aarond22: Does adding more memory really make my PC run faster? If it does, how can I figure out how much memory to add and how hard is it to do?
    RasterBlaster: To aarond22 While you use your computer, all software and drivers take up memory. Windows "places" the software and drivers into the hardware memory first because it is fastest. After it runs out of hardware memory it will eventually store the excess data on the hard drive which is much slower. So the amount of memory you have will speed up your computer, but how much speed depends on several factors. Generally, for Vista 64-bit, adding up to 4 GB has the biggest speed gains. Over 4 GB doesn't speed things up all that much unless you do things like video or large graphic editing - software that uses a lot of data. You can find memory upgrade information from the product specification or motherboard specification for your model of desktop PC. This HP support article should answer everything:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=bph03886&cc=us&dlc=en&lc=en&jumpid=reg_R1002_USE.... 
    animeowns: need a good gaming video card dx10 to play the newer games in hpa1720n
    Huffer: To animeowns I am a big fan of the ATI HD 4800 series. It is DX10 compatible and very fast.
    HPMAN10: I have a problem with my PC freezing up when I return from sleep mode. This just starting happening recently. Could it have anything to with installing Windows Vista Service Pack 2?
    Huffer: To HPMAN10 Have you also added any new hardware? Sleep mode issues are often driver related. Also, some systems need to have their BIOS updated after installing Vista SP2.
    HPMAN10: No I have not added new drivers. So you’re saying I should upgrade the BIOS. Isn't that a tricky to do? It could cause more problems.
    Huffer: To HPMAN10 Yes, you should be careful with the BIOS upgrades but it should work well from Windows. Close all other programs and be patient with it.
    HPMAN10: What about the freeze up in sleep mode? Do I need to update the BIOS for that problem too?
    Huffer: To HPMAN10 Yes, there is a good chance it will help, and it cannot hurt to have the latest BIOS. Here is a good link for information: http://technet.microsoft.com/enus/library/dd335032(WS.10).aspx
    Here is a good link to locate BIOS Updates for notebooks http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00042629&tmp_track_link=ot_faqs/top_issues/en_u...
    Here is a good link to update the BIOS for desktops http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00007682&cc=us&lc=en&dlc=en HPMAN10: So I should update the BIOS from the HP download page?
    Huffer: To HPMAN10 Yes, use the Windows-based BIOS updater. Turn off all other programs.
    HPMAN10: If I have a problem with BIOS update can I do a system restore to revert back to original BIOS?
    RasterBlaster: To HPMAN10 System Restore will not revert to a previous BIOS. System Restore is only for Windows - BIOS is a separate lower level function.
    Huffer: To HPMAN10 BIOS is not part of the operating system, but you can flash back to an earlier version of the OS if needed. I really doubt you will have an issue. HPMAN10: I have a HP s3220n system and my Windows Media Center has a Tuner Not Installed message when I try to use live TV, I have tried everything from HP online support to Microsoft Help and nothing has solved the problem.  Any suggestions?
    RasterBlaster: To HPMAN10 s3220n comes with a tuner card. The no tuner found error can happen when some other TV capture software "checks out" the tuner. If you have a startup item, like webcam software that is set to hook into the Tuner card, you should go in and change the setting or remove it. Have you read this support document?http://h10025.www1.hp.com/ewfrf/wc/document?docname=c01187871&cc=us&lc=en&dlc=en
    HPMAN10: Yes I have read the HP document and tried the suggestions on it without success.
    HPMAN10: I do not have a webcam.
    HPMAN10: Also my PC Doctor software does not show tuner in the diagnostic program.
    Mister_Do: To HPMAN10 If your tuner card is not showing up in PC Doctor, try opening the PC and reseating the tuner. If it still doesn't work, you possibly have a hardware failure.
    HPMAN10: Yes I tried hardware and software recovery in HP Help and Tools. Same results NO TUNER INSTALLED.
    RasterBlaster: To HPMAN10 Well, unless you did something major ... like upgrade your OS to Vista SP2... or something like that... I'd say your tuner hardware is gone. Especially if you did a system recovery. System recovery takes you back the original configuration
    HPMAN10: I have removed the tuner card and reseated it without results in PC Doctor. I'll try it once more.
    HPMAN10: Will a BIOS update also help the TV tuner problem?
    HPMAN10: By the way I can watch programs I have recorded in the past in Media Center.
    RasterBlaster: To HPMAN10 I don't think the BIOS update will help... here is the text from the site: M2N61-AR Motherboard BIOS update resolves issue with the computer shutting down and displaying message "ERROR: Unsupported CPU installed. PC will automatically shut down in a few seconds." Did you reinstall the driver from HP Help and Tools? There should at least be an unknown device in Device Manager. You older files that you are able to view are simply files that were created before you lost your tuner. “No Tuner Found” just means that Media Center cannot find the card because the card is "Check out" of the drivers are out of whack.
    HPMAN10: I had tuner problem even before I installed SP2.
    RasterBlaster: To HPMAN10 Well, if your tuner died and you could never get it to work after that, it might be a heat related failure. Tuners get hot... but usually, when a tuner gets too hot, you'll get some funny symptoms before it dies... like channel changing takes way too long -- to change up or down - or lots of frame skipping. IF it comes and goes - you have a software conflict problem.
    amberdidi: Hi to you all, Why am I constantly receiving the following message and what can I do to correct it. "Windows cannot access the specified device, path or file. You may not have the appropriate permissions" Note: After I click Ok to this message it usually takes me to the page anyhow.
    Bryan_N: To amberdidi Hi amberdidi, I'm not sure what OS you have, but this is a helpful document from Microsoft for XP: http://support.microsoft.com/?kbid=308421
    amberdidi: About that message "Windows cannot access the specified device...." I am using Vista Home Edition 64 bit SP2.
    Bryan_N: To amberdidi Ok, thanks for the clarification. It sounds like it is a security setting in Internet Explorer, try this please: http://support.microsoft.com/kb/959079
    animeowns: Did you receive my other message?
    Mister_Do: To animeowns Yes, we are working on it.
    animeowns: I need a card that will fit in my computer case right now I’m using a 7900 and it’s a tight fit. Here are the specs for my motherboard http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00864946&lc=en&dlc=en&cc=us&os=2093&product=334... 
    animeowns: It must be about 7.8 x 3 x 4.4 inches – that’s the size of my 7900 gs, and it’s a tight fit. My motherboard is Micro-ATX: 9.6 in X 9.6 in. Please help. I want to upgrade to a nice card that will be able to play games like crysis fear 2 unreal tournament 3.
    RasterBlaster: To animeowns Yeah, finding low-profile cards can be tricky. It sounds like you have the measurement. Searching the internet shopping sites for low-profile graphics cards should bring up some cards - then find one you like and work with the site to make sure it fits your measurement. HP can supply a replacement - but if it is not on HP shopping's site - you can go with other shopping sites.
    animeowns: Will this video card fit in my system? http://www.newegg.com/Product/Product.aspx?Item=N82E16814127414
    Mister_Do: To animeowns Sorry, I haven't tried that one personally, so I'm not sure. You'll need to make sure your current card dimensions match the new card.animeowns: Can someone please help me find a direct x 10 gaming card that will fit in my hp a1720n? The size has to be 7.8 x 3 x 4.4 inches or smaller that is the size of my pny 7900 gs and its a tight fit because the memory is real close.
    RasterBlaster: To animeowns Huffer had to step out. The folks trying to help you in this chat session are from HP. We can't recommend a video card upgrade that did not already come with your PC - sorry You should post this same question into the forums under desktop PC and hardware (or video) category.
    whitey: I have a ZD-7015us laptop and would like to know if the processor can be upgraded.
    Huffer: To whitey I wouldn’t really recommended it because it is hard to know if it will overheat, but a Pentium 4 desktop processor will fit.
    SiobhanF-HP: If you have specific product questions, the more information you give us the better we will be able to help you. Getting your exact model number; any error messages; what operating system version are you running; any recent hardware or software changes will go a long way to helping us answer your question.
    amberdidi: I would like to know if NOD 32 antivirus is compatible with my Vista 64 bit. I am using Avast at the moment, but I am really interested in NOD32 or a good quality antivirus you can recommend for 64 bit. Thank you.
    Huffer: To amberdidi I use Avast or AVG on Vista 64 bit systems and either works well. I have only used NOD32 on 32 bit systems. The NOD32 website will answer this question definitively.
    amberdidi: Back to the freezing problem with my Vista 64 bit. I downloaded only the final version of SP2 but I have updated most of my drivers including the latest NVIDIA driver from their site. Should I also update my BIOS?
    Sanchertx: To amberdidi Yes, update the BIOS.
    DexterM: Other than unchecking Startup Programs from MS Configuration Utility, is there any other way to speed up startup time of a Windows PC?
    RasterBlaster: To DexterM There are lots of methods. If you have Vista - go in and shut down aero, if you don't need it, make sure your temp files are cleared, etc... Here is a support document:http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00815926&cc=us&lc=en&dlc=en  
    XP: http://h10025.www1.hp.com/ewfrf/wc/document?docname=bph06569&cc=us&lc=en&dlc=en
    Blondechica: I just bought a HP HDX16 and I am embarrassed to say I do not how to find the On button. I am using my friend’s computer and told him that I had a different problem with my computer and gave this site. Also, when I do get it turned on will it be blank. Do have to buy software? I hope this is not the first time someone has asked this question. This is all new to me. Thank you for your help.
    Sanchertx: To Blondechica Hello, please hit the power button on the top left of the keyboard cover. This will illuminate to a blue color to show the unit is on. You must let the unit create the image. This means you will let it run on its own until you see the Welcome screen. The unit comes with the Vista operating system and has HP applications. It also comes with trial versions of Norton antivirus and MS Office.
    Petedog11: I have the HP Pavilion a6745f Desktop PC and would like to upgrade my graphics card. I like to run high-end flight simulators. What graphics card do you recommend? Will I need to upgrade my power supply unit also? Is there a way to disable the on board graphics card that came with the computer once I install a new graphics card? Thank you.
    Huffer: To Petedog11 A new power supply should not be needed. When you plug in a new video card it will automatically disable the onboard. Just be sure you have a pci-e poer connector (6 pin)
    Petedog11: The power supply unit that is in my HP Pavilion a6745f Desktop PC is 300 watts I believe. My understanding is that the newer Radeon's etc...need more power. Will you please answer the remainder of my original question.....I like to run high-end flight simulators. What graphics card do you recommend? Thanks!
    Huffer: To Petedog11 300 watts is a bit light. I would look for around a 500 watt psu.
    mlk3742: I have a dv9000 laptop, it has 4 gigs of ram. I run Photoshop CS4. Is there any way to increase processing speed?
    Sanchertx: To mlk3742 While there isn’t a switch you can turn on to make the processor run faster, you can do things like remove un-needed software and remove items from startup. Also disabling HP Advisor helps. Here is a good reference -
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00816938&lc=en&dlc=en&cc=us&lang=en&rule=13847&...
    amberdidi: Since I downloaded SP2 on my Vista Home Edition I also am freezing up every so often to the point that I have to use Task Manager to end it and start over again. I have an HP Elite with 1000GB hard drive and 8192MB memory. What can I do? Thank you.
    Bryan_N: To amberdidi If you downloaded the beta version of SP2 you might want to uninstall it and download the final version. If you downloaded the final version and this started with SP2, you can check the Problem Reports and Solutions feature of Vista. Just click the Start button, and type: Problem Reports, then click on the application
    scribblesteve: Besides the usual cleaning up Temp files and using Disk Clean up or Defrag, how can I prevent my computer from running sluggishly? I want it to run as fast and as smooth as it did the first time I turned it on?
    Mister_Do: To scribblesteve Removing startup items or keeping programs from running in the background helps a lot. And depending on what operating system you have there are multiple settings you can change to improve performance. Here are two HP support documents that list multiple ways to improve your PC performance: For XP: http://h10025.www1.hp.com/ewfrf/wc/document?docname=bph06569&cc=us&dlc=en&lc=en&jumpid=reg_R1002_USE...
    For Vista: http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00815926&cc=us&dlc=en&lc=en&jumpid=reg_R1002_US...
    bjm: I have a Compaq Presario A931NR Notebook BIOS F.32 Software Driver download site displays F.34 I don't know if I should Update to F.34 because F.32 is not listed as a previous version, and I don't know if I can go from F.32 to F,34 without F.33
    Huffer: To bjm No problem. You can easily skip a level of BIOS update and go right to 3.4.
    bjm: Need to know if I should update my BIOS
    Huffer: To bjm The update will work, but I really need to know what your problem is to assess whether the BIOS update is necessary.
    bjm: HP Updates report no available Updates so how do I know if I need Update other than what is presented on Software Driver download page
    Mister_Do: To bjm If HP Update says you don't have any new updates, then your PC is up to date with the latest drivers. If you by chance see a software or driver file on you product support page, and it's newer than what you have. You can install it, but if your PC is running fine, you may not want to bother.
    bjm: Huffer asked why is BIOS update necessary. I would ask why does Software Update site show an Update if it's not necessary? HP Update is not working to report BIOS updates. 13 months and no Updates ever. So, all I have to go by is Software Update site which report newer BIOS with Enhancements to Security. Why would Total Care Advisor, HP Health Check and HP Update not have even one Update or info after 13 months of service?
    RasterBlaster: To bjm The software BIOS update page on hp.com/customercare should tell you what the BIOS update fixes or improves. If your system is running well or the BIOS update page does not list a fix for your problem - don't update the BIOS. That's my opinion anyway. BIOS updates do introduce a level of risk. For example if you have a power outage while updating the BIOS, the PC will require service. So ... if in doubt, don't do it unless you know it resolves an issue.
    bjm: The BIOS Update to F.34 is stated as having Security Enhancements. Does the System Info refresh with a BIOS update or is System Info static
    Mister_Do: To bjm Where are you viewing the System Info? From the BIOS itself, from "Properties" under "Computer", etc.? Here’s good document on Locating HP Software, Driver and BIOS Updates:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00042629&tmp_track_link=ot_faqs/top_issues/en_u...
    puter_student: I sent my hp Mini 1000 (Win XP) into service about two weeks ago. I gave a lady friend a 1120NR (Mi on Linux) yesterday. As she is a geographic distance, and using a different OS, how would you suggest I assist her by telephone. And, once she establishes solid Internet access, is it best to send her e-mail or instant messages?
    Bryan_N: To puter_student Hi Puter_student, you have several choices since HPMI supports MSN messenger and other chat programs via the "pidgeon" application, and it also comes preinstalled with Skype. You can install either of those on your XP unit. Skype also allows you to use a webcam at the same time.
    puter_student: Sorry, I stated my question badly. I did not mean to ask about the communications technology. I meant the information resources available online -- to both her and me -- WRT setup, configuration (if needed), etc. The realization came to me earlier today that I cannot "walk" her thru it by simply telling her what I see on my own machine as I take certain actions [other, of course, than accessing appropriate documents about her model]. Can you point me in the right direction to those resource documents?
    Bryan_N: To puter_student For support documents you can start here:
    http://h10025.www1.hp.com/ewfrf/wc/product?product=3860346&lc=en&cc=us&dlc=en&lang=en&cc=us
    puter_student: I clicked the link you supplied. Doing so took me out of this chat, but did not get me where you were trying to send me. Now, when I return to the chat, I no longer have the earlier session history. When will it be posted, and where can I find the whole chat session later?
    Bryan_N: To puter_student The transcript will be posted on the boards within 48 hours after this event. I got to the link by going to hp.com, and searching for support on "mini 1110nr" http://h10025.www1.hp.com/ewfrf/wc/product?product=3860346&lc=en&cc=us&dlc=en&lang=en&cc=us
    The MI desktop is based on Ubuntu, and you can also find lots of general Ubuntu information on external forums Certain applications have support externally as well, such as the Firefox browser.
    mlk3742: to Sanchertx: Can I swap out or replace the graphics card to speed up graphic intensive demands such as Photoshop?
    Sanchertx: To mlk3742 Hello - not with our notebooks. They are either attached to system board or a daughter board, which is then attached to the system board.mlk3742: to Sanchertx: So there is no way from a hardware approach to increase speed? The only time I notice my lap slows down is processing large files, i.e. photos, or while performing image edits in Photoshop. After increasing RAM, everything else has speeded up noticeably. My laptop has more than half the hard drive space free.
    Sanchertx: To mlk3742 Hardware wise you can get a faster hard drive - example move from a 5400 rpm to 7200 RPM - Also make sure you have the latest BIOS update. These usually have maintenance modifications to resolve potential problems and tweak the hardware.mlk3742: to Sanchertx: How and or where do I get a BIOS upgrade? Do you have a recommendation for which hard drive to get? Will any aftermarket drive fit in my laptop?
    Sanchertx: To mlk3742 Hello – this document Locating HP Software, Driver and BIOS Updates should help http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00042629&tmp_track_link=ot_faqs/top_issues/en_u... I cannot recommend a 3rd party - aftermarket drive - but there are many available. A good place to look is notebookforum.com.
    scribblesteve: My battery is fine, but the HP Battery check doesn't recognize it. I have the most updated versions of BIOS, Help and Support and sp41862, and it still doesn't recognize it. I'm running Vista32bit on an HP pavilion dv6704nr. What else can I try to check and prolong the life of my battery?
    Bryan_N: To scribblesteve Hi scribblesteve, ensure the battery is charged and the AC adaptor is plugged in when testing. If that doesn't work, you can do some basic battery life steps. These are found at http://h20239.www2.hp.com/techcenter/battery/Battery_max.htm  and also at http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00821429&cc=us&dlc=en&lc=en&jumpid=reg_R1002_US...
    DexterM: What tweaks do you guys usually do on your Windows PC's to ensure optimal PC performance?
    Bryan_N: To DexterM Hi DexterM, I uninstall any applications I don't use, run Microsoft and HP updates, keep a good antivirus installed, and also I personally use a third party application called ccleaner. I back up my unit in full every month as well just in case.
    amdkenworth: Hi I have an HP that has a on board video card and it won’t show any video when its turned on???
    RasterBlaster: To amdkenworth First thing you should do is try connecting another monitor to see if it is related to the monitor or the video on the motherboard. Here is document that you should check out: http://h10025.www1.hp.com/ewfrf/wc/document?docname=bph04760&lc=en&dlc=en&cc=us&lang=en&rule=3950&pr...
    jest1: My notebook has a short battery life. Is there something I can do?
    Sanchertx: To jest1 A: There are several things you can do to extend battery life such as changing your power plan, calibrating your battery to increase capacity, or shutting off unused features in the OS. Here is an excellent document on notebook battery usage that will walk you through your options step by step http://tinyurl.com/57x38x
    Dominick_7: Hi I have an HDX 9000t and was wondering if anyone knew if/how I could upgrade the graphics card, to say an MXM GPU?
    Bryan_N: To Dominick_7 Hi Dominick_7, there isn't a way to upgrade the video card itself. You can ensure you have the latest drivers by visiting hp.com and checking drivers, and keep your overall system optimized with standard PC Tune up steps such as this document: c00034290 - HP Notebook PCs - Improving the Performance of Your Notebook PC
    Dominick_7: From what I understand, an HP tech told me MXM has on board BIOS which doesn’t depend on the BIOS from the motherboard. What leads you to say it can’t be done?
    Bryan_N: To Dominick_7 The video card is separate, but not replaceable as it is directly attached to the system board
    Dominick_7: Can't the same be said about the processor? Yet I know people who have updated their processors, and GPUs when they upgrade them from an ATI to the 8800M GTS NVIDIA GPU? If you could please elaborate in a more detailed fashion as to what the obstacles are I'd appreciate it. Is that the ONLY reason why you say it can't be done? Because it’s directly connected to the motherboard? If that was insurmountable wouldn't that make it impossible to upgrade the ATI GPU in lower specd HDXs to the 8800 NVI...
    Bryan_N: To Dominick_7 The CPU is not soldered onto the system board, so it is replaceable. The GPU/Graphics card is soldered onto the system board and is not replaceable.
    SSPatrick: HP Total Care Advisor is giving me warnings - How do I clear these up?
    Sanchertx: To SSPatrick Click on the PC Update button inside of Advisor to check for and run updates. After you run all the necessary updates, you should click on Health Check to scan your computer to remove the warnings. Here is a good document on the ins and outs of Total Care Advisor. http://h10025.www1.hp.com/ewfrf/wc/document?docname=c01599730&cc=us&dlc=en&lc=en&jumpid=reg_R1002_US...
    Petedog11: I have the HP Pavilion a6745f Desktop PC. Media Center came pre-installed with the computer. Do I have a Tuner card installed?
    Mister_Do: To Petedog11 Hi Petedog11, It doesn't look like you have a TV Tuner installed. Here is your product spec for reference: http://h10025.www1.hp.com/ewfrf/wc/document?docname=c01625611&cc=us&lc=en&dlc=en&product=3870515
    laurensw: I installed antivirus software and now my PC is running really slow - what should I do?
    Bryan_N: To laurensw Hi Laurensw, It often helps to ensure the original antivirus software was fully removed. One possible solution is to use the Norton Removal Tool to completely remove the trial version of Norton that shipped with your PC.
    rdewing: My PC is about a year old and it is getting slower and slower. Do I have a virus? Is there something that I can do to make run faster?
    Mister_Do: To rdewing It is tough to say why your PC is running slowly, but there are some things you can do that may help its performance. Check out this web site for step by step instructions on basic PC care. http://h20239.www2.hp.com/techcenter/pctuneup/  HP also offers free online classes to teach you how to tune up your XP or Vista PC. Check it out http://tinyurl.com/lj86yt
    scribblesteve: I'm having a graphics problem where I cannot see images. I have only seen it with the HP Help and Support and the Installation of Adobe Web Premium Installation. I have no Idea how to fix this, and neither does anyone in the multiple Support Forums I've posted the problem in. Here are some screenshots: http://www.stevedolan.com/shared/graphicsproblem.jpg  | http://www.stevedolan.com/shared/graphicsproblem2.jpg
    Bryan_N: To scribblesteve This one looks like something I cannot answer before the event terminates. Can you start a thread on this on the customer forums here and we can continue? If you already have, can you send me the link and I can subscribe to it?
    scribblesteve: Bryan_N: Here is that link: http://h30434.www3.hp.com/psg/board/message?board.id=Display&message.id=1715#M1715
    Bryan_N: To scribblesteve Thanks scribblesteve
    SiobhanF-HP: We are nearing the end of our chat session. We only have time for 3 more questions. If we did not get to your question, please post it on the Notebook and Desktop boards.
    jest1: It takes my PC a pretty long time to boot. Any recommendations?
    Mister_Do: To jest1 The first two things I would consider doing would be to 1) add more memory to your PC (unless you already have max memory), and 2) I would change my Startup program and process settings. Here are a few HP Support documents that explain how to prevent unnecessary programs from running at startup: For Vista: http://h10025.www1.hp.com/ewfrf/wc/document?lc=en&dlc=en&cc=us&docname=c00813419 For Vista: http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00819747&cc=us&lc=en&dlc=en For XP: http://h10025.www1.hp.com/ewfrf/wc/document?docname=bph07149&cc=us&lc=en&dlc=en
    SiobhanF-HP: We only have time for one more question. If we did not get to your question, please post it on the Notebook or Desktop boards.
    jest1: I think I have a notebook battery that was part of a recent recall, what do I do about this?
    Mister_Do: To jest1 Visit the HP Notebook PC Battery Pack Replacement Program Web site at: http://www.hp.com/support/BatteryReplacement for additional information and to determine if your battery is part of the program.
    jest1: How can I find out the maximum amount of memory my system can accept?
    Mister_Do: To jest1 HP has product specifications for your PC on its web site. Go to www.HP.com and click on Software Driver and enter your exact PC model name. You must give the specific model number, ex dv9009nr, and not the series number, ex dv9000. Click on the document that references Product Specifications at the top of the list of articles. You will get a detailed breakdown of your system including microprocessor, graphics card, and the maximum amount of memory you can load onto your PC.
    SiobhanF-HP: We are ending the chat event. Thank you for coming. We hope you found it worthwhile. I will be posting a transcript of the event in announcement section at the top of the Notebook and Desktop boards. Please feel free to continue these conversations on the Forums.
    SiobhanF-HP: We will be hosting future Meet the Experts chat sessions on a variety of topics, so please tell us what you thought of the event and how it could be improved.
    Message Edited by timhsu on 06-02-2009 05:28 PM
    I work for HP, supporting the HP Experts who volunteer their time and technical knowledge to help others.

    hello sir,
    i want to your help
    i was installed fresh windows 7 via cd rom and then after installed all software.
    and now after 1 day customer complained me that cd rom not read any cd and i m also check when i insurt cd so its not read and when i am double click on cd rom icon its eject so what i do for that please reply on my email address.
    [text removed for privacy]
    VIMAL

  • Re: How to Improve the performance on Rollup of Aggregates for PCA Infocube

    Hi BW Guru's,
    I have unresolved issue and our team is still working on it.
    I have already posted several questions on this but not clear on how to reduce the time on Rollup of Aggregates process.
    I have requested for OSS note and searching myself but still could not found.
    Finally i have executed one of the cube in RSRV with the database selection
    "Database indexes of an InfoCube and its aggregates"  and got warning messages i was tried to correct the error and executed once again but still i found warning message. and the error message are as follows: (this is only for one info cube we got 6 info cubes i am executing one by one).
    ORACLE: Index /BI0/IACCOUNT~0 has possibly degenerated
    ORACLE: Index /BI0/IPROFIT_CTR~0 has possibly degenerated     
    ORACLE: Index /BI0/SREQUID~0 has possibly degenerated
    ORACLE: Index /BIC/D1001072~010 has possibly degenerated
    ORACLE: Index /BIC/D1001132~010 has possibly degenerated
    ORACLE: Index /BIC/D1001212~010 has possibly degenerated
    ORACLE: Index /BIC/DGPCOGC062~01 has possibly degenerated
    ORACLE: Index /BIC/IGGRA_CODE~0 has possibly degenerated
    ORACLE: Index /BIC/QGMAPGP1~0 has possibly degenerated
    ORACLE: Index /BIC/QGMAPPC2~0 has possibly degenerated
    ORACLE: Index /BIC/SGMAPGP1~0 has possibly degenerated
    i don't know how to move further on this can any one tell me how to tackle this problem to increase the performance on Rollup of Aggregates (PCA Info cubes).
    every time i use to create index and statistics regularly to improve the performance it will work for couple of days and again the performance of the rollup of aggregates come down gradually.
    Thanks and Regards,
    Venkat

    hi,
    check in a sql client the sql created by Bi and the query that you use directy from your physical layer...
    The time between these 2 must be 2-3 seconds,otherwise you have problems.(these seconds are for scripts that needed by Bi)
    If you use "like" in your sql then forget indexes....
    For more informations about indexes check google or your Dba .
    Last, i mentioned that materialize view is not perfect,it help a lot..so why not try to split it to smaller ones....
    ex...
    logiacal dimensions
    year-half-day
    company-department
    fact
    quantity
    instead of making one...make 3,
    year - department - quantity
    half - department - quantity
    day - department - quantity
    and add them as datasource and assign them the appropriate logical level at bussiness layer in administrator...
    Do you use partioning functionality???
    i hope i helped....
    http://greekoraclebi.blogspot.com/
    ///////////////////////////////////////

  • Hi sap gurus can u plz improve the performance of my code --sneha

    // for the below program i have performance issue can any sap gurus can modify my code to improve the performance ,its very urgent  plz help me -
    sneha
    REPORT  ZFIR_GRIR_IPV
            NO STANDARD PAGE HEADING
            LINE-SIZE 120
            MESSAGE-ID ZFI02.
    TABLES: BSEG,BKPF.
    TYPES: BEGIN OF A_FINAL,
            BUKRS   TYPE CHAR12,
            HKONT_P TYPE CHAR18,
            GJAHR   TYPE CHAR11,
            BELNR   TYPE CHAR19,
            BUDAT   TYPE CHAR12,
            WAERS   TYPE CHAR8,
            XBLNR   TYPE CHAR20,
            BLART   TYPE CHAR13,
            MONAT   TYPE CHAR13,
            DMBTR_P TYPE CHAR13,
            KOSTL   TYPE CHAR11,
            PRCTR_P TYPE CHAR13,
            HKONT_G TYPE CHAR18,
            DMBTR_G TYPE CHAR13,
            PRCTR_G TYPE CHAR13,
            BUZID_G TYPE CHAR15,
            END OF A_FINAL.
    changes on 30 th may by dileep
    TYPES: BEGIN OF IT_FINAL,
            BUKRS   TYPE BUKRS ,
            HKONT TYPE HKONT,
            BELNR   TYPE BELNR_D,
            DMBTR TYPE DMBTR ,
            KOSTL   TYPE KOSTL,
            PRCTR TYPE PRCTR,
            END OF IT_FINAL.
    TYPES: BEGIN OF IT_FINAL1,
            BUKRS   TYPE BUKRS,
            HKONT TYPE HKONT,
            GJAHR   TYPE GJAHR ,
            BELNR   TYPE  BELNR_D,
            BUDAT   TYPE BUDAT,
            WAERS   TYPE WAERS ,
            XBLNR   TYPE XBLNR1,
            BLART   TYPE BLART,
            MONAT   TYPE MONAT,
            DMBTR TYPE DMBTR,
            KOSTL   TYPE KOSTL,
            PRCTR TYPE PRCTR,
             END OF IT_FINAL1.
    end of changes on 30 th may by dileep
    TYPES: BEGIN OF P_FINAL,
            BUKRS   TYPE CHAR12,
            DELIMITER_1         TYPE CHAR1,
            HKONT_P TYPE CHAR18,
             DELIMITER_2         TYPE CHAR1,
            GJAHR   TYPE CHAR11,
            DELIMITER_3         TYPE CHAR1,
            BELNR   TYPE CHAR19,
            DELIMITER_4         TYPE CHAR1,
            BUDAT   TYPE CHAR12,
            DELIMITER_5        TYPE CHAR1,
            WAERS   TYPE CHAR8,
            DELIMITER_6         TYPE CHAR1,
            XBLNR   TYPE CHAR20,
            DELIMITER_7         TYPE CHAR1,
            BLART   TYPE CHAR13,
            DELIMITER_8         TYPE CHAR1,
            MONAT   TYPE CHAR13,
            DELIMITER_9         TYPE CHAR1,
            DMBTR_P TYPE CHAR13,
            DELIMITER_10         TYPE CHAR1,
            KOSTL   TYPE CHAR11,
            DELIMITER_11         TYPE CHAR1,
            PRCTR_P TYPE CHAR13,
            DELIMITER_12         TYPE CHAR1,
            HKONT_G TYPE CHAR18,
            DELIMITER_13         TYPE CHAR1,
            DMBTR_G TYPE CHAR13,
            DELIMITER_14         TYPE CHAR1,
            PRCTR_G TYPE CHAR13,
            DELIMITER_15        TYPE CHAR1,
            BUZID_G TYPE CHAR15,
            END OF P_FINAL.
    DATA: IT_BSEG TYPE STANDARD TABLE OF IT_FINAL INITIAL SIZE 0,
          I_BSEG TYPE STANDARD TABLE OF IT_FINAL1 INITIAL SIZE 0,
          I_FINAL TYPE STANDARD TABLE OF A_FINAL INITIAL SIZE 0 WITH HEADER LINE,
          I_FINAL_P TYPE STANDARD TABLE OF P_FINAL INITIAL SIZE 0 WITH HEADER LINE,
          W_FINAL_P TYPE P_FINAL,
          W_BSEG1 TYPE BSEG,
          WA_BSEG TYPE IT_FINAL OCCURS 0 WITH HEADER LINE,
          W_BSEG TYPE IT_FINAL1 OCCURS 0 WITH HEADER LINE,
          T_BSEG TYPE STANDARD TABLE OF BSEG INITIAL SIZE 0 WITH HEADER LINE,
          W_FINAL TYPE A_FINAL,
          F_YEAR  TYPE  BAPI0002_4-FISCAL_YEAR,
          F_PERIOD  TYPE  BAPI0002_4-FISCAL_PERIOD,
          RETURN1 TYPE BAPIRETURN1,
          V_DATE        TYPE  CHAR8,               " Date in YYYYMMDD format
          V_PRESPATH    TYPE  STRING,              " Path
          V_APPPATH     TYPE  STRING,               " Path
          V_FILENAME(25) TYPE C,                    " File Name
          V_PERIOD      TYPE  CHAR3,                " Date for Posting Period
          V_FSYEAR      TYPE  BDATJ,                " Fiscal Year
          L_TEXT        TYPE  CHAR1.                " Hypen
    CONSTANTS:   C_TXT       TYPE    CHAR4    VALUE  '.txt',          " File Extension
                 C_TXT1      TYPE    STRING   VALUE  'txt',           " File Type
                 C_FLAG_X    TYPE    CHAR1    VALUE  'X',             " Flag
                 C_ASC       TYPE    FILETYPE VALUE  'ASC',           " File type
                 C_DAT       TYPE    CHAR4    VALUE  '.dat',          " File Type
                 C_FLAG_1    TYPE    CHAR1    VALUE  '1',             " Constant value
                 C_ZERO      TYPE    CHAR1    VALUE  '0',             " Constant
                 C_GLD(10)    TYPE    C        VALUE  'GRIR021S',       " Constant in file Path
                 C_DIR       TYPE    CHAR3    VALUE  'C:\',           " Presentation Server path
                 C_FLAG_12   TYPE    CHAR2    VALUE  '12',            " Constant value
                 C_PCFILE    TYPE    STRING   VALUE  'PC File',
                 C_DELIMITER TYPE    C        VALUE  '|'.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
    *--- Selection Criteria
    SELECT-OPTIONS: S_BUKRS  FOR    BSEG-BUKRS   DEFAULT '012T',       " Company Code
                    S_HKONT  FOR    BSEG-HKONT OBLIGATORY DEFAULT '4505001',
                    S_GJAHR  FOR    BKPF-GJAHR   DEFAULT SY-DATUM+0(4),
                    S_MONAT  FOR    BKPF-MONAT   DEFAULT SY-DATUM+4(2),
                    S_BELNR  FOR    BSEG-BELNR ,
                    S_BUDAT  FOR    BKPF-BUDAT ,
                    S_PRCTR  FOR    BSEG-PRCTR OBLIGATORY DEFAULT '12TOTH00',
                    S_BLART  FOR    BKPF-BLART   OBLIGATORY DEFAULT 'RE'.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
    *--- Radio Buttons for chose the PC Path or App.. Server Path
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS:
      RB_PFILE  RADIOBUTTON  GROUP RAD2 DEFAULT 'X' USER-COMMAND UCOMM1.
    SELECTION-SCREEN COMMENT 5(27) TEXT-002 FOR FIELD RB_PFILE.
    PARAMETERS:
      P_PFILE   LIKE     RLGRAP-FILENAME LOWER CASE.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS:
      RB_AFILE  RADIOBUTTON  GROUP RAD2.
    SELECTION-SCREEN COMMENT 5(27) TEXT-003 FOR FIELD RB_AFILE.
    PARAMETERS:
      P_AFILE   LIKE     RLGRAP-FILENAME LOWER CASE.  " Path for AS
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PFILE.
    *-- Select File name with Dialog Box
      PERFORM SUB_GET_FILENAME CHANGING P_PFILE.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_AFILE.
    *--- Attach F4 HELP CORRESPONDING TO THE FIELD
      PERFORM  SUB_AP_F4.
    AT SELECTION-SCREEN OUTPUT.
    *--Modify screen parameters
      PERFORM SUB_MODIFY_SCREEN.
    AT SELECTION-SCREEN.
    *--- Selection Screen validations for Company Code
      PERFORM SUB_VALIDATION_BUKRS.
    *--- Selection Screen validations for Chart of Accounts
      PERFORM SUB_VALIDATION_HKONT.
    *--- Selection Screen validations Fiscal Year
      PERFORM SUB_VALIDATION_GJAHR.
    *--- Selection Screen validations for Peiod
      PERFORM SUB_VALIDATION_MONAT.
    *--- Selection Screen validations for Company Code
      PERFORM SUB_VALIDATION_BELNR.
    *--- Selection Screen validations for Chart of Accounts
      PERFORM SUB_VALIDATION_BUDAT.
    *--- Selection Screen validations Fiscal Year
      PERFORM SUB_VALIDATION_PRCTR.
    *--- Selection Screen validations for Peiod
      PERFORM SUB_VALIDATION_BLART.
                            START-OF-SELECTION
    START-OF-SELECTION.
    *--- Check whether filepath/name have been entered in the sel screen
      PERFORM SUB_CHECK_FILEPATH.
    *--- Prepare Final Internal Table.
      PERFORM SUB_PREPARE_FINAL.
    *---  Download data.
      PERFORM SUB_DOWNLOAD_DATA .
    *&      Form  sub_get_filename
          text
         <--P_PFILE  Presentation server File name
    FORM SUB_GET_FILENAME  CHANGING P_FILE TYPE C.
      DATA :  L_FILENAME   TYPE STRING,                " For File Name
              L_PATH       TYPE STRING,                " For Directory
              L_FULLPATH   TYPE STRING.                " Full path
    *--- For File Open Dialog Box
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
        EXPORTING
          WINDOW_TITLE         = C_PCFILE              " Window Title
          DEFAULT_EXTENSION    = C_TXT1                " File Extn
          PROMPT_ON_OVERWRITE  = C_FLAG_X              " Over write
        CHANGING
          FILENAME             = L_FILENAME            " File Name
          PATH                 = L_PATH                " File Path
          FULLPATH             = L_FULLPATH            " Full Path
        EXCEPTIONS
          CNTL_ERROR           = 1
          ERROR_NO_GUI         = 2
          NOT_SUPPORTED_BY_GUI = 3
          OTHERS               = 4.
      IF SY-SUBRC NE 0.
    *--- Error in opening the file
        MESSAGE E000.
      ELSE.
        CONCATENATE L_PATH
                    L_FILENAME
               INTO P_FILE.
        V_PRESPATH  = L_PATH.
      ENDIF.
    ENDFORM.                    " sub_get_filename
    *&      Form  sub_ap_f4
          f4 help attched with application server
    FORM SUB_AP_F4 .
    *--- FM for to get the Application Server Path
      IF RB_AFILE = C_FLAG_X.
        CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
         EXPORTING
         DIRECTORY              =
           FILEMASK               = C_ASC                 " File Extn
        IMPORTING
           SERVERFILE             = P_AFILE               " File Path
        EXCEPTIONS
           CANCELED_BY_USER       = 1
           OTHERS                 = 2.
        IF SY-SUBRC NE 0.
    *--- Error in opening the file
          MESSAGE E000.
        ENDIF.
      ENDIF.
    ENDFORM.                                                    " sub_ap_f4
    *&      Form  sub_modify_screen
          text
    -->  p1        text
    <--  p2        text
    FORM SUB_MODIFY_SCREEN .
    *--- Selection screen Modifications
      IF RB_PFILE = C_FLAG_X.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'P_PFILE' OR
             SCREEN-NAME = '%_P_PFILE_%_APP_%-TEXT'.
            SCREEN-ACTIVE = C_FLAG_1.
            CONCATENATE C_DIR C_GLD V_DATE SY-UZEIT(4) C_TXT INTO P_PFILE.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'P_PFILE' OR
             SCREEN-NAME = '%_P_PFILE_%_APP_%-TEXT'.
            SCREEN-ACTIVE = C_ZERO.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
      IF RB_AFILE = C_FLAG_X.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'P_AFILE' OR
             SCREEN-NAME = '%_P_AFILE_%_APP_%-TEXT'.
            SCREEN-ACTIVE = C_FLAG_1.
            CONCATENATE '/Solectron/Data/' C_GLD V_DATE SY-UZEIT(4) C_DAT
                          INTO P_AFILE.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'P_AFILE' OR
             SCREEN-NAME = '%_P_AFILE_%_APP_%-TEXT'.
            SCREEN-ACTIVE = C_ZERO.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
      IF RB_PFILE = C_FLAG_X.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'P_PFILE'.
            SCREEN-ACTIVE = C_FLAG_1.
          ENDIF.
          IF SCREEN-NAME = 'P_AFILE'.
            SCREEN-ACTIVE = C_ZERO.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ELSEIF RB_AFILE = C_FLAG_X.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'P_PFILE'.
            SCREEN-ACTIVE = C_ZERO.
          ENDIF.
          IF SCREEN-NAME = 'P_AFILE'.
            SCREEN-ACTIVE = C_FLAG_1.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " sub_modify_screen
    *&      Form  sub_validation_bukrs
          Validation For Company Code
    FORM SUB_VALIDATION_BUKRS .
      DATA: L_BUKRS  TYPE  BUKRS.                " Company Code
      IF S_BUKRS IS NOT INITIAL.
        IF S_BUKRS-HIGH IS NOT INITIAL AND S_BUKRS-LOW IS INITIAL.
          MESSAGE E006.
        ELSE.
    *--- Validation for chart of accounts
          SELECT BUKRS                              " Company Code
          FROM T001 UP TO 1 ROWS
          INTO L_BUKRS
          WHERE BUKRS IN S_BUKRS.
          ENDSELECT.
          IF SY-SUBRC  NE  0.
    *--- Invalid Company code
            MESSAGE E001.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    " sub_validation_bukrs
    *&      Form  sub_validation_hkont
          Validation For General Ledger Account
    FORM SUB_VALIDATION_HKONT .
      DATA: L_HKONT  TYPE HKONT.                " General Ledger Account
      IF S_HKONT IS INITIAL.
        MESSAGE E002.
      ELSE.
        IF S_HKONT-HIGH IS NOT INITIAL AND S_HKONT-LOW IS INITIAL.
          MESSAGE E006.
        ELSE.
    *--- Validation for chart of accounts
          SELECT SAKNR                             " General Ledger Account
          FROM SKA1 UP TO 1 ROWS
          INTO L_HKONT
          WHERE SAKNR IN S_HKONT AND KTOPL = '1SLR'.
          ENDSELECT.
          IF SY-SUBRC  NE  0.
    *--- Invalid General Ledger Account
            MESSAGE E003.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    " sub_validation_hkont
    *&      Form  sub_validation_gjahr
          Validation For Fiscal Year
    FORM SUB_VALIDATION_GJAHR .
      DATA: L_GJAHR  TYPE  GJAHR.                " Fiscal Year
      IF S_GJAHR IS NOT INITIAL.
        IF S_GJAHR-HIGH IS NOT INITIAL AND S_GJAHR-LOW IS INITIAL.
          MESSAGE E006.
        ENDIF.
      ENDIF.
    ENDFORM.                    " sub_validation_gjahr
    *&      Form  sub_validation_monat
          Validation For Fiscal period
    FORM SUB_VALIDATION_MONAT .
      DATA: L_MONAT  TYPE  MONAT.                " Fiscal period
      IF S_MONAT IS NOT INITIAL.
        IF S_MONAT-LOW LE C_ZERO.
    *--- Invalid Fiscal Period
          MESSAGE E006.
        ENDIF.
        IF S_MONAT-HIGH GT C_FLAG_12.
    *--- Invalid Fiscal Period
          MESSAGE E007.
        ENDIF.
      ENDIF.
    ENDFORM.                    " sub_validation_monat
    *&      Form  sub_validation_belnr
          Validation For Accounting Document Number
    FORM SUB_VALIDATION_BELNR .
      DATA: L_BELNR  TYPE BELNR_D.                " Accounting Document Number
      IF S_BELNR IS NOT INITIAL.
        IF S_BELNR-HIGH IS NOT INITIAL AND S_BELNR-LOW IS INITIAL.
          MESSAGE E006.
        ENDIF.
      ENDIF.
    ENDFORM.                    " sub_validation_belnr
    *&      Form  sub_validation_budat
          Validation For Posting Date
    FORM SUB_VALIDATION_BUDAT .
      DATA: L_BUDAT  TYPE  BUDAT.                " Posting Date
      IF S_BUDAT IS NOT INITIAL.
        IF S_BUDAT-HIGH IS NOT INITIAL AND S_BUDAT-LOW IS INITIAL.
          MESSAGE E006.
        ENDIF.
      ENDIF.
    ENDFORM.                    " sub_validation_budat
    *&      Form  sub_validation_prctr
          Validation For Profit Center
    FORM SUB_VALIDATION_PRCTR .
      DATA: L_PRCTR  TYPE  PRCTR.                " Profit Center
      IF S_PRCTR IS INITIAL.
        MESSAGE E010.
      ELSE.
        IF S_PRCTR-HIGH IS NOT INITIAL AND S_PRCTR-LOW IS INITIAL.
          MESSAGE E006.
        ELSE.
    *--- Validation for chart of accounts
          SELECT PRCTR                             " Profit Center
          FROM CEPC UP TO 1 ROWS
          INTO L_PRCTR
          WHERE PRCTR IN S_PRCTR.
          ENDSELECT.
          IF SY-SUBRC  NE  0.
    *--- Invalid Profit Center
            MESSAGE E011.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    " sub_validation_prctr
    *&      Form  sub_validation_blart
          Validation For Document type
    FORM SUB_VALIDATION_BLART .
      DATA: L_BLART  TYPE  BLART.                " Document type
      IF S_BLART IS INITIAL.
        MESSAGE E012.
      ELSE.
        IF S_BLART-HIGH IS NOT INITIAL AND S_BLART-LOW IS INITIAL.
          MESSAGE E006.
        ENDIF.
      ENDIF.
    ENDFORM.                    " sub_validation_blart
    *&      Form  sub_check_filepath
          Check user input for initial filename
    FORM SUB_CHECK_FILEPATH .
      IF RB_PFILE = C_FLAG_X.
        IF P_PFILE IS INITIAL.
    *--- The Local File Path can not be Empty
          MESSAGE I014.
          LEAVE LIST-PROCESSING.
        ENDIF.
      ELSEIF RB_AFILE = C_FLAG_X.
        IF P_AFILE IS INITIAL.
    *--- The App Server File Path can not be Empty
          MESSAGE I015.
          LEAVE LIST-PROCESSING.
        ENDIF.
      ENDIF.
    ENDFORM.                    " sub_check_filepath
    *&      Form  sub_prepare_final
          append the required output data in to the internal table.
    FORM SUB_PREPARE_FINAL.
    changes on 30 th may by dileep
    SELECT * FROM BSEG INTO TABLE I_BSEG WHERE HKONT IN S_HKONT AND  "G/L Account
                                                GJAHR IN S_GJAHR AND
                                                PRCTR IN S_PRCTR AND  "Profit Center
                                                BLART IN S_BLART .  "Document Type
      SELECT BUKRS
             HKONT
             BELNR
             DMBTR
             KOSTL
             PRCTR
             FROM BSEG INTO TABLE IT_BSEG WHERE HKONT IN S_HKONT AND  "G/L Account
                                                PRCTR IN S_PRCTR.  "Profit Center
      LOOP AT IT_BSEG INTO WA_BSEG.
        SELECT SINGLE GJAHR
               BUDAT
               WAERS
               XBLNR
               BLART
               MONAT
               INTO (W_BSEG-GJAHR,W_BSEG-BUDAT,W_BSEG-WAERS,W_BSEG-XBLNR,W_BSEG-BLART,W_BSEG-MONAT)
                 FROM BKPF WHERE BELNR = W_BSEG-BELNR AND
                       GJAHR IN S_GJAHR AND
                       BLART IN S_BLART .  "Document Type
        MOVE WA_BSEG-BUKRS TO W_BSEG-BUKRS.
        MOVE WA_BSEG-HKONT TO W_BSEG-HKONT.
        MOVE WA_BSEG-BELNR TO W_BSEG-BELNR.
        MOVE WA_BSEG-DMBTR TO W_BSEG-DMBTR.
        MOVE WA_BSEG-KOSTL TO W_BSEG-KOSTL.
        MOVE WA_BSEG-PRCTR TO W_BSEG-PRCTR.
        APPEND W_BSEG TO I_BSEG.
      ENDLOOP.
    changes on 30 th may by dileep
      IF S_BUKRS IS NOT INITIAL.
        SORT I_BSEG BY BUKRS ASCENDING.
        DELETE I_BSEG WHERE NOT BUKRS IN S_BUKRS.
      ENDIF.
      IF S_MONAT IS NOT INITIAL.
        SORT I_BSEG BY GJAHR MONAT ASCENDING.
        IF S_MONAT-HIGH IS NOT INITIAL AND S_MONAT-LOW IS NOT INITIAL.
          DELETE I_BSEG WHERE MONAT < S_MONAT-LOW OR MONAT > S_MONAT-HIGH.
        ENDIF.
        IF S_MONAT-HIGH IS INITIAL AND S_MONAT-LOW IS NOT INITIAL.
          DELETE I_BSEG WHERE MONAT NE S_MONAT-LOW.
        ENDIF.
      ENDIF.
      IF S_BELNR IS NOT INITIAL.
        SORT I_BSEG BY BELNR ASCENDING.
        DELETE I_BSEG WHERE NOT BELNR IN S_BELNR.
      ENDIF.
      IF S_BUDAT IS NOT INITIAL.
        SORT I_BSEG BY BUDAT ASCENDING.
        DELETE I_BSEG WHERE NOT BUDAT IN S_BUDAT.
      ENDIF.
      LOOP AT I_BSEG INTO W_BSEG.
        MOVE W_BSEG-BUKRS      TO W_FINAL-BUKRS.
        MOVE W_BSEG-HKONT      TO W_FINAL-HKONT_P.
        MOVE W_BSEG-GJAHR      TO W_FINAL-GJAHR.
        MOVE W_BSEG-BELNR      TO W_FINAL-BELNR.
        MOVE W_BSEG-BUDAT      TO W_FINAL-BUDAT.
        MOVE W_BSEG-WAERS      TO W_FINAL-WAERS.
        MOVE W_BSEG-XBLNR      TO W_FINAL-XBLNR.
        MOVE W_BSEG-BLART      TO W_FINAL-BLART.
        MOVE W_BSEG-MONAT      TO W_FINAL-MONAT.
        MOVE W_BSEG-DMBTR      TO W_FINAL-DMBTR_P.
        MOVE W_BSEG-KOSTL      TO W_FINAL-KOSTL.
        MOVE W_BSEG-PRCTR      TO W_FINAL-PRCTR_P.
        SELECT SINGLE * FROM BSEG INTO W_BSEG1 WHERE BELNR = W_BSEG-BELNR AND    "Document Type
                                              BUZID = 'W' .
        IF SY-SUBRC = 0.
          MOVE W_BSEG1-HKONT      TO W_FINAL-HKONT_G.
          MOVE W_BSEG1-DMBTR      TO W_FINAL-DMBTR_G.
          MOVE W_BSEG1-PRCTR      TO W_FINAL-PRCTR_G.
          MOVE W_BSEG1-BUZID      TO W_FINAL-BUZID_G.
        ELSE.
          EXIT.
        ENDIF.
        APPEND W_FINAL TO I_FINAL.
        SORT I_FINAL BY BELNR ASCENDING.
      ENDLOOP.
    ENDFORM.                  " sub_prepare_final
    *&      Form  sub_download_data
          Download data
    FORM SUB_DOWNLOAD_DATA .
      DATA : V_PRD(2) TYPE N.
      IF RB_PFILE = C_FLAG_X.
    *--- Downloading To presentation server
        V_PRESPATH = P_PFILE.
        PERFORM SUB_DOWNLOAD_PRESSERVER.
      ELSEIF RB_AFILE = C_FLAG_X.
    *--- Downloading To Application server in Auto Mode
        V_APPPATH = P_AFILE.
        PERFORM SUB_DOWNLOAD_APPSERVER.
      ENDIF.
    ENDFORM.                    " sub_download_data
    *&      Form  sub_download_presserver
          text
    FORM SUB_DOWNLOAD_PRESSERVER.
      DATA: MESSAGE TYPE STRING.
      IF I_FINAL[] IS INITIAL.
        MESSAGE I016.
        EXIT.
      ELSE.
        W_FINAL_P-BUKRS = 'Company Code'.
        W_FINAL_P-DELIMITER_1 = '|'.
        W_FINAL_P-HKONT_P = 'G/L Account Number'.
        W_FINAL_P-DELIMITER_2 = '|'.
        W_FINAL_P-GJAHR = 'Fiscal Year'.
        W_FINAL_P-DELIMITER_3 = '|'.
        W_FINAL_P-BELNR = 'A/c Document Number'.
        W_FINAL_P-DELIMITER_4 = '|'.
        W_FINAL_P-BUDAT  = 'Posting Date' .
        W_FINAL_P-DELIMITER_5 = '|'.
        W_FINAL_P-WAERS = 'Currency'.
        W_FINAL_P-DELIMITER_6 = '|'.
        W_FINAL_P-XBLNR = 'Ref. Document Number'.
        W_FINAL_P-DELIMITER_7 = '|'.
        W_FINAL_P-BLART = 'Document Type'.
        W_FINAL_P-DELIMITER_8 = '|'.
        W_FINAL_P-MONAT = 'Fiscal Period'.
        W_FINAL_P-DELIMITER_9 = '|'.
        W_FINAL_P-DMBTR_P = 'Amount'.
        W_FINAL_P-DELIMITER_10 = '|'.
        W_FINAL_P-KOSTL = 'Cost Center'.
        W_FINAL_P-DELIMITER_11 = '|'.
        W_FINAL_P-PRCTR_P = 'Profit Center'.
        W_FINAL_P-DELIMITER_12 = '|'.
        W_FINAL_P-HKONT_G = 'G/L Account Number'.
        W_FINAL_P-DELIMITER_13 = '|'.
        W_FINAL_P-DMBTR_G = 'Amount'.
        W_FINAL_P-DELIMITER_14 = '|'.
        W_FINAL_P-PRCTR_G = 'Profit Center'.
        W_FINAL_P-DELIMITER_15 = '|'.
        W_FINAL_P-BUZID_G = 'Line Item Id'.
        APPEND W_FINAL_P TO I_FINAL_P.
        LOOP AT I_FINAL INTO W_FINAL.
          W_FINAL_P-BUKRS = W_FINAL-BUKRS.
          W_FINAL_P-DELIMITER_1 = '|'.
          W_FINAL_P-HKONT_P = W_FINAL-HKONT_P.
          W_FINAL_P-DELIMITER_2 = '|'.
          W_FINAL_P-GJAHR = W_FINAL-GJAHR.
          W_FINAL_P-DELIMITER_3 = '|'.
          W_FINAL_P-BELNR = W_FINAL-BELNR.
          W_FINAL_P-DELIMITER_4 = '|'.
          W_FINAL_P-BUDAT  = W_FINAL-BUDAT .
          W_FINAL_P-DELIMITER_5 = '|'.
          W_FINAL_P-WAERS = W_FINAL-WAERS.
          W_FINAL_P-DELIMITER_6 = '|'.
          W_FINAL_P-XBLNR = W_FINAL-XBLNR.
          W_FINAL_P-DELIMITER_7 = '|'.
          W_FINAL_P-BLART = W_FINAL-BLART.
          W_FINAL_P-DELIMITER_8 = '|'.
          W_FINAL_P-MONAT = W_FINAL-MONAT.
          W_FINAL_P-DELIMITER_9 = '|'.
          W_FINAL_P-DMBTR_P = W_FINAL-DMBTR_P.
          W_FINAL_P-DELIMITER_10 = '|'.
          W_FINAL_P-KOSTL = W_FINAL-KOSTL.
          W_FINAL_P-DELIMITER_11 = '|'.
          W_FINAL_P-PRCTR_P = W_FINAL-PRCTR_P.
          W_FINAL_P-DELIMITER_12 = '|'.
          W_FINAL_P-HKONT_G = W_FINAL-HKONT_G.
          W_FINAL_P-DELIMITER_13 = '|'.
          W_FINAL_P-DMBTR_G = W_FINAL-DMBTR_G.
          W_FINAL_P-DELIMITER_14 = '|'.
          W_FINAL_P-PRCTR_G = W_FINAL-PRCTR_G.
          W_FINAL_P-DELIMITER_15 = '|'.
          W_FINAL_P-BUZID_G = W_FINAL-BUZID_G.
          APPEND W_FINAL_P TO I_FINAL_P.
          CLEAR : W_FINAL_P, W_FINAL.
        ENDLOOP.
      ENDIF.
    *---Downloading data to file on Presentation Server
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                = V_PRESPATH
          FILETYPE                = 'ASC'
        TABLES
          DATA_TAB                = I_FINAL_P
        EXCEPTIONS
          FILE_WRITE_ERROR        = 1
          NO_BATCH                = 2
          GUI_REFUSE_FILETRANSFER = 3
          INVALID_TYPE            = 4
          NO_AUTHORITY            = 5
          UNKNOWN_ERROR           = 6
          HEADER_NOT_ALLOWED      = 7
          SEPARATOR_NOT_ALLOWED   = 8
          FILESIZE_NOT_ALLOWED    = 9
          HEADER_TOO_LONG         = 10
          DP_ERROR_CREATE         = 11
          DP_ERROR_SEND           = 12
          DP_ERROR_WRITE          = 13
          UNKNOWN_DP_ERROR        = 14
          ACCESS_DENIED           = 15
          DP_OUT_OF_MEMORY        = 16
          DISK_FULL               = 17
          DP_TIMEOUT              = 18
          FILE_NOT_FOUND          = 19
          DATAPROVIDER_EXCEPTION  = 20
          CONTROL_FLUSH_ERROR     = 21
          OTHERS                  = 22.
    *-- File can not be opened successfully
      IF SY-SUBRC NE 0.
        IF SY-BATCH EQ C_FLAG_X. " Stop Processing
          MESSAGE E017.        " File could not be opened
        ELSE.
          MESSAGE I017.        " File could not be opened
          LEAVE LIST-PROCESSING.
        ENDIF.
      ELSE.
        CONCATENATE 'Data Successfully downloaded to the Specified Location' V_PRESPATH INTO MESSAGE SEPARATED BY SPACE.
        MESSAGE MESSAGE TYPE 'S'.
      ENDIF.
      MODIFY SCREEN.
    ENDFORM.                    " sub_download_presserver
    *&      Form  sub_download_appserver
          text
    FORM SUB_DOWNLOAD_APPSERVER .
      DATA: V_FILE        TYPE  STRING,               " String
            P_DMBTR  TYPE  CHAR20,
            G_DMBTR  TYPE  CHAR20,
            MESSAGE1 TYPE STRING.
      IF I_FINAL[] IS INITIAL.
        IF SY-BATCH EQ C_FLAG_X.
    *--- File contains no data
          MESSAGE E016 .
        ELSE.
    *--- File contains no data
          MESSAGE I016 .
          LEAVE LIST-PROCESSING.
        ENDIF.
      ENDIF.
    *--- To Open The file in Application Server
      OPEN DATASET V_APPPATH FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      IF SY-SUBRC NE 0.
    *--- Display error message: "Could not open file"
        IF SY-BATCH EQ C_FLAG_X.
    *--- File contains no data
          MESSAGE E016 .
        ELSE.
    *--- File contains no data
          MESSAGE I016 .
          LEAVE LIST-PROCESSING.
        ENDIF.
      ENDIF.
    *--- Perform for building the Report header
      CONCATENATE
                 'COMPANY_CODE'
                 'G/L_ACCOUNT_NUMBER'
                 'FISCAL_YEAR'
                 'A/C_DOCUMENT_NUMBER'
                 'POSTING_DATE'
                 'CURRENCY'
                 'REF_DOCUMENT_NUMBER'
                 'DOCUMENT_TYPE'
                 'FISCAL_PERIOD'
                 'AMOUNT'
                 'COSTCENTER'
                 'PROFIT_CENTER'
                 'G/L_ACCOUNT_NUMBER'
                 'AMOUNT'
                 'PROFIT_CENTER'
                 'LINE_ITEM_ID'
                INTO V_FILE SEPARATED BY C_DELIMITER.
      TRANSFER V_FILE TO V_APPPATH.
    *--- Transfer the data to application Server
      LOOP AT I_FINAL INTO W_FINAL.
        P_DMBTR =  W_FINAL-DMBTR_P.
        G_DMBTR =  W_FINAL-DMBTR_G.
        CONCATENATE
                 W_FINAL-BUKRS
                 W_FINAL-HKONT_P
                 W_FINAL-GJAHR
                 W_FINAL-BELNR
                 W_FINAL-BUDAT
                 W_FINAL-WAERS
                 W_FINAL-XBLNR
                 W_FINAL-BLART
                 W_FINAL-MONAT
                 P_DMBTR
                 W_FINAL-KOSTL
                 W_FINAL-PRCTR_P
                 W_FINAL-HKONT_G
                 G_DMBTR
                 W_FINAL-PRCTR_G
                 W_FINAL-BUZID_G
              INTO V_FILE SEPARATED BY C_DELIMITER.
        TRANSFER V_FILE TO V_APPPATH.
        IF SY-SUBRC NE 0.
    Display error message: "Data could not be written at the location"
          MESSAGE 'Data could not be written at the location' TYPE 'I'.
          EXIT.
        ENDIF.
        CLEAR V_FILE.
      ENDLOOP.
      CLOSE DATASET V_APPPATH.
      IF SY-SUBRC NE 0.
    Display error message: "File could not be closed"
        MESSAGE 'File could not be closed' TYPE 'I'.
        EXIT.
      ELSE.
        CONCATENATE 'Data Successfully downloaded to the Specified Location' V_APPPATH INTO MESSAGE1 SEPARATED BY SPACE.
        MESSAGE MESSAGE1 TYPE 'S'.
      ENDIF.
    ENDFORM.                    " sub_download_appserver

    hi,
    here is improved code.
    REPORT ZFIR_GRIR_IPV
    NO STANDARD PAGE HEADING
    LINE-SIZE 120
    MESSAGE-ID ZFI02.
    TABLES: BSEG,BKPF.
    TYPES: BEGIN OF A_FINAL,
    BUKRS TYPE CHAR12,
    HKONT_P TYPE CHAR18,
    GJAHR TYPE CHAR11,
    BELNR TYPE CHAR19,
    BUDAT TYPE CHAR12,
    WAERS TYPE CHAR8,
    XBLNR TYPE CHAR20,
    BLART TYPE CHAR13,
    MONAT TYPE CHAR13,
    DMBTR_P TYPE CHAR13,
    KOSTL TYPE CHAR11,
    PRCTR_P TYPE CHAR13,
    HKONT_G TYPE CHAR18,
    DMBTR_G TYPE CHAR13,
    PRCTR_G TYPE CHAR13,
    BUZID_G TYPE CHAR15,
    END OF A_FINAL.
    changes on 30 th may by dileep
    TYPES: BEGIN OF IT_FINAL,
    BUKRS TYPE BUKRS ,
    HKONT TYPE HKONT,
    BELNR TYPE BELNR_D,
    DMBTR TYPE DMBTR ,
    KOSTL TYPE KOSTL,
    PRCTR TYPE PRCTR,
    END OF IT_FINAL.
    TYPES: BEGIN OF IT_FINAL1,
    BUKRS TYPE BUKRS,
    HKONT TYPE HKONT,
    GJAHR TYPE GJAHR ,
    BELNR TYPE BELNR_D,
    BUDAT TYPE BUDAT,
    WAERS TYPE WAERS ,
    XBLNR TYPE XBLNR1,
    BLART TYPE BLART,
    MONAT TYPE MONAT,
    DMBTR TYPE DMBTR,
    KOSTL TYPE KOSTL,
    PRCTR TYPE PRCTR,
    END OF IT_FINAL1.
    end of changes on 30 th may by dileep
    TYPES: BEGIN OF P_FINAL,
    BUKRS TYPE CHAR12,
    DELIMITER_1 TYPE CHAR1,
    HKONT_P TYPE CHAR18,
    DELIMITER_2 TYPE CHAR1,
    GJAHR TYPE CHAR11,
    DELIMITER_3 TYPE CHAR1,
    BELNR TYPE CHAR19,
    DELIMITER_4 TYPE CHAR1,
    BUDAT TYPE CHAR12,
    DELIMITER_5 TYPE CHAR1,
    WAERS TYPE CHAR8,
    DELIMITER_6 TYPE CHAR1,
    XBLNR TYPE CHAR20,
    DELIMITER_7 TYPE CHAR1,
    BLART TYPE CHAR13,
    DELIMITER_8 TYPE CHAR1,
    MONAT TYPE CHAR13,
    DELIMITER_9 TYPE CHAR1,
    DMBTR_P TYPE CHAR13,
    DELIMITER_10 TYPE CHAR1,
    KOSTL TYPE CHAR11,
    DELIMITER_11 TYPE CHAR1,
    PRCTR_P TYPE CHAR13,
    DELIMITER_12 TYPE CHAR1,
    HKONT_G TYPE CHAR18,
    DELIMITER_13 TYPE CHAR1,
    DMBTR_G TYPE CHAR13,
    DELIMITER_14 TYPE CHAR1,
    PRCTR_G TYPE CHAR13,
    DELIMITER_15 TYPE CHAR1,
    BUZID_G TYPE CHAR15,
    END OF P_FINAL.
    DATA: IT_BSEG TYPE STANDARD TABLE OF IT_FINAL INITIAL SIZE 0,
    I_BSEG TYPE STANDARD TABLE OF IT_FINAL1 INITIAL SIZE 0,
    I_FINAL TYPE STANDARD TABLE OF A_FINAL INITIAL SIZE 0 WITH HEADER LINE,
    I_FINAL_P TYPE STANDARD TABLE OF P_FINAL INITIAL SIZE 0 WITH HEADER LINE,
    W_FINAL_P TYPE P_FINAL,
    W_BSEG1 TYPE BSEG,
    WA_BSEG TYPE IT_FINAL OCCURS 0 WITH HEADER LINE,
    W_BSEG TYPE IT_FINAL1 OCCURS 0 WITH HEADER LINE,
    T_BSEG TYPE STANDARD TABLE OF BSEG INITIAL SIZE 0 WITH HEADER LINE,
    W_FINAL TYPE A_FINAL,
    F_YEAR TYPE BAPI0002_4-FISCAL_YEAR,
    F_PERIOD TYPE BAPI0002_4-FISCAL_PERIOD,
    RETURN1 TYPE BAPIRETURN1,
    V_DATE TYPE CHAR8, " Date in YYYYMMDD format
    V_PRESPATH TYPE STRING, " Path
    V_APPPATH TYPE STRING, " Path
    V_FILENAME(25) TYPE C, " File Name
    V_PERIOD TYPE CHAR3, " Date for Posting Period
    V_FSYEAR TYPE BDATJ, " Fiscal Year
    L_TEXT TYPE CHAR1. " Hypen
    CONSTANTS: C_TXT TYPE CHAR4 VALUE '.txt', " File Extension
    C_TXT1 TYPE STRING VALUE 'txt', " File Type
    C_FLAG_X TYPE CHAR1 VALUE 'X', " Flag
    C_ASC TYPE FILETYPE VALUE 'ASC', " File type
    C_DAT TYPE CHAR4 VALUE '.dat', " File Type
    C_FLAG_1 TYPE CHAR1 VALUE '1', " Constant value
    C_ZERO TYPE CHAR1 VALUE '0', " Constant
    C_GLD(10) TYPE C VALUE 'GRIR021S', " Constant in file Path
    C_DIR TYPE CHAR3 VALUE 'C:\', " Presentation Server path
    C_FLAG_12 TYPE CHAR2 VALUE '12', " Constant value
    C_PCFILE TYPE STRING VALUE 'PC File',
    C_DELIMITER TYPE C VALUE '|'.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
              o
                    +
    Selection Criteria
    SELECT-OPTIONS: S_BUKRS FOR BSEG-BUKRS DEFAULT '012T', " Company Code
    S_HKONT FOR BSEG-HKONT OBLIGATORY DEFAULT '4505001',
    S_GJAHR FOR BKPF-GJAHR DEFAULT SY-DATUM+0(4),
    S_MONAT FOR BKPF-MONAT DEFAULT SY-DATUM+4(2),
    S_BELNR FOR BSEG-BELNR ,
    S_BUDAT FOR BKPF-BUDAT ,
    S_PRCTR FOR BSEG-PRCTR OBLIGATORY DEFAULT '12TOTH00',
    S_BLART FOR BKPF-BLART OBLIGATORY DEFAULT 'RE'.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
              o
                    +
    Radio Buttons for chose the PC Path or App.. Server Path
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS:
    RB_PFILE RADIOBUTTON GROUP RAD2 DEFAULT 'X' USER-COMMAND UCOMM1.
    SELECTION-SCREEN COMMENT 5(27) TEXT-002 FOR FIELD RB_PFILE.
    PARAMETERS:
    P_PFILE LIKE RLGRAP-FILENAME LOWER CASE.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS:
    RB_AFILE RADIOBUTTON GROUP RAD2.
    SELECTION-SCREEN COMMENT 5(27) TEXT-003 FOR FIELD RB_AFILE.
    PARAMETERS:
    P_AFILE LIKE RLGRAP-FILENAME LOWER CASE. " Path for AS
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PFILE.
              o
                    + Select File name with Dialog Box
    PERFORM SUB_GET_FILENAME CHANGING P_PFILE.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_AFILE.
              o
                    +
    Attach F4 HELP CORRESPONDING TO THE FIELD
    PERFORM SUB_AP_F4.
    AT SELECTION-SCREEN OUTPUT.
    *--Modify screen parameters
    PERFORM SUB_MODIFY_SCREEN.
    AT SELECTION-SCREEN.
              o
                    +
    Selection Screen validations for Company Code
    PERFORM SUB_VALIDATION_BUKRS.
              o
                    +
    Selection Screen validations for Chart of Accounts
    PERFORM SUB_VALIDATION_HKONT.
              o
                    +
    Selection Screen validations Fiscal Year
    PERFORM SUB_VALIDATION_GJAHR.
              o
                    +
    Selection Screen validations for Peiod
    PERFORM SUB_VALIDATION_MONAT.
              o
                    +
    Selection Screen validations for Company Code
    PERFORM SUB_VALIDATION_BELNR.
              o
                    +
    Selection Screen validations for Chart of Accounts
    PERFORM SUB_VALIDATION_BUDAT.
              o
                    +
    Selection Screen validations Fiscal Year
    PERFORM SUB_VALIDATION_PRCTR.
              o
                    +
    Selection Screen validations for Peiod
    PERFORM SUB_VALIDATION_BLART.
    START-OF-SELECTION
    START-OF-SELECTION.
              o
                    +
    Check whether filepath/name have been entered in the sel screen
    PERFORM SUB_CHECK_FILEPATH.
              o
                    +
    Prepare Final Internal Table.
    PERFORM SUB_PREPARE_FINAL.
              o
                    +
    Download data.
    PERFORM SUB_DOWNLOAD_DATA .
    *& Form sub_get_filename
    text
    <--P_PFILE Presentation server File name
    FORM SUB_GET_FILENAME CHANGING P_FILE TYPE C.
    DATA : L_FILENAME TYPE STRING, " For File Name
    L_PATH TYPE STRING, " For Directory
    L_FULLPATH TYPE STRING. " Full path
              o
                    +
    For File Open Dialog Box
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
    EXPORTING
    WINDOW_TITLE = C_PCFILE " Window Title
    DEFAULT_EXTENSION = C_TXT1 " File Extn
    PROMPT_ON_OVERWRITE = C_FLAG_X " Over write
    CHANGING
    FILENAME = L_FILENAME " File Name
    PATH = L_PATH " File Path
    FULLPATH = L_FULLPATH " Full Path
    EXCEPTIONS
    CNTL_ERROR = 1
    ERROR_NO_GUI = 2
    NOT_SUPPORTED_BY_GUI = 3
    OTHERS = 4.
    IF SY-SUBRC NE 0.
              o
                    +
    Error in opening the file
    MESSAGE E000.
    ELSE.
    CONCATENATE L_PATH
    L_FILENAME
    INTO P_FILE.
    V_PRESPATH = L_PATH.
    ENDIF.
    ENDFORM. " sub_get_filename
    *& Form sub_ap_f4
    f4 help attched with application server
    FORM SUB_AP_F4 .
              o
                    +
    FM for to get the Application Server Path
    IF RB_AFILE = C_FLAG_X.
    CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
    EXPORTING
    DIRECTORY =
    FILEMASK = C_ASC " File Extn
    IMPORTING
    SERVERFILE = P_AFILE " File Path
    EXCEPTIONS
    CANCELED_BY_USER = 1
    OTHERS = 2.
    IF SY-SUBRC NE 0.
              o
                    +
    Error in opening the file
    MESSAGE E000.
    ENDIF.
    ENDIF.
    ENDFORM. " sub_ap_f4
    *& Form sub_modify_screen
    text
    --> p1 text
    <-- p2 text
    FORM SUB_MODIFY_SCREEN .
              o
                    +
    Selection screen Modifications
    IF RB_PFILE = C_FLAG_X.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'P_PFILE' OR
    SCREEN-NAME = '%_P_PFILE_%_APP_%-TEXT'.
    SCREEN-ACTIVE = C_FLAG_1.
    CONCATENATE C_DIR C_GLD V_DATE SY-UZEIT(4) C_TXT INTO P_PFILE.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ELSE.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'P_PFILE' OR
    SCREEN-NAME = '%_P_PFILE_%_APP_%-TEXT'.
    SCREEN-ACTIVE = C_ZERO.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    IF RB_AFILE = C_FLAG_X.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'P_AFILE' OR
    SCREEN-NAME = '%_P_AFILE_%_APP_%-TEXT'.
    SCREEN-ACTIVE = C_FLAG_1.
    CONCATENATE '/Solectron/Data/' C_GLD V_DATE SY-UZEIT(4) C_DAT
    INTO P_AFILE.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ELSE.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'P_AFILE' OR
    SCREEN-NAME = '%_P_AFILE_%_APP_%-TEXT'.
    SCREEN-ACTIVE = C_ZERO.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    IF RB_PFILE = C_FLAG_X.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'P_PFILE'.
    SCREEN-ACTIVE = C_FLAG_1.
    ENDIF.
    IF SCREEN-NAME = 'P_AFILE'.
    SCREEN-ACTIVE = C_ZERO.
    ENDIF.
    MODIFY SCREEN.
    ENDLOOP.
    ELSEIF RB_AFILE = C_FLAG_X.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'P_PFILE'.
    SCREEN-ACTIVE = C_ZERO.
    ENDIF.
    IF SCREEN-NAME = 'P_AFILE'.
    SCREEN-ACTIVE = C_FLAG_1.
    ENDIF.
    MODIFY SCREEN.
    ENDLOOP.
    ENDIF.
    ENDFORM. " sub_modify_screen
    *& Form sub_validation_bukrs
    Validation For Company Code
    FORM SUB_VALIDATION_BUKRS .
    DATA: L_BUKRS TYPE BUKRS. " Company Code
    IF S_BUKRS IS NOT INITIAL.
    IF S_BUKRS-HIGH IS NOT INITIAL AND S_BUKRS-LOW IS INITIAL.
    MESSAGE E006.
    ELSE.
              o
                    +
    Validation for chart of accounts
    SELECT BUKRS " Company Code
    FROM T001 UP TO 1 ROWS
    INTO L_BUKRS
    WHERE BUKRS IN S_BUKRS.
    ENDSELECT.
    IF SY-SUBRC NE 0.
              o
                    +
    Invalid Company code
    MESSAGE E001.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDFORM. " sub_validation_bukrs
    *& Form sub_validation_hkont
    Validation For General Ledger Account
    FORM SUB_VALIDATION_HKONT .
    DATA: L_HKONT TYPE HKONT. " General Ledger Account
    IF S_HKONT IS INITIAL.
    MESSAGE E002.
    ELSE.
    IF S_HKONT-HIGH IS NOT INITIAL AND S_HKONT-LOW IS INITIAL.
    MESSAGE E006.
    ELSE.
              o
                    +
    Validation for chart of accounts
    SELECT SAKNR " General Ledger Account
    FROM SKA1 UP TO 1 ROWS
    INTO L_HKONT
    WHERE SAKNR IN S_HKONT AND KTOPL = '1SLR'.
    ENDSELECT.
    IF SY-SUBRC NE 0.
              o
                    +
    Invalid General Ledger Account
    MESSAGE E003.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDFORM. " sub_validation_hkont
    *& Form sub_validation_gjahr
    Validation For Fiscal Year
    FORM SUB_VALIDATION_GJAHR .
    DATA: L_GJAHR TYPE GJAHR. " Fiscal Year
    IF S_GJAHR IS NOT INITIAL.
    IF S_GJAHR-HIGH IS NOT INITIAL AND S_GJAHR-LOW IS INITIAL.
    MESSAGE E006.
    ENDIF.
    ENDIF.
    ENDFORM. " sub_validation_gjahr
    *& Form sub_validation_monat
    Validation For Fiscal period
    FORM SUB_VALIDATION_MONAT .
    DATA: L_MONAT TYPE MONAT. " Fiscal period
    IF S_MONAT IS NOT INITIAL.
    IF S_MONAT-LOW LE C_ZERO.
              o
                    +
    Invalid Fiscal Period
    MESSAGE E006.
    ENDIF.
    IF S_MONAT-HIGH GT C_FLAG_12.
              o
                    +
    Invalid Fiscal Period
    MESSAGE E007.
    ENDIF.
    ENDIF.
    ENDFORM. " sub_validation_monat
    *& Form sub_validation_belnr
    Validation For Accounting Document Number
    FORM SUB_VALIDATION_BELNR .
    DATA: L_BELNR TYPE BELNR_D. " Accounting Document Number
    IF S_BELNR IS NOT INITIAL.
    IF S_BELNR-HIGH IS NOT INITIAL AND S_BELNR-LOW IS INITIAL.
    MESSAGE E006.
    ENDIF.
    ENDIF.
    ENDFORM. " sub_validation_belnr
    *& Form sub_validation_budat
    Validation For Posting Date
    FORM SUB_VALIDATION_BUDAT .
    DATA: L_BUDAT TYPE BUDAT. " Posting Date
    IF S_BUDAT IS NOT INITIAL.
    IF S_BUDAT-HIGH IS NOT INITIAL AND S_BUDAT-LOW IS INITIAL.
    MESSAGE E006.
    ENDIF.
    ENDIF.
    ENDFORM. " sub_validation_budat
    *& Form sub_validation_prctr
    Validation For Profit Center
    FORM SUB_VALIDATION_PRCTR .
    DATA: L_PRCTR TYPE PRCTR. " Profit Center
    IF S_PRCTR IS INITIAL.
    MESSAGE E010.
    ELSE.
    IF S_PRCTR-HIGH IS NOT INITIAL AND S_PRCTR-LOW IS INITIAL.
    MESSAGE E006.
    ELSE.
              o
                    +
    Validation for chart of accounts
    SELECT PRCTR " Profit Center
    FROM CEPC UP TO 1 ROWS
    INTO L_PRCTR
    WHERE PRCTR IN S_PRCTR.
    ENDSELECT.
    IF SY-SUBRC NE 0.
              o
                    +
    Invalid Profit Center
    MESSAGE E011.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDFORM. " sub_validation_prctr
    *& Form sub_validation_blart
    Validation For Document type
    FORM SUB_VALIDATION_BLART .
    DATA: L_BLART TYPE BLART. " Document type
    IF S_BLART IS INITIAL.
    MESSAGE E012.
    ELSE.
    IF S_BLART-HIGH IS NOT INITIAL AND S_BLART-LOW IS INITIAL.
    MESSAGE E006.
    ENDIF.
    ENDIF.
    ENDFORM. " sub_validation_blart
    *& Form sub_check_filepath
    Check user input for initial filename
    FORM SUB_CHECK_FILEPATH .
    IF RB_PFILE = C_FLAG_X.
    IF P_PFILE IS INITIAL.
              o
                    +
    The Local File Path can not be Empty
    MESSAGE I014.
    LEAVE LIST-PROCESSING.
    ENDIF.
    ELSEIF RB_AFILE = C_FLAG_X.
    IF P_AFILE IS INITIAL.
              o
                    +
    The App Server File Path can not be Empty
    MESSAGE I015.
    LEAVE LIST-PROCESSING.
    ENDIF.
    ENDIF.
    ENDFORM. " sub_check_filepath
    *& Form sub_prepare_final
    append the required output data in to the internal table.
    FORM SUB_PREPARE_FINAL.
    changes on 30 th may by dileep
    SELECT * FROM BSEG INTO TABLE I_BSEG WHERE HKONT IN S_HKONT AND "G/L Account
    GJAHR IN S_GJAHR AND
    PRCTR IN S_PRCTR AND "Profit Center
    BLART IN S_BLART . "Document Type
    SELECT BUKRS
    HKONT
    BELNR
    DMBTR
    KOSTL
    PRCTR
    FROM BSEG INTO TABLE IT_BSEG WHERE HKONT IN S_HKONT AND "G/L Account
    PRCTR IN S_PRCTR. "Profit Center
    LOOP AT IT_BSEG INTO WA_BSEG.
    SELECT SINGLE GJAHR
    BUDAT
    WAERS
    XBLNR
    BLART
    MONAT
    INTO (W_BSEG-GJAHR,W_BSEG-BUDAT,W_BSEG-WAERS,W_BSEG-XBLNR,W_BSEG-BLART,W_BSEG-MONAT)
    FROM BKPF WHERE BELNR = W_BSEG-BELNR AND
    GJAHR IN S_GJAHR AND
    BLART IN S_BLART . "Document Type
    MOVE WA_BSEG-BUKRS TO W_BSEG-BUKRS.
    MOVE WA_BSEG-HKONT TO W_BSEG-HKONT.
    MOVE WA_BSEG-BELNR TO W_BSEG-BELNR.
    MOVE WA_BSEG-DMBTR TO W_BSEG-DMBTR.
    MOVE WA_BSEG-KOSTL TO W_BSEG-KOSTL.
    MOVE WA_BSEG-PRCTR TO W_BSEG-PRCTR.
    APPEND W_BSEG TO I_BSEG.
    ENDLOOP.
    changes on 30 th may by dileep
    IF S_BUKRS IS NOT INITIAL.
    SORT I_BSEG BY BUKRS ASCENDING.
    DELETE I_BSEG WHERE NOT BUKRS IN S_BUKRS.
    ENDIF.
    IF S_MONAT IS NOT INITIAL.
    SORT I_BSEG BY GJAHR MONAT ASCENDING.
    IF S_MONAT-HIGH IS NOT INITIAL AND S_MONAT-LOW IS NOT INITIAL.
    DELETE I_BSEG WHERE MONAT < S_MONAT-LOW OR MONAT > S_MONAT-HIGH.
    ENDIF.
    IF S_MONAT-HIGH IS INITIAL AND S_MONAT-LOW IS NOT INITIAL.
    DELETE I_BSEG WHERE MONAT NE S_MONAT-LOW.
    ENDIF.
    ENDIF.
    IF S_BELNR IS NOT INITIAL.
    SORT I_BSEG BY BELNR ASCENDING.
    DELETE I_BSEG WHERE NOT BELNR IN S_BELNR.
    ENDIF.
    IF S_BUDAT IS NOT INITIAL.
    SORT I_BSEG BY BUDAT ASCENDING.
    DELETE I_BSEG WHERE NOT BUDAT IN S_BUDAT.
    ENDIF.
    LOOP AT I_BSEG INTO W_BSEG.
    MOVE W_BSEG-BUKRS TO W_FINAL-BUKRS.
    MOVE W_BSEG-HKONT TO W_FINAL-HKONT_P.
    MOVE W_BSEG-GJAHR TO W_FINAL-GJAHR.
    MOVE W_BSEG-BELNR TO W_FINAL-BELNR.
    MOVE W_BSEG-BUDAT TO W_FINAL-BUDAT.
    MOVE W_BSEG-WAERS TO W_FINAL-WAERS.
    MOVE W_BSEG-XBLNR TO W_FINAL-XBLNR.
    MOVE W_BSEG-BLART TO W_FINAL-BLART.
    MOVE W_BSEG-MONAT TO W_FINAL-MONAT.
    MOVE W_BSEG-DMBTR TO W_FINAL-DMBTR_P.
    MOVE W_BSEG-KOSTL TO W_FINAL-KOSTL.
    MOVE W_BSEG-PRCTR TO W_FINAL-PRCTR_P.
    SELECT SINGLE * FROM BSEG INTO W_BSEG1 WHERE BELNR = W_BSEG-BELNR AND "Document Type
    BUZID = 'W' .
    IF SY-SUBRC = 0.
    MOVE W_BSEG1-HKONT TO W_FINAL-HKONT_G.
    MOVE W_BSEG1-DMBTR TO W_FINAL-DMBTR_G.
    MOVE W_BSEG1-PRCTR TO W_FINAL-PRCTR_G.
    MOVE W_BSEG1-BUZID TO W_FINAL-BUZID_G.
    ELSE.
    EXIT.
    ENDIF.
    APPEND W_FINAL TO I_FINAL.
    SORT I_FINAL BY BELNR ASCENDING.
    ENDLOOP.
    ENDFORM. " sub_prepare_final
    *& Form sub_download_data
    Download data
    FORM SUB_DOWNLOAD_DATA .
    DATA : V_PRD(2) TYPE N.
    IF RB_PFILE = C_FLAG_X.
              o
                    +
    Downloading To presentation server
    V_PRESPATH = P_PFILE.
    PERFORM SUB_DOWNLOAD_PRESSERVER.
    ELSEIF RB_AFILE = C_FLAG_X.
              o
                    +
    Downloading To Application server in Auto Mode
    V_APPPATH = P_AFILE.
    PERFORM SUB_DOWNLOAD_APPSERVER.
    ENDIF.
    ENDFORM. " sub_download_data
    *& Form sub_download_presserver
    text
    FORM SUB_DOWNLOAD_PRESSERVER.
    DATA: MESSAGE TYPE STRING.
    IF I_FINAL[] IS INITIAL.
    MESSAGE I016.
    EXIT.
    ELSE.
    W_FINAL_P-BUKRS = 'Company Code'.
    W_FINAL_P-DELIMITER_1 = '|'.
    W_FINAL_P-HKONT_P = 'G/L Account Number'.
    W_FINAL_P-DELIMITER_2 = '|'.
    W_FINAL_P-GJAHR = 'Fiscal Year'.
    W_FINAL_P-DELIMITER_3 = '|'.
    W_FINAL_P-BELNR = 'A/c Document Number'.
    W_FINAL_P-DELIMITER_4 = '|'.
    W_FINAL_P-BUDAT = 'Posting Date' .
    W_FINAL_P-DELIMITER_5 = '|'.
    W_FINAL_P-WAERS = 'Currency'.
    W_FINAL_P-DELIMITER_6 = '|'.
    W_FINAL_P-XBLNR = 'Ref. Document Number'.
    W_FINAL_P-DELIMITER_7 = '|'.
    W_FINAL_P-BLART = 'Document Type'.
    W_FINAL_P-DELIMITER_8 = '|'.
    W_FINAL_P-MONAT = 'Fiscal Period'.
    W_FINAL_P-DELIMITER_9 = '|'.
    W_FINAL_P-DMBTR_P = 'Amount'.
    W_FINAL_P-DELIMITER_10 = '|'.
    W_FINAL_P-KOSTL = 'Cost Center'.
    W_FINAL_P-DELIMITER_11 = '|'.
    W_FINAL_P-PRCTR_P = 'Profit Center'.
    W_FINAL_P-DELIMITER_12 = '|'.
    W_FINAL_P-HKONT_G = 'G/L Account Number'.
    W_FINAL_P-DELIMITER_13 = '|'.
    W_FINAL_P-DMBTR_G = 'Amount'.
    W_FINAL_P-DELIMITER_14 = '|'.
    W_FINAL_P-PRCTR_G = 'Profit Center'.
    W_FINAL_P-DELIMITER_15 = '|'.
    W_FINAL_P-BUZID_G = 'Line Item Id'.
    APPEND W_FINAL_P TO I_FINAL_P.
    LOOP AT I_FINAL INTO W_FINAL.
    W_FINAL_P-BUKRS = W_FINAL-BUKRS.
    W_FINAL_P-DELIMITER_1 = '|'.
    W_FINAL_P-HKONT_P = W_FINAL-HKONT_P.
    W_FINAL_P-DELIMITER_2 = '|'.
    W_FINAL_P-GJAHR = W_FINAL-GJAHR.
    W_FINAL_P-DELIMITER_3 = '|'.
    W_FINAL_P-BELNR = W_FINAL-BELNR.
    W_FINAL_P-DELIMITER_4 = '|'.
    W_FINAL_P-BUDAT = W_FINAL-BUDAT .
    W_FINAL_P-DELIMITER_5 = '|'.
    W_FINAL_P-WAERS = W_FINAL-WAERS.
    W_FINAL_P-DELIMITER_6 = '|'.
    W_FINAL_P-XBLNR = W_FINAL-XBLNR.
    W_FINAL_P-DELIMITER_7 = '|'.
    W_FINAL_P-BLART = W_FINAL-BLART.
    W_FINAL_P-DELIMITER_8 = '|'.
    W_FINAL_P-MONAT = W_FINAL-MONAT.
    W_FINAL_P-DELIMITER_9 = '|'.
    W_FINAL_P-DMBTR_P = W_FINAL-DMBTR_P.
    W_FINAL_P-DELIMITER_10 = '|'.
    W_FINAL_P-KOSTL = W_FINAL-KOSTL.
    W_FINAL_P-DELIMITER_11 = '|'.
    W_FINAL_P-PRCTR_P = W_FINAL-PRCTR_P.
    W_FINAL_P-DELIMITER_12 = '|'.
    W_FINAL_P-HKONT_G = W_FINAL-HKONT_G.
    W_FINAL_P-DELIMITER_13 = '|'.
    W_FINAL_P-DMBTR_G = W_FINAL-DMBTR_G.
    W_FINAL_P-DELIMITER_14 = '|'.
    W_FINAL_P-PRCTR_G = W_FINAL-PRCTR_G.
    W_FINAL_P-DELIMITER_15 = '|'.
    W_FINAL_P-BUZID_G = W_FINAL-BUZID_G.
    APPEND W_FINAL_P TO I_FINAL_P.
    CLEAR : W_FINAL_P, W_FINAL.
    ENDLOOP.
    ENDIF.
    *---Downloading data to file on Presentation Server
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    FILENAME = V_PRESPATH
    FILETYPE = 'ASC'
    TABLES
    DATA_TAB = I_FINAL_P
    EXCEPTIONS
    FILE_WRITE_ERROR = 1
    NO_BATCH = 2
    GUI_REFUSE_FILETRANSFER = 3
    INVALID_TYPE = 4
    NO_AUTHORITY = 5
    UNKNOWN_ERROR = 6
    HEADER_NOT_ALLOWED = 7
    SEPARATOR_NOT_ALLOWED = 8
    FILESIZE_NOT_ALLOWED = 9
    HEADER_TOO_LONG = 10
    DP_ERROR_CREATE = 11
    DP_ERROR_SEND = 12
    DP_ERROR_WRITE = 13
    UNKNOWN_DP_ERROR = 14
    ACCESS_DENIED = 15
    DP_OUT_OF_MEMORY = 16
    DISK_FULL = 17
    DP_TIMEOUT = 18
    FILE_NOT_FOUND = 19
    DATAPROVIDER_EXCEPTION = 20
    CONTROL_FLUSH_ERROR = 21
    OTHERS = 22.
              o
                    + File can not be opened successfully
    IF SY-SUBRC NE 0.
    IF SY-BATCH EQ C_FLAG_X. " Stop Processing
    MESSAGE E017. " File could not be opened
    ELSE.
    MESSAGE I017. " File could not be opened
    LEAVE LIST-PROCESSING.
    ENDIF.
    ELSE.
    CONCATENATE 'Data Successfully downloaded to the Specified Location' V_PRESPATH INTO MESSAGE SEPARATED BY SPACE.
    MESSAGE MESSAGE TYPE 'S'.
    ENDIF.
    MODIFY SCREEN.
    ENDFORM. " sub_download_presserver
    *& Form sub_download_appserver
    text
    FORM SUB_DOWNLOAD_APPSERVER .
    DATA: V_FILE TYPE STRING, " String
    P_DMBTR TYPE CHAR20,
    G_DMBTR TYPE CHAR20,
    MESSAGE1 TYPE STRING.
    IF I_FINAL[] IS INITIAL.
    IF SY-BATCH EQ C_FLAG_X.
              o
                    +
    File contains no data
    MESSAGE E016 .
    ELSE.
              o
                    +
    File contains no data
    MESSAGE I016 .
    LEAVE LIST-PROCESSING.
    ENDIF.
    ENDIF.
              o
                    +
    To Open The file in Application Server
    OPEN DATASET V_APPPATH FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    IF SY-SUBRC NE 0.
              o
                    +
    Display error message: "Could not open file"
    IF SY-BATCH EQ C_FLAG_X.
              o
                    +
    File contains no data
    MESSAGE E016 .
    ELSE.
              o
                    +
    File contains no data
    MESSAGE I016 .
    LEAVE LIST-PROCESSING.
    ENDIF.
    ENDIF.
              o
                    +
    Perform for building the Report header
    CONCATENATE
    'COMPANY_CODE'
    'G/L_ACCOUNT_NUMBER'
    'FISCAL_YEAR'
    'A/C_DOCUMENT_NUMBER'
    'POSTING_DATE'
    'CURRENCY'
    'REF_DOCUMENT_NUMBER'
    'DOCUMENT_TYPE'
    'FISCAL_PERIOD'
    'AMOUNT'
    'COSTCENTER'
    'PROFIT_CENTER'
    'G/L_ACCOUNT_NUMBER'
    'AMOUNT'
    'PROFIT_CENTER'
    'LINE_ITEM_ID'
    INTO V_FILE SEPARATED BY C_DELIMITER.
    TRANSFER V_FILE TO V_APPPATH.
              o
                    +
    Transfer the data to application Server
    LOOP AT I_FINAL INTO W_FINAL.
    P_DMBTR = W_FINAL-DMBTR_P.
    G_DMBTR = W_FINAL-DMBTR_G.
    CONCATENATE
    W_FINAL-BUKRS
    W_FINAL-HKONT_P
    W_FINAL-GJAHR
    W_FINAL-BELNR
    W_FINAL-BUDAT
    W_FINAL-WAERS
    W_FINAL-XBLNR
    W_FINAL-BLART
    W_FINAL-MONAT
    P_DMBTR
    W_FINAL-KOSTL
    W_FINAL-PRCTR_P
    W_FINAL-HKONT_G
    G_DMBTR
    W_FINAL-PRCTR_G
    W_FINAL-BUZID_G
    INTO V_FILE SEPARATED BY C_DELIMITER.
    TRANSFER V_FILE TO V_APPPATH.
    IF SY-SUBRC NE 0.
    Display error message: "Data could not be written at the location"
    MESSAGE 'Data could not be written at the location' TYPE 'I'.
    EXIT.
    ENDIF.
    CLEAR V_FILE.
    ENDLOOP.
    CLOSE DATASET V_APPPATH.
    IF SY-SUBRC NE 0.
    Display error message: "File could not be closed"
    MESSAGE 'File could not be closed' TYPE 'I'.
    EXIT.
    ELSE.
    CONCATENATE 'Data Successfully downloaded to the Specified Location' V_APPPATH INTO MESSAGE1 SEPARATED BY SPACE.
    MESSAGE MESSAGE1 TYPE 'S'.
    ENDIF.
    ENDFORM. " sub_download_appserver
    regards,
    Vipul

  • How to improve the performance of adobe forms

    Hi,
    Please give me some suggestions as to how to improve the performance of adobe form?
    Right now when I' am doing user events it is working fine for first 6 or 7 user events. From the next
    one it is hanging.
    I read about Wizard form design approach, how to use the same here.
    Thanks,
    Aravind

    Hi Otto,
    The form is created using HCM forms and processes. I' am performing user events in the form.
    User events will doa round trip, in which form data will be sent to backend SAP system. Processing will
    happen on the ABAP side and result will appear on the form. First 6 or 7 user events works correctly,
    the result is appearing on the form. Around 8 or 9th one, the wait symbol appears and the form is not
    re-rendered. The form is of size 6 pages. The issue is not coming with form of size 1 page.
    I was reading ways to improve performance during re-rendering given below.
    http://www.adobe.com/devnet/livecycle/articles/DynamicInteractiveFormPerformance.pdf
    It talks about wizard form design approach. But in SFP transaction, I am not seeing any kind of wizard.
    Let me know if you need further details.
    Thanks,
    Aravind

  • Help to improve the performance of a procedure.

    Hello everybody,
    First to introduce myself. My name is Ivan and I recently started learning SQL and PL/SQL. So don't go hard on me. :)
    Now let's jump to the problem. What we have there is a table (big one, but we'll need only a few fields) with some information about calls. It is called table1. There is also another one, absolutely the same structure, which is empty and we have to transfer the records from the first one.
    The shorter calls (less than 30 minutes) have segmentID = 'C1'.
    The longer calls (more than 30 minutes) are recorded as more than one record (1 for every 30 minutes). The first record (first 30 minutes of the call) has segmentID = 'C21'. It is the first so we have only one of these for every different call. Then we have the next (middle) parts of the call, which have segmentID = 'C22'. We can have more than 1 middle part and again the maximum minutes in each is 30 minutes. Then we have the last part (again max 30 minutes) with segmentID = 'C23'. As with the first one we can have only one last part.
    So far, so good. Now we need to insert these call records into the second table. The C1 are easy - one record = one call. But the partial ones we need to combine so they become one whole call. This means that we have to take one of the first parts (C21), find if there is a middle part (C22) with the same calling/called numbers and with 30 minutes difference in date/time, then search again if there is another C22 and so on. And last we have to search for the last part of the call (C23). In the course of these searches we sum the duration of each part so we can have the duration of the whole call at the end. Then we are ready to insert it in the new table as a single record, just with new duration.
    But here comes the problem with my code... The table has A LOT of records and this solution, despite the fact that it works (at least in the tests I've made so far), it's REALLY slow.
    As I said I'm new to PL/SQL and I know that this solution is really newbish, but I can't find another way of doing this.
    So I decided to come here and ask you for some tips on how to improve the performance of this.
    I think you are getting confused already, so I'm just going to put some comments in the code.
    I know it's not a procedure as it stands now, but it will be once I create a better code. I don't think it matters for now.
    DECLARE
    CURSOR cur_c21 IS
        select * from table1
        where segmentID = 'C21'
        order by start_date_of_call;     // in start_date_of_call is located the beginning of a specific part of the call. It's date format.
    CURSOR cur_c22 IS
        select * from table1
        where segmentID = 'C22'
        order by start_date_of_call;
    CURSOR cur_c22_2 IS
        select * from table1
        where segmentID = 'C22'
        order by start_date_of_call;  
    cursor cur_c23 is
        select * from table1
        where segmentID = 'C23'
        order by start_date_of_call;
    v_temp_rec_c22 cur_c22%ROWTYPE;
    v_dur table1.duration%TYPE;           // using this for storage of the duration of the call. It's number.
    BEGIN
    insert into table2
    select * from table1 where segmentID = 'C1';     // inserting the calls which are less than 30 minutes long
    -- and here starts the mess
    FOR rec_c21 IN cur_c21 LOOP        // taking the first part of the call
       v_dur := rec_c21.duration;      // recording it's duration
       FOR rec_c22 IN cur_c22 LOOP     // starting to check if there is a middle part for the call
          IF rec_c22.callingnumber = rec_c21.callingnumber AND rec_c22.callednumber = rec_c21.callednumber AND 
            (rec_c22.start_date_of_call - rec_c21.start_date_of_call) = (1/48)                
    /* if the numbers are the same and the date difference is 30 minutes then we have a middle part and we start searching for the next middle. */
          THEN
             v_dur := v_dur + rec_c22.duration;     // updating the new duration
             v_temp_rec_c22:=rec_c22;               // recording the current record in another variable because I use it for the next check
             FOR rec_c22_2 in cur_c22_2 LOOP
                IF rec_c22_2.callingnumber = v_temp_rec_c22.callingnumber AND rec_c22_2.callednumber = v_temp_rec_c22.callednumber AND 
                  (rec_c22_2.start_date_of_call - v_temp_rec_c22.start_date_of_call) = (1/48)        
    /* logic is the same as before but comparing with the last value in v_temp...
    And because the data in the cursors is ordered by date in ascending order it's easy to search for another middle parts. */
                THEN
                   v_dur:=v_dur + rec_c22_2.duration;
                   v_temp_rec_c22:=rec_c22_2;
                END IF;
             END LOOP;                     
          END IF;
          EXIT WHEN rec_c22.callingnumber = rec_c21.callingnumber AND rec_c22.callednumber = rec_c21.callednumber AND 
                   (rec_c22.start_date_of_call - rec_c21.start_date_of_call) = (1/48);       
    /* exiting the loop if we have at least one middle part.
    (I couldn't find if there is a way to write this more clean, like exit when (the above if is true) */
       END LOOP;
       FOR rec_c23 IN cur_c23 LOOP             
          IF (rec_c23.callingnumber = rec_c21.callingnumber AND rec_c23.callednumber = rec_c21.callednumber AND
             (rec_c23.start_date_of_call - rec_c21.start_date_of_call) = (1/48)) OR v_dur != rec_c21.duration          
    /* we should always have one last part, so we need this check.
    If we don't have the "v_dur != rec_c21.duration" part it will execute the code inside only if we don't have middle parts
    (yes we can have these situations in calls longer than 30 and less than 60 minutes). */
          THEN
             v_dur:=v_dur + rec_c23.duration;
             rec_c21.duration:=v_dur;               // updating the duration
             rec_c21.segmentID :='C1';
             INSERT INTO table2 VALUES rec_c21;     // inserting the whole call in table2
          END IF;
          EXIT WHEN (rec_c23.callingnumber = rec_c21.callingnumber AND rec_c23.callednumber = rec_c21.callednumber AND
                    (rec_c23.start_date_of_call - rec_c21.start_date_of_call) = (1/48)) OR v_dur != rec_c21.duration;                 
                    // exit the loop when the last part has been found.
       END LOOP;
    END LOOP;
    END;I'm using Oracle 11g and version 1.5.5 of SQL Developer.
    It's my first post here so hope this is the right sub-forum.
    I tried to explain everything as deep as possible (sorry if it's too long) and I kinda think that the code got somehow hard to read with all these comments. If you want I can remove them.
    I know I'm still missing a lot of knowledge so every help is really appreciated.
    Thank you very much in advance!

    Atiel wrote:
    Thanks for the suggestion but the thing is that segmentID must stay the same for all. The data in this field is just to tell us if this is a record of complete call (C1) or a partial record of a call(C21, C22, C23). So in table2 as every record will be a complete call the segmentID must be C1 for all.Well that's not a problem. You just hard code 'C1' instead of applying the row number as I was doing:
    SQL> ed
    Wrote file afiedt.buf
      1  select 'C1' as segmentid
      2        ,start_date_of_call, duration, callingnumber, callednumber
      3  from (
      4        select distinct
      5               min(start_date_of_call) over (partition by callingnumber, callednumber) as start_date_of_call
      6              ,sum(duration) over (partition by callingnumber, callednumber) as duration
      7              ,callingnumber
      8              ,callednumber
      9        from table1
    10*      )
    SQL> /
    SEGMENTID  START_DATE_OF_CALL     DURATION CALLINGNUMBER   CALLEDNUMBER
    C1         11-MAY-2012 12:13:10 8020557824 1982032041      0631432831624
    C1         15-MAR-2012 09:07:26  269352960 5581790386      0113496771567
    C1         31-JUL-2012 23:20:23  134676480 4799842978      0813391427349
    Another thing is that, as I said above, the actual table has 120 fields. Do I have to list them all manually if I use something similar?If that's what you need, then yes you would have to list them. You only get data if you tell it you want it. ;)
    Of course if you are taking the start_date_of_call, callingnumber and callednumber as the 'key' to the record, then you could join the results of the above back to the original table1 and pull out the rest of the columns that way...
    SQL> select * from table1;
    SEGMENTID  START_DATE_OF_CALL     DURATION CALLINGNUMBER   CALLEDNUMBER          COL1       COL2       COL3
    C1         31-JUL-2012 23:20:23  134676480 4799842978      0813391427349          556         40       5.32
    C21        15-MAR-2012 09:07:26  134676480 5581790386      0113496771567          219        100      10.16
    C23        11-MAY-2012 09:37:26  134676480 5581790386      0113496771567          321         73       2.71
    C21        11-MAY-2012 12:13:10 3892379648 1982032041      0631432831624          959         80       2.87
    C22        11-MAY-2012 12:43:10 3892379648 1982032041      0631432831624          375         57       8.91
    C22        11-MAY-2012 13:13:10  117899264 1982032041      0631432831624          778         27       1.42
    C23        11-MAY-2012 13:43:10  117899264 1982032041      0631432831624          308         97       3.26
    7 rows selected.
    SQL> ed
    Wrote file afiedt.buf
      1  with t2 as (
      2  select 'C1' as segmentid
      3        ,start_date_of_call, duration, callingnumber, callednumber
      4  from (
      5        select distinct
      6               min(start_date_of_call) over (partition by callingnumber, callednumber) as start_date_of_call
      7              ,sum(duration) over (partition by callingnumber, callednumber) as duration
      8              ,callingnumber
      9              ,callednumber
    10        from table1
    11       )
    12  )
    13  --
    14  select t2.segmentid, t2.start_date_of_call, t2.duration, t2.callingnumber, t2.callednumber
    15        ,t1.col1, t1.col2, t1.col3
    16  from   t2
    17         join table1 t1 on (   t1.start_date_of_call = t2.start_date_of_call
    18                           and t1.callingnumber = t2.callingnumber
    19                           and t1.callednumber = t2.callednumber
    20*                          )
    SQL> /
    SEGMENTID  START_DATE_OF_CALL     DURATION CALLINGNUMBER   CALLEDNUMBER          COL1       COL2       COL3
    C1         11-MAY-2012 12:13:10 8020557824 1982032041      0631432831624          959         80       2.87
    C1         15-MAR-2012 09:07:26  269352960 5581790386      0113496771567          219        100      10.16
    C1         31-JUL-2012 23:20:23  134676480 4799842978      0813391427349          556         40       5.32
    SQL>Of course this is pulling back the additional columns for the record that matches the start_date_of_call for that calling/called number pair, so if the values differed from row to row within the calling/called number pair you may need to aggregate those (take the minimum/maximum etc. as required) as part of the first query. If the values are known to be the same across all records in the group then you can just pick them up from the join to the original table as I coded in the above example (only in my example the data was different across all rows).

Maybe you are looking for

  • I have a website listed as an extension. How do I get the icon into my desktop or on the toolbar?

    I have the Grammarly website icon on my list of extensions. Its supposedly one of Firefox add ons. How do I move this icon to either the desktop or bookmarks or the Firefox toolbar? Anywhere so I can access it.

  • Tags in Photoshop Elements 11

    I just converted to Photoshop Elements 11 and have all my picture file organized using Tags, which has worked very well in previous version of PE. Everything converted OK but the way PE11 uses Tags is quite confusing. First, Tags are shown on the rig

  • BLOB size more than doc size.

    Hi All, We are migrating pdf documents to oracle database.The table in which we are inserting the BLOB's is under the Table Space "USER01". When we compare the free bytes availaability between before and after migration, it shows that about 5.23 GB o

  • Powerpoint Sildes to Go. Notes cannot be edited

    Tried to use this app for a business meeting and noticed a few glaring ommissions 1) When views the notes you only see 3 lines 2) You cannot edit the notes 3) when I Tilt the PB I expect the format to change so I can see more notes.

  • Weird connection "background color of subdiagram label" & "use transparent name labels"

    I stumbled upon the following side effect in LabVIEW 2013: 1) Turn off the option "use transparent name labels" in blockdiagram options. 2) now create a while loop 3) show the subdiagram label of the while loop Because of the changes already discusse