Improving Report Performance

Hi HTMLDB Team,
I need some of the undocumented HTMLDB information to improve the performance of the Reports, which will be of useful to every one.
I have a Customer table, which has 1 Million records in it. It has the following columns:
First Name, Last Name, Customer ID, State.
I have a Report Region (PL SQL Block returning the Query), which directly picks up records from this table.
User can filter Customer Records by any of the above-mentioned column.
With out any sorting I am getting the response in 2 seconds.
But If I put Sort on any of these columns my response time goes to 1 min.
I have index on all the columns too.
If the user applies any filter like "State=NY" or "First Name=Balaji" I am getting the response in 2-3 seconds.
Now I want to keep the Report Response time within 2-3 seconds. (Without any filter condition and sorting on some column say "First Name".)
In order to achieve this I want to add dynamically some filter conditions to the original query. when there are no filter conditions specified by the user.
My approach is based on the assumption that user will be shown only the first 500 records of the query results (This is the normal HTML DB report behavior and I don't want to increase the Report Region max count beyond 500)
My Original Report region query is
SELECT * FROM CUSTOMER ORDER BY FIRST_NAME. -- It is taking 1 minute to returns all 1 million records out of which we are showing only the first 500 records.
If I rewrite this query as
SELECT * FROM CUSTOMER WHERE FIRST_NAME < 'B' ORDER BY FIRST_NAME. -- Takes 2 seconds and returns more than 1000 records.
Now I can use the second query to show the records if the user did not specify any filters and he will be shown only the first 500 records.
Now my issue is if the user changes the Sort Order to "Last Name" then the above query will not work and I need to change my query as
SELECT * FROM CUSTOMER WHERE LAST_NAME < 'B' ORDER BY LAST_NAME.
Similarly if the user selects State as the Sort Order
SELECT * FROM CUSTOMER WHERE STATE="AK" -- Will definitely give me > 500 records.
Also I need to consider whether the user is sorting in Ascending or Descending order too.
From where can I get this Report Sort Order information in HTML DB?
If you can provide this information, it will be of great use to all HTML DB folks.
Regards
Balaji. C

Hi!
What exactly did you find at mentioned link regarding report performance ... it is not about performance issues for reports ... id is about navigation from a report row to a page.
Please, can you tell more exactly what thing solved your solution?
I have the same situation, a query runing about 1 second dirrectly on the database from SQL Developer, but from APEX page it takes about 55 seconds.
Thank you.
Edited by: bustiuci on Nov 15, 2008 9:46 PM

Similar Messages

  • How Can we improve the report performance..?

    Hi exports,
    I am learning the Business Objects XIR2, Please let me know How Can we improve the report performance..?
    Please give the answer in detailed way.

    First find out why your report is performing slowly. Then fix it.
    That sounds silly, but there's really no single-path process for improving report performance. You might find issues with the report. With the network. With the universe. With the database. With the database design. With the query definition. With report variables. With the ETL. Once you figure out where the problem is, then you start fixing it. Fixing one problem may very well reveal another. I spent two years working on a project where we touched every single aspect of reporting (from data collection through ETL and all the way to report delivery) at some point or another.
    I feel like your question is a bit broad (meaning too generic) to address as you have phrased it. Even some of the suggestions already given...
    Array fetch size - this determines the number of rows fetched at a single pass. You really don't need to modify this unless your network is giving issues. I have seen folks suggest setting this to one (which results in a lot of network requests) or 500 (which results in fewer requests but they're much MUCH larger). Does either improve performance? They might, or they might make it worse. Without understanding how your network traffic is managed it's hard to say.
    Shortcut joins? Sure, they can help, as long as they are appropriate. [Many times they are not.|http://www.dagira.com/2010/05/27/everything-about-shortcut-joins/]
    And I could go on and on. The bottom line is that performance tuning doesn't typically fall into a "cookie cutter" approach. It would be better to have a specific question.

  • Report Performance for GL item level report.

    Hi All,
    I have a requirements to get GL line items
    report based on GL Line items so have created data model like 0FI_GL_4->DSO-> cube and tested everything is fine but when execute in production the report performance is very bad.
    Report contains document number, GL act, comp.code, posting date objects.
    I have decided to do as follows to improve reporting performance
    ·         Create Aggregate on Document, GL characteristic
    ·         Compression.
    Can I do aggregates 1st then do the compression.
    Please let me know if I missing out anything.
    Regards,
    Naani.

    Hi Naani,
    First fill the Aggrigates then do Compression,run SAP_INFOCUBE_DESIGN Check the size of Dimension maintain Line item, High cordinality to the dimension, Set Cahe for query in RSRT,
    Try to reduce Novigational Attr in report. Below document may help you.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6071ed5f-1057-2e10-deb6-d3426fec0219?QuickLink=index&…
    Regards,
    Jagadeesh

  • Is there a way to improve the performance of a report group?

    Hi gurus,
    Is there a way to improve the performance of a report group? 
    Points will be given later....
    Thanks!

    Hi there,
    Thank you for your response. I thought there's no answer for this issue and planning to change it to ALV.
    I looked at the codes and debugged it. After the select statement from ZZUWT table (customized), there's a loop that takes much time (10-12mins) for 1000 records. and several nested perform routines. It's a standard program so I'm hesitant to edit it.
    I'll be checking on the primary keys. If it's ok, may I ask for your assistance in this part? Though I'm not that familiar and haven't tried creating a report painter before.
    Thanks anyway...:D

  • Report  performance with Hierarchies

    Hi
    How to improve query performance with hierarchies. We have to do lot of navigation's in the query and the volume of data size very big.
    Thanks
    P G

    HI,
    chk this:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1955ba90-0201-0010-d3aa-8b2a4ef6bbb2
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ce7fb368-0601-0010-64ba-fadc985a1f94
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4c0ab590-0201-0010-bd9a-8332d8b4f09c
    Query Performance – Is "Aggregates" the way out for me?
    /people/vikash.agrawal/blog/2006/04/17/query-performance-150-is-aggregates-the-way-out-for-me
    ° the OLAP cache is architected to store query result sets and to give all users access to those result sets.
    If a user executes a query, the result set for that query’s request can be stored in the OLAP cache; if that same query (or a derivative) is then executed by another user, the subsequent query request can be filled by accessing the result set already stored in the OLAP cache.
    In this way, a query request filled from the OLAP cache is significantly faster than queries that receive their result set from database access
    ° The indexes that are created in the fact table for each dimension allow you to easily find and select the data
    see http://help.sap.com/saphelp_nw04/helpdata/en/80/1a6473e07211d2acb80000e829fbfe/content.htm
    ° when you load data into the InfoCube, each request has its own request ID, which is included in the fact table in the packet dimension.
    This (besides giving the possibility to manage/delete single request) increases the volume of data, and reduces performance in reporting, as the system has to aggregate with the request ID every time you execute a query. Using compressing, you can eliminate these disadvantages, and bring data from different requests together into one single request (request ID 0).
    This function is critical, as the compressed data can no longer be deleted from the InfoCube using its request IDs and, logically, you must be absolutely certain that the data loaded into the InfoCube is correct.
    see http://help.sap.com/saphelp_nw04/helpdata/en/ca/aa6437e7a4080ee10000009b38f842/content.htm
    ° by using partitioning you can split up the whole dataset for an InfoCube into several, smaller, physically independent and redundancy-free units. Thanks to this separation, performance is increased when reporting, or also when deleting data from the InfoCube.
    see http://help.sap.com/saphelp_nw04/helpdata/en/33/dc2038aa3bcd23e10000009b38f8cf/content.htm
    Hope it helps!
    tHAK YOU,
    dst

  • Report Performance plase help

    Hi
    MY report is base on the view wihich is a based on 10 unions of select statments. I am trying to improve the performance.
    I am planing to remove the view completelty and base a report on the SQL.
    Please see below ffor view structure
    create view XYZ
    SELECT
    'SOU' GATE_KEEPER
    AD.Address,
    Ad.ctiy,
    Pu.phone,
    sa.lcn_code
    FROM x,y,z
    WHERE
    GROUP BY
    UNION
    SELECT
    'DEM' GATE_KEEPER,
    AD.Address,
    Ad.ctiy,
    Pu.phone,
    sa.lcn_code
    FROM x,y,z
    WHERE
    GROUP BY
    UNION
    SELECT
    'LAR' GATE_KEEPER,
    AD.Address,
    Ad.ctiy,
    Pu.phone,
    sa.lcn_code
    FROM x,y,z
    WHERE
    GROUP BY
    Can I do something like this in report
    IF
    GATE_KEEPER= 'SOU' then execute
    SELECT
    'SOU' GATE_KEEPER
    AD.Address,
    Ad.ctiy,
    Pu.phone,
    sa.lcn_code
    FROM x,y,z
    WHERE
    GROUP BY
    elsif
    GATE_KEEPER= 'SOU' then execute
    SELECT
    'DEM' GATE_KEEPER
    AD.Address,
    Ad.ctiy,
    Pu.phone,
    sa.lcn_code
    FROM x,y,z
    WHERE
    GROUP BY
    Please help

    Looks like you need to create report parameter for the gate keeper, and a lexical parameter for the table froom which it should be picked. But first try replacing UNION to UNION ALL everywhere in the view.

  • Report performance Issue in BI Answers

    Hi All,
    We have a performance issues with reports. Report is running more than 10 mins. we took query from the session log and ran it in database, at that time it took not more than 2 mins. We have verified proper indexes on the where clause columns.
    Could any once suggest to improve the performance in BI answers?
    Thanks in advance,

    I hope you dont have many case statements and complex calculations that you do in the Answers.
    Next thing you need to monitor is how many rows of data that you are trying to retrieve from the query. If the volume is huge then it takes time to do the formatting on the Answers as you are going to dump huge volumes of data. Database(like teradata) returns initially like 1-2000 records if you hit show all records then even db is gonna fair amount of time if you are dumping many records
    hope it helps
    thanks
    Prash

  • Report Performance - timeout short dump

    Hello Experts,
    i am trying to improve the performace of a report that was developed long time ago.
    Issues i found:
    1. The report has many select...Endselect combinations, and selects inside the loop statements.
    2. Most of the selects have the addition 'into corresponding fields of' for selecting a few fields, without  the table addition.
    3.  Also few selects have the 'select * from'  syntax.
    data: begin of itab occurs 0,
              f1,
              f2
              f3.....
              fn,          
            end of itab.
    Ex: loop at itab.
             select f1 f2 f3 from table1
                   into corresponding fields of itab1.
               collect itab1.
             endselect.
              select f4 f5 from table2
                  into corresponding fields of itab2.
               endselect.
          endloop.
    All this leeds to performace issues.
    i have checked ST05, and i have got the details of the error.
    My question is which one of the reasons i mentioned above are a major factor in delaying the report performance?
    Which one of the above should i conetrate first to get the long runtime down? My goal is to keep my changes to the minimum and improve the performance. Please advise.

    > My question is which one of the reasons i mentioned above are a major factor in delaying the report
    > performance?
    Don't ask people for guesses, if you can see the facts!
    Run the SQL Trace several times, and use go to 'Trace List' -> 'Summarize Trace by SQL Statement'
    => Shows you total DB time and time per statement (all executions), the problems are on top of the list.
    Check ABAP, detail, and explain!
    Read more here:
    /people/siegfried.boes/blog/2007/09/05/the-sql-trace-st05-150-quick-and-easy
    Siegfried

  • Report performance while creating report on BEx

    All all!
    I am creating a report on BOE 4.0 on top of BEx connection as a source. I have developed reports on top of universe in the past and i know that if we keep calculations on reporting end it hampers the report performance. Is this the same case with BEx? if we are following the best practices is it ok to say that we should keep all heavy calculations/ aggregation on BEx or backend for better report performance.
    Can you guys please provide your opinion based on your experiance and knowledge.  Any feedbacks will help! Thanks.

    Hi,
    Definitely  best-practice to delegate a maximum of CKF to the Cube where possilble,  put RKF in the BEx query, and Filters too.
    also, add Default Values to your Variables (this will speed up generation of the bics transient universe)
    also, since Patch2.10, we are seeing some significant performance improvements  reducing 'document initialization' and  'time to prompts'  by up to 50% (step such as these often took 1.5 minutes, even on sized systems)
    Also, make sure you have BW corrections like this implemented:  1593802    Performance optimization when loading query views 
    In the BusinessObjects landscape - especially with BI 4.0 - it's all about Sizing and Tuning . Here is your bible the 'sizing companion' guide : http://service.sap.com/~form/sapnet?_SHORTKEY=01100035870000738725&_OBJECT=011000358700000307202011E
    Pay particular attention to BICSChunkSize registry settings
    Also, the  -Xmx JVM Heap Size for the Adaptive Processing Server  that is running the DSL_Bridge service.
    Regards,
    H

  • 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

  • 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

  • Item/Drill Report Performance hinderance

    I am having a problem with report performance. I have a report that I have to have 5 drop down menus on top of the report. It seems the more drop down menus I add, the slower the response time when the report is actually navigated. One of the drop downs has over 1,000 options, but the other 4 drop down menus have 4-5 options. Is there a way to improve performance?

    And this is different from yesterday how?
    Please help, Discoverer Performance.
    Russ provided a few possible reasons, and asked for a bit of detail. Instead of asking the same question again, respond to Russ and others, and provide a bit more information to how things are set up.

  • BEx Report Performance with selection-screen input

    Hello Gurus,
    My Bex report is working fine when the report had run with out PLANT filter in the selection-screen but when report had run with plant in the selection-screen , report running for forever.
    Please let me know what I need to do improve the performance.
    Saleem.

    Hi Saleem, Just a few thoughts;
    1. Check the M-table in RSD1 for 0PLANT. In Table View edit any blank or null values. Run the same restrictions you apply in the query at Info provider level > Display Data. If there's any lapse; you can judge where exactly the problem lies.
    2. If you are using Infocube & that your master is >20% fact; you can declare the Info object as 'Line Item Dimension'.
    3. Create Variants. Esp. if you are running the query for same set of data. Try Variable Preselection: You can restrict both the values + varaiables in the filter level. When you execute the values will be visibly pre-selected in selection screen.
    4. As discussed in previous messages, running a SQL trace using RSRT may prove useful.

  • Oracle Report Performance Slow

    I have a report which extracting the data from few complex queries and most of the tables that this report using are large tables.
    The problem I'm facing is the entire application become very very slow/hang whenever this report being runned.
    I have index all the necessary fields and process the report using those indexed field but still can't help.
    Is there anyway to improve the performance? Will it help if I combine all the queries into one query?
    How about the Database? any configurations can be set?
    Regards,
    Cheong

    The execution of the query doesn't depend on Reports, it is done in the database. So, check your query using the normal performance tuning tools.
    If just your report is slow (i.e. not the query) it could be because you have extensive formatting in your report. Formatting is done by Reports, not by the database. Try to do as much formatting in the query.

  • S_ALR_87013340-PRCtr Group:plan/Actual Caomparison Report performance issue

    I'm trying to get the "actual line item" details from the S_ALR_87013340-PRCtr Group:plan/Actual Caomparison Report and I get a
    ABAP run time error. I tried to running for just one month and on several accts. please help to me. how to get the report.
    or how to improve the performance of this program.
    Thanks in Advance

    hi,
      first we need to know what part of the code is taking time. Do run time analysis using SE30 transaction to know what part of coding is taking more time. use can ST12 transaction to get more detailed analysis.
    Since this is standard SAP report also check any OSS note exist for the performance problem.

Maybe you are looking for

  • PROBLEM IN CASE OF RETURN THE MATERIAL

    DEAR CONS I entered goods receipt (migo) . While I am going to return the material ( movement type-122) the system gives an error message that Insufficient Quantity in the Register RGSUM Message no. 4F271 Diagnosis Quantity in the register is the dif

  • Can we access the custom metrics available in host to OEM console?

    Hi All, We have a machine installed with Traffic manager and it is collecting some metrics and displaying in the Traffic manager console. Now my question is can we get these metrics to OEM console by any chance? I have installed the Oracle Management

  • Says camera not supported

    Hi! have the adobe creative suite 5.5: Master collection and I own a Canon EOS rebel SL1.  I downloaded the camera raw plugin but it won'tl et me take my photos into photoshop. Its says my camera is not supported but on the camera list it is. I need

  • Vibration Doesn't work with incoming Calls

    On my iphone4 when I turn my Vibration ON it doesn't repond to normal calls, but it respond to rest. tried everything else except Restore. I dont want to restore coz I need all my messages, and other data. any ideas?????

  • Help! My iphoto changed how it displays and organizes I would love advice to get it back to the way it was!

    When I click on an event, in iphoto it brings up one large picture instead of the all the thumbnails. It also won't let me click to select a photo and drag and drop the photo. I have to copy and paste. Can anyone help me get it back to where it will