REGARDIN PERFORMANCE OF THE REPORT

hi experts,
i have a report which shows item wise purchase ledger based on the
selection of plant and material type and GR dates (from date and to date).
for getting data tables used r (ekbe,ekko,rbkp,rseg,mara,makt) ,problem is it is taking very long time to respond
even if i select 2days gr dates(such vast amnt of data exists in db tables) , my reqiurement is i have to change the report
or i have to write a new one , i have changed  the report,removed all joins and into coreesponding fields and *select ** and
select with in the loops ,  but still the report is taking very long time to respond.
can anybody pls suggest me the efficient way of data retrieving and if i go new report from where should i start.
thanks & regards
maheshlap

Please find below few of suggested changes.
1. Inplace of '=' use 'EQ'.
2. put check of ITEKBE[] is not initlal otherwise it will bring whole database into internal.
3. Read with binary search make sure table is sorted beforeloop.
4. no sory inside loop
5. no corresponding fields
6. Try not to use table with headerline
SELECT EKBE~EBELN EKBE~EBELP EKBE~BELNR --> Try to break it into two tables.
EKBE~BUDAT EKBE~BWART EKBE~MENGE EKBE~LFBNR
EKBE~MATNR EKBE~XBLN  EKBE~LSMEH  MARA~MEINS
MARA~MTART EKBE~WERKS FROM EKBE  INNER JOIN MARA
ON MARA~MATNR = EKBE~MATNR
INTO TABLE ITEKBE WHERE EKBE~BUDAT
IN S_B
UDAT AND MARA~MTART IN S_MTART AND EKBE~MATNR
   IN S_MATNR AND EKBE~WERKS IN S_WERKS AND EKBE~VGABE EQ '1' AND BWART EQ '101
   AND ( EKBE~LFBNR eq EKBE~BELNR ). "OR  EKBE~LFBNR eq ' ' ).
  IF ITEKBE[] IS not INITIAL.-->shold be not initial else it will bring whole database in itekko
    SELECT EBELN LIFNR FROM EKKO INTO TABLE ITEKKO FOR ALL ENTRIES IN ITEKBE
         WHERE EBELN eq ITEKBE-EBELN AND LIFNR IN S_LIFNR AND LIFNR  '0000000960'.
    SELECT MATNR MTART MEINS FROM MARA INTO TABLE ITMARA FOR ALL ENTRIES IN ITEKBE
            WHERE MATNR = ITEKBE-MATNR AND MTART IN S_MTART AND MATNR IN S_MATNR.
    IF ITMARA IS not  INITIAL..-->shold be not initial else it will bring whole database in itekko
      SELECT MATNR MAKTX FROM MAKT INTO TABLE ITMAKT FOR ALL ENTRIES IN ITMARA
                         WHERE MATNR EQ ITMARA-MATNR.
    ENDIF.
  ENDIF.
  LOOP AT ITEKBE.
    ITAB-EBELN = ITEKBE-EBELN.
    ITAB-EBELP = ITEKBE-EBELP.
    ITAB-BELNR = ITEKBE-BELNR.
    ITAB-MENGE = ITEKBE-MENGE.
    ITAB-BUDAT = ITEKBE-BUDAT.
    ITAB-LSMEH = ITEKBE-LSMEH.
    ITAB-BWART = ITEKBE-BWART.
    ITAB-LFBNR = ITEKBE-LFBNR.
    ITAB-DMBTR = ITEKBE-DMBTR.
    ITAB-WERKS = ITEKBE-WERKS.
    ITAB-MATNR = ITEKBE-MATNR.
    READ TABLE ITMARA WITH KEY MATNR = ITEKBE-MATNR.---> Use Binary Search make sure data is sort befor loop
    IF SY-SUBRC = 0.
      ITAB-MTART = ITMARA-MTART.
      ITAB-MEINS = ITMARA-MEINS.
    ENDIF.
    READ TABLE ITEKKO WITH KEY EBELN  = ITEKBE-EBELN..---> Use Binary Search
    IF SY-SUBRC = 0.
      ITAB-LIFNR = ITEKKO-LIFNR.
    ENDIF.
    READ TABLE ITMAKT WITH KEY MATNR = ITEKBE-MATNR..---> Use Binary Search
    IF SY-SUBRC = 0.
      ITAB-MAKTX = ITMAKT-MAKTX.
    ENDIF.
    APPEND ITAB.
    SORT ITAB BY EBELN.--> Dont use sort insdie loop
  ENDLOOP.
  SELECT EKBE~EBELN EKBE~EBELP EKBE~BELNR
EKBE~BUDAT EKBE~BWART EKBE~MENGE EKBE~LFBNR EKBE~MATNR EKBE~XWSBR
    EKBE~LSMEH FROM EKBE
    INNER JOIN MARA ON MARA~MANDT = EKBE~MANDT
       AND MARA~MATNR = EKBE~MATNR
      INNER JOIN EKKO ON EKKO~MANDT = EKBE~MANDT
       AND EKKO~EBELN = EKBE~EBELN
    INTO CORRESPONDING FIELDS OF TABLE ITAB1 WHERE EKBE~BUDAT IN S_BUDAT
      AND MARA~MTART IN S_MTART AND EKKO~LIFNR IN S_LIFNR
      AND EKBE~MATNR IN S_MATNR AND EKBE~WERKS IN S_WERKS AND EKBE~VGABE = '1'
        AND BWART IN ('102', '122') .  "and ekbe~XWSBR = ' '

Similar Messages

  • Low Performance in the report with cell defition

    Hi all,
    In one of our queries (3.5), we had to use lots of cell definition. And after execution of the report, it stays in "Formatting Result Area" and "Retrieving Result from BW Server" for a very long time (about 30 minutes).
    There is already aggregate on the infoprovider and report uses it.
    Is there any way to increase reporting performance of a report with lots of cell definitions ?
    Thanks
    SP

    Arun,
    Can you please explain what is precalculation and how to use it in Bex?
    Thanks in advance.
    SP

  • Performance of the Report Program

    Hello experts,
    I had a requirement like following
    Selection parameters:
    Material (lips-matnr)
    Sold to party(likp-kunag): can hardcode it to 5090
    Sales Org(likp-vkorg)
    Plant(lips-werks) : hard code it to plant:9000
    Sales order(likp-vbeln)
    Actual goods movement dates(likp-wadat_ist)
    Invoice number
    Sales order
    Output
    material numberlips~matnr ( should Display only S* materials and material type FERT)
    Serial number of the device shipped (objk-sernr)
    Delivery number (lips~vbeln)
    Invoice number (vbrp-vbeln)
    Invoice price=Vbrp-vbeln/quantity (invoice price)
    Notification number (Viqmel-QMNUm)
    KBB Repair Level(VIQMEL-QMTXT from QMCOD )
    KBC Repair level(VIQMMA-MNCOD from KBC-SM07 code group(VIQMMA-MNGRP))
    and I wrote a program but its taking lot of time to run
    Can anyone help me in changing the logic of the program,
    TABLES: likp, lips, vbfa, vbak.
    TYPE-POOLS: slis.
       / Selection and Input Parameters
    SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-003.
    SELECT-OPTIONS: s_matnr FOR lips-matnr,
                    s_kunag FOR likp-kunag.
    SELECT-OPTIONS: s_vkorg FOR likp-vkorg NO INTERVALS,
                    s_werks FOR lips-werks.
    SELECT-OPTIONS: s_vbeln FOR likp-vbeln,
                    s_waist FOR likp-wadat_ist.
    SELECT-OPTIONS: s_vgbel FOR lips-vgbel.
    SELECTION-SCREEN END OF BLOCK block2.
    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
    TYPES: BEGIN OF ty_data,
            matnr LIKE lips-matnr,
            lsernr LIKE mase-lsernr,
            vbeln LIKE likp-vbeln,
            invno like vbrp-vbeln,
            netwr like vbrp-netwr,
            qmnum LIKE viqmel-qmnum,
            mngrp like viqmma-mngrp,
            mncod like viqmma-mncod,
           END OF ty_data.
    DATA: gt_data TYPE TABLE OF ty_data WITH HEADER LINE.
    START-OF-SELECTION.
      PERFORM get_data.
      IF NOT gt_data[] IS INITIAL.
        PERFORM display_data.
      ELSE.
        MESSAGE s000(z1) WITH 'No data found'.
      ENDIF.
    *& Form get_data
    FORM get_data.
      SELECT lips~matnr mase~lsernr likp~vbeln vbrp~vbeln vbrp~netwr
              viqmel~qmnum viqmel~qmcod viqmma~mngrp viqmma~mncod
      INTO CORRESPONDING FIELDS OF TABLE gt_data
      FROM likp INNER JOIN lips ON lips~vbeln = likp~vbeln
                INNER JOIN vbrp ON vbrp~vgbel = lips~vgbel AND
                                   vbrp~matnr = lips~matnr
                INNER JOIN mase ON mase~matnr = lips~matnr
                INNER JOIN viqmel ON viqmel~matnr = lips~matnr AND
                                     viqmel~serialnr = mase~lsernr
                INNER JOIN viqmma ON viqmma~qmnum = viqmel~qmnum
                  WHERE lips~matnr IN s_matnr
                  AND lips~werks IN s_werks
                  AND likp~kunag IN s_kunag
                  AND likp~wadat_ist IN s_waist
                  AND lips~vgbel IN s_vgbel
                  AND likp~vkorg IN s_vkorg
                  and likp~vbeln in s_vbeln
                  AND lips~matnr LIKE 'S%'
                  AND EXISTS ( SELECT * FROM mara WHERE matnr = lips~matnr
                                             AND mtart = 'FERT' ).
    ENDFORM. " get_data
                 & Form display_data
    FORM display_data.
      DATA: lv_repid TYPE sy-repid.
      lv_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                i_program_name     = lv_repid
                i_internal_tabname = 'GT_DATA'
           CHANGING
                ct_fieldcat        = gt_fieldcat[].
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                i_callback_program = lv_repid
                it_fieldcat        = gt_fieldcat
                i_save             = 'A'
           TABLES
                t_outtab           = gt_data.
    ENDFORM.

    U can try two things instead of the EXISTS where clause.
    1. U have select-option for matnr so need to use that
    2. Inner join LIPS to mara on matnr and apply the filter on MTART field.
    SELECT lipsmatnr maselsernr likpvbeln vbrpvbeln vbrp~netwr
    viqmelqmnum viqmelqmcod viqmmamngrp viqmmamncod
    INTO CORRESPONDING FIELDS OF TABLE gt_data
    FROM likp INNER JOIN lips ON lipsvbeln = likpvbeln
    INNER JOIN vbrp ON vbrpvgbel = lipsvgbel AND
    vbrpmatnr = lipsmatnr
    INNER JOIN mase ON masematnr = lipsmatnr
    INNER JOIN mara on lipsmatnr = maramatnr
    INNER JOIN viqmel ON viqmelmatnr = lipsmatnr AND
    viqmelserialnr = maselsernr
    INNER JOIN viqmma ON viqmmaqmnum = viqmelqmnum
    WHERE lips~matnr IN s_matnr
    AND lips~werks IN s_werks
    AND likp~kunag IN s_kunag
    AND likp~wadat_ist IN s_waist
    AND lips~vgbel IN s_vgbel
    AND likp~vkorg IN s_vkorg
    and likp~vbeln in s_vbeln
    AND lips~matnr LIKE 'S%'
    and mara~mtart = 'FERT'.
    Regards
    Anurag
    Message was edited by: Anurag Bankley

  • How to improve the query performance in to report level and designer level

    How to improve the query performance in to report level and designer level......?
    Plz let me know the detail view......

    first its all based on the design of the database, universe and the report.
    at the universe Level, you have to check your Contexts very well to get the optimal performance of the universe and also your joins, keep your joins with key fields, will give you the best performance.
    at the report level, try to make the reports dynamic as much as you can, (Parameters) and so on.
    and when you create a paremeter try to get it match with the key fields in the database.
    good luck
    Amr

  • How to optimize the performance of crystal report?

    Hi,
    -I have to design a crystal report with best possible optimization. Optimization is main concern since report will run against 1-2 million data set. Though I am using parameter to fetch only the required data, required data can go till 1 million records.
    -Based on the input passed by the user I have to group the data in report. And for each selected parameter the Detail section I am printing is different. For example:-If user selects store then detail section is different and if user select Host then detail section will be different.
    -Report can be grouped by Time Field also. So to full fill this requirement I would have to create a sub report since other parameters are of string type and can be used in one formula to get parameter based grouping in report. However If I try to return Time filed from the same formula I get the errors the "Return type should be of String typeu201D. This forces me to create sub report for Time based grouping. If user selects Time Field to be grouped on, all the information in the main report gets suppressed and only the sub report gets printed.
    If user select store, Host and User in parameter to be grouped on, sub report gets suppressed.
    Now with the above mentioned points I tried to optimize the report in following way.
    -Printing 1 million records in the report does not make sense; hence we wanted to show the summary of all the records in chart section but wanted to print just 5000 records in detailed section. Suppressing detailed section after 5000 records does not help much since suppressing just saves the time in printing and does not limit the number of records to be fetched from the DB.I have a subreport also so it fetches the data 2 times from the DB hence makes the performance of the report worse.
    To solve this problem I used command object and put the charts in the subreport and detail in main report.
    In main report's Command Object I limited the number to records to be fetched from the DB to 5000 using rownum<5000 but in subreport's Command Object I did not set any limit in the query but I am doing all my aggregation in SQL which means do summary operation in DB and get only summarized data from DB.
    -To solve section problem I am using Template object (new feature added in CR 2008).In which I am returning the field based on the "Group By" parameter selected by user.
    -For time Field I have created two sub reports, one for chart and other one for details in the same way described in point one(Printing 1 million recordsu2026u2026).
    After implementing these points my crystal reports performance improved drastically. The report that was taking 24 minute to come back now taking only 2 minutes.
    However I want my report to come back with one minute. It returns if I remove the sub reports for Time Based Grouping but I can not do so.
    My questions here are,
    -Can I stop Subreport from fetching the data from DB if itu2019s suppressed?
    -I believe using Conditional Template Object is a better option rather than having multiple detailed sections to print the data for a selected Group. However any suggestion here to improve the performance will be appreciable.
    -since crystal report does not provide any option to limit the number of records to be fetched from DB, I am forced to use command object with rownum in where condition.
        Please let me know about other option(s) to get this done...If there is any.
    I am using Crystal report 2008.And we have developed our application the use JRC to export crystal report in PDF.
    Regards,
    Amrita
    Edited by: Amrita Singh on May 12, 2009 11:36 AM

    1) I have to design a crystal report with best possible optimization. Optimization is main concern since report will run against 1-2 million data set. Though I am using parameter to fetch only the required data, required data can go till 1 million records.
    2) Based on the input passed by the user I have to group the data in report. And for each selected parameter the Detail section I am printing is different. For example:-If user selects store then detail section is different and if user select Host then detail section will be different.
    3) Report can be grouped by Time Field also. So to full fill this requirement I would have to create a sub report since other parameters are of string type and can be used in one formula to get parameter based grouping in report. However If I try to return Time filed from the same formula I get the errors the "Return type should be of String typeu201D. This forces me to create sub report for Time based grouping. If user selects Time Field to be grouped on, all the information in the main report gets suppressed and only the sub report gets printed.
    If user select store, Host and User in parameter to be grouped on, sub report gets suppressed.
    Now with the above mentioned points I tried to optimize the report in following way.
    1) Printing 1 million records in the report does not make sense; hence we wanted to show the summary of all the records in chart section but wanted to print just 5000 records in detailed section. Suppressing detailed section after 5000 records does not help much since suppressing just saves the time in printing and does not limit the number of records to be fetched from the DB.I have a subreport also so it fetches the data 2 times from the DB hence makes the performance of the report worse.
    To solve this problem I used command object and put the charts in the subreport and detail in main report.
    In main report's Command Object I limited the number to records to be fetched from the DB to 5000 using rownum<5000 but in subreport's Command Object I did not set any limit in the query but I am doing all my aggregation in SQL which means do summary operation in DB and get only summarized data from DB.
    2)To solve section problem I am using Template object (new feature added in CR 2008).In which I am returning the field based on the "Group By" parameter selected by user.
    Edited by: Amrita Singh on May 12, 2009 12:26 PM

  • Performance of a Report Based On VirtualProvider

    Dear BW experts,
    We have created a new BEx 3.x report, which contains about 6 queries, and 2 pre queries.
    The report runs very slowly, the upload time is about 40 seconds.
    The report itself contains one tab with 11 tables.
    The MultiProvider that the queries are based on is a virtual InfoCube, so we can't use aggregates.
    Could someone advice us how to optimize the performance of the report?
    Thanks you in advance.
    Best Regards,
    Inbal.

    Hi,
    Query variables are not passed only to the virtual provider by default, i.e enter dataset of the extractor is pulled the data manager and then it is filtered out which could the issue for the long runtimes.
    If the datasource of the virtual provider has selections then we could passed those from the query to the datasource while query execution at the inverse start routine and reduce the amount of data actual pulled by the virtual provider and hence improve the performance of the query.
    Below is the link to the sap documentation on inverse routine.
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/45/f5af4a4db53482e10000000a1553f6/content.htm
    Thanks,
    Arun

  • Performance issue of report

    Hi Friends,
    Can you please give me the exact answer for the below question.
    Suppose my report program is taking long time to execute, what are the reasons that may effect the report.
    and what are the remedies should i follow, please provide appropriate answer.
    Advance thanks,
    Chandra.

    hi,,
    Go to tranx SE30 here you will get Tips and Trciks for the performance tuning.
    Check it carefully and check whether you can do something for improving performance of you code.
    It will help you a lot and will reduce your Execution time.
    If you are using READ TABLE command in your program then you can check whether you can use HASHED TABLE it will improve performance of your code a lot but it has some restrictions.
    I will explain some of the points to improve the performance of the report try to write code according to that ok.
    SOME STEPS USED TO IMPROVE UR PERFORMANCE:
    1. Avoid using SELECT...ENDSELECT... construct and use SELECT ... INTO TABLE.
    2. Use WHERE clause in your SELECT statement to restrict the volume of data retrieved.
    3. Design your Query to Use as much index fields as possible from left to right in your WHERE statement
    4. Use FOR ALL ENTRIES in your SELECT statement to retrieve the matching records at one shot.
    5. Avoid using nested SELECT statement, SELECT within LOOPs.
    6. Avoid using INTO CORRESPONDING FIELDS OF TABLE. Instead use INTO TABLE.
    7. Avoid using SELECT * and Select only the required fields from the table.
    8. Avoid nested loops when working with large internal tables.
    9. Use assign instead of into in LOOPs for table types with large work areas
    10. When in doubt call transaction SE30 and use the examples and check your code
    11. Whenever using READ TABLE use BINARY SEARCH addition to speed up the search. Be sure to sort the internal table before binary search. This is a general thumb rule but typically if you are sure that the data in internal table is less than 200 entries you need not do SORT and use BINARY SEARCH since this is an overhead in performance.
    12. Use "CHECK" instead of IF/ENDIF whenever possible.
    13. Use "CASE" instead of IF/ENDIF whenever possible.
    14. Use "MOVE" with individual variable/field moves instead of "MOVE-
    CORRESPONDING", creates more coding but is more effcient.
    Reward points if helpful.
    regards,
    rekha

  • Performance issue webi report-BOXI3.1

    Hi,
    We have a requirement for a report where we will give user a set of objects (26 u2013 31) to do analysis using interactive viewing feature. Here we are facing severe performance issues and memory issues as the data that we are calling is huge( around 6 million records). At the report level we will be summarizing the data.
    No of rows in the report is depending on the no of objects.
    Mode of view : Interactive view.
    Note:
    1. Objects which are using in conditional level those have indexes.
    2. No of report level variable are two.
    3. Version of Business objects: BOXI3.1
    4. OS: Sun Solaris
    Please let me know if there are any means by which the memory requirements for the report can be minimized/ performance of the report can be improved.
    Thanks,
    Subash

    Subash,
    At the report level we will be summarizing the data ... any means by which the memory requirements for the report can be minimized/ performance of the report can be improved
    Is there any way that you can summarize this on the database side versus the report level?  The database should be sized with memory and disk space properly to handle these types of summarizations versus expecting the application to perform it.
    Thanks,
    John

  • Improve the performance of the code

    Hi All,
    Just check the below report and give some hits to improve the performance of the report.
      LOOP AT WBS_TAB.
        CLEAR: HOLD_PO_NBR,                                    
               HOLD_PO_LINE.                                   
        SELECT * FROM EKKN
                 WHERE PS_PSP_PNR = WBS_TAB-INTNO
                 AND EBELN IN S_PO
                 AND KOKRS = P_KOKRS.
          CHECK EKKN-LOEKZ <> 'X'.
          CLEAR GC_PROFL.
          WRITE WBS_TAB-PSPHI TO LC_PSPID.
    *select direct projects only if p_direct = 'X'.
          IF P_DIRECT = 'X'.                        
            SELECT SINGLE PROFL FROM PROJ INTO GC_PROFL        
                   WHERE PSPID = LC_PSPID.          
            IF GC_PROFL+4(3) = '002'                
            OR GC_PROFL+4(3) = '007'.               
              CONTINUE.                            
            ENDIF.                                  
          ENDIF.
    select indirect projects and cost centers only when p_indir = 'X'.
          IF P_INDIR = 'X'.                         
            SELECT SINGLE PROFL FROM PROJ INTO GC_PROFL        
                   WHERE PSPID = LC_PSPID.          
            IF GC_PROFL+4(3) NE '002'               
            AND GC_PROFL+4(3) NE '007'.             
              CONTINUE.                             
            ENDIF.                                  
          ENDIF.                                   
          CLEAR: GC_EINDT,                          
                 GC_PRCTR.                          
          GC_PRCTR = WBS_TAB-PRCTR.                 
          PERFORM PROCESS_MAIN2.
        ENDSELECT.
      ENDLOOP.
    FORM PROCESS_MAIN2.
      SELECT SINGLE * FROM EKKO WHERE EBELN = EKKN-EBELN.
      CHECK EKKO-LIFNR IN VEND_NO.
      CHECK EKKO-AEDAT IN S_POCDAT.                            
      SELECT SINGLE * FROM EKPO WHERE EBELN = EKKN-EBELN AND
                                      EBELP = EKKN-EBELP.
      CHECK EKPO-LOEKZ <> 'L' AND
            EKPO-LOEKZ <> 'S'.                                 
      SELECT SINGLE EINDT FROM EKET INTO GC_EINDT   
        WHERE EBELN = EKPO-EBELN                    
        AND EBELP   = EKPO-EBELP                    
        AND EINDT IN S_EINDT.                       
      IF NOT S_EINDT IS INITIAL.                   
        CHECK GC_EINDT IN S_EINDT.                  
      ENDIF.                                        
      CLEAR ITAB.
      ITAB-PO_CREATE = EKKO-AEDAT.                             
      ITAB-DEL_DAT   = GC_EINDT.                   
      ITAB-PO_NO     = EKKO-EBELN.
      ITAB-CURR_PO   = EKKO-WAERS.
      ITAB-CURR_CO   = TKA01-WAERS.
      ITAB-LINE      = EKPO-EBELP.
      ITAB-GR_SW     = EKPO-WEPOS.
      ITAB-GR_NON_VAL_SW = EKPO-WEUNB.
      IF EKPO-WEUNB = 'X'.                 "Goods Receipt, Non-Value
        ITAB-GR_SW = ''.        "switch evaluation of commitment to IR
      ENDIF.
      ITAB-TEXT       = EKPO-TXZ01.
      ITAB-QTY_ORD    = EKPO-MENGE.
      ITAB-UOM        = EKPO-MEINS.
      ITAB-AMOUNT_DOC = EKPO-EFFWR.
      ITAB-WBS = EKKN-PS_PSP_PNR.
      ITAB-COST_ELEM = EKKN-SAKTO.                             
      ITAB-KOSTL = EKKN-KOSTL.                                 
      ITAB-PRCTR = GC_PRCTR.
      ITAB-ANLN1 = EKKN-ANLN1.                                 
      ITAB-AUFNR = EKKN-AUFNR.                                
      ITAB-ZEKKN = EKKN-ZEKKN.                                 
      IF EKKN-VPROZ <> 0.
        PERCENT = EKKN-MENGE / EKPO-MENGE.
        ITAB-AMOUNT_DOC = ITAB-AMOUNT_DOC * PERCENT .
        ITAB-QTY_ORD = ITAB-QTY_ORD * PERCENT .
      ENDIF.
      IF ITAB-CURR_CO NE ITAB-CURR_PO.
      itab-amount_co = itab-amount_doc * ekko-wkurs.
           Convert from PO curr to CO currency
        GS_CONV_AMT = ITAB-AMOUNT_DOC / GS_CORATE.
        PERFORM GET_CURR_RATE USING ITAB-CURR_PO EKKO-AEDAT
                              CHANGING GS_RATE.
        ITAB-AMOUNT_CO =  GS_CONV_AMT * GS_RATE.
      ELSE.
        ITAB-AMOUNT_CO = ITAB-AMOUNT_DOC.
      ENDIF.
           Convert from PO curr to CO Code currency
      CLEAR: ITAB-CURR_LOC, GS_RATE.
      PERFORM GET_COCD_RATE USING EKKO-BUKRS
                            CHANGING ITAB-CURR_LOC GS_RATE.
      IF ITAB-CURR_LOC NE ITAB-CURR_PO.
                    Get company code/local currency and rate.
        GS_CONV_AMT = ITAB-AMOUNT_DOC / GS_RATE.
        PERFORM GET_CURR_RATE USING ITAB-CURR_PO ITAB-PO_CREATE
                              CHANGING GS_RATE.
        ITAB-AMOUNT_LOC =  GS_CONV_AMT * GS_RATE.
      ELSE.
        ITAB-AMOUNT_LOC = ITAB-AMOUNT_DOC.
      ENDIF.
      ITAB-VEND_NO   = EKKO-LIFNR.
      APPEND ITAB.
      CLEAR ITAB.
    ENDFORM.
    Thanks,
    Subbu.

    Hi,
    In your code instead of using
    SELECT * FROM EKKN
    WHERE PS_PSP_PNR = WBS_TAB-INTNO
    AND EBELN IN S_PO
    AND KOKRS = P_KOKRS.
    ENSELECT
    USe
    DATA:
    TYPES: BEGIN OF t_ekkn.
            INCLUDE STRUCTURE ekkn.
    TYPES: END OF t_ekkn.
    DATA: t_ekkn TYPE TABLE OF t_ekkn,
          t_ekkn_wa TYPE t_ekkn.
    FIELD-SYMBOLS: <t_ekkn> TYPE t_ekkn.
    SELECT * FROM EKKN
    INTO TABLE t_ekkn
    WHERE PS_PSP_PNR = WBS_TAB-INTNO
    AND EBELN IN S_PO
    AND KOKRS = P_KOKRS.
    Loop at t_ekkn assigning <t_ekkn>.
    Copy your existing logic between SELECT & ENDSELECT of EKKN
    Endloop.
    I hope this helps,
    Regards
    Raju Chitale

  • Eliminate duplicate rows from the report 6i output

    Hi All,
    I have generated a report output with the group by and summary options.
    For Ex: report has num and amount columns
    I had to sum the amount group by num
    NUM AMOUNT
    1 100
    1 50
    2 10
    2 100
    After group by and summary functions the report is generating the output as follows...
    NUM AMOUNT
    1 150
    1 150
    2 110
    2 110
    I want to eliminate the duplicate rows and want the output as follows...
    NUM AMOUNT
    1 150
    2 110
    I tried all the ways to implement distinct, but not able to.
    I donot want to implement distinct on the query but want to perform at the report level.
    Please help me in this ASAP.
    Thanks,
    Vijay

    It would be helpful if you post your query, should by something like
    SELECT NUM, SUM(AMOUNT)
      FROM TABLE
    GROUP BY NUM
    ORDER BY 1this would not create duplicates with your given example data.

  • What is the transaction to enable the olap cache in the report

    Hi all,
    please let me know what is the procedure to improve the performance of a query?
    how can i tune a report?what are the steps i need to take to improve the performance in the report?
    please mention all the transatction codes whare i have to check and what i need to do to achieve the good perfomance?
    thanks in advace,
    ashok.

    Primary Tcode is RSRT.
    Go mto RSRT and give your query name and select exceute _ debug.
    Then you will get a lots of options to run the report.
    Caching will set uo thru SPRO. Work with your Basis for this.
    Ravi Thothadri

  • Performance of Financial Reports against a ASO Cube to a BSO Cube

    Hi All,
    I am working on Financial Reporting and Essbase. I wanted to understand and find some relevant documentation, which tells about the performance issues or difference when a financial report hits a BSO cube or an ASO cube.
    1. If there is a difference in the performance for an ASO vs BSO for Financial Reports, where can I find the document or details for it?
    2. If there is a difference in the performance for an ASO vs BSO for Financial Reports, what is the reason for the same?
    3. How can we improve the ASO performance for the reports?
    Any insights for the same, would be highly appreciated.
    Thanks
    Ankur Jain.

    Thanks Sean V,
    Its quite amazing for me as well, and that is why I am trying drill into any of the FR documentation which might contain something like this. As of now,since I don't have access to the cube, I have nothing to add, nor have the insights to the cube, based upon which I could explain, more on the Cube and Outline design.
    But as soon as I get the access, I will bring this back and have a discussion on the forum.
    Thanks for confirming the same, of what I had been explaining to my Client side as well. Though, I still need some basis to explain and prove them exactly and a prototype as well, which might be needed as well.
    Thanks,
    Ankur Jain.

  • What is vendor performance report what are the fields using in the report

    What is vendor performance report what are the fields using in the report and i need some sample reports for that particular topic (clasical report)not using any alvs or any advance topics.
    U R Satish Patnaik

    hi
    good
    *"Table declarations...................................................
    TABLES:
    EKKO, " Purchasing Document Header
    CDHDR, " Change document header
    SSCRFIELDS. " Fields on selection screens
    *"Selection screen elements............................................
    SELECT-OPTIONS:
    S_EBELN FOR EKKO-EBELN, " Purchasing Document Number
    S_LIFNR FOR EKKO-LIFNR, " Vendor's account number
    S_EKGRP FOR EKKO-EKGRP, " Purchasing group
    S_BEDAT FOR EKKO-BEDAT, " Purchasing Document Date
    S_UDATE FOR CDHDR-UDATE. " Creation date of the change
    " document
    *" Data declarations...................................................
    Field String to hold Purchase Document Number *
    DATA:
    BEGIN OF FS_EBELN,
    EBELN(90) TYPE C, " Purchase Document Number
    ERNAM TYPE EKKO-ERNAM, " Name of Person who Created
    " the Object
    LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    EKGRP TYPE EKKO-EKGRP, " Purchasing group
    BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
    END OF FS_EBELN,
    Field String to hold Purchase Document Header *
    BEGIN OF FS_EKKO,
    EBELN TYPE EKKO-EBELN, " Purchasing Document Number
    ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
    " Object
    LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    EKGRP TYPE EKKO-EKGRP, " Purchasing group
    BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
    END OF FS_EKKO,
    Field String to hold Account Number and name of the Vendor *
    BEGIN OF FS_LFA1,
    LIFNR TYPE LFA1-LIFNR, " Account Number of Vendor
    NAME1 TYPE LFA1-NAME1, " Name1
    END OF FS_LFA1,
    Field String to hold Change date and the name of the user *
    BEGIN OF FS_CDHDR,
    OBJECTCLAS TYPE CDHDR-OBJECTCLAS, " Object Class
    OBJECTID TYPE CDHDR-OBJECTID, " Object value
    CHANGENR TYPE CDHDR-CHANGENR, " Document change number
    USERNAME TYPE CDHDR-USERNAME, " User name
    UDATE TYPE CDHDR-UDATE, " Creation date of the change
    " document
    END OF FS_CDHDR,
    Field String to hold Change document items *
    BEGIN OF FS_CDPOS,
    OBJECTCLAS TYPE CDPOS-OBJECTCLAS," Object class
    OBJECTID(10) TYPE C, " Object Value
    CHANGENR TYPE CDPOS-CHANGENR, " Document change number
    TABNAME TYPE CDPOS-TABNAME, " Table Name
    FNAME TYPE CDPOS-FNAME, " Field Name
    VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
    VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
    END OF FS_CDPOS,
    Field String to hold Date Element Name *
    BEGIN OF FS_DATAELE,
    TABNAME TYPE DD03L-TABNAME, " Table Name
    FIELDNAME TYPE DD03L-FIELDNAME, " Field Name
    ROLLNAME TYPE DD03L-ROLLNAME, " Data element (semantic domain)
    END OF FS_DATAELE,
    Field String to hold Short Text of the Date Element *
    BEGIN OF FS_TEXT,
    ROLLNAME TYPE DD04T-ROLLNAME, " Data element (semantic domain)
    DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
    " Repository Objects
    END OF FS_TEXT,
    Field String to hold data to be displayed on the ALV grid *
    BEGIN OF FS_OUTTAB,
    EBELN TYPE EKKO-EBELN, " Purchasing Document Number
    ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
    " Object
    LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    EKGRP TYPE EKKO-EKGRP, " Purchasing group
    BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
    WERKS TYPE LFA1-WERKS, " Plant
    NAME1 TYPE LFA1-NAME1, " Name1
    USERNAME TYPE CDHDR-USERNAME, " User name
    UDATE TYPE CDHDR-UDATE, " Creation date of the change
    " document
    DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
    " Repository Objects
    VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
    VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
    END OF FS_OUTTAB,
    Internal table to hold Purchase Document Number *
    T_EBELN LIKE STANDARD TABLE
    OF FS_EBELN,
    Internal table to hold Purchase Document Header *
    T_EKKO LIKE STANDARD TABLE
    OF FS_EKKO,
    Temp Internal table to hold Purchase Document Header *
    T_EKKO_TEMP LIKE STANDARD TABLE
    OF FS_EKKO,
    Internal table to hold Account number and Name of the Vendor *
    T_LFA1 LIKE STANDARD TABLE
    OF FS_LFA1,
    Internal Table to hold Change date and the name of the user *
    T_CDHDR LIKE STANDARD TABLE
    OF FS_CDHDR,
    Internal Table to hold Change document items *
    T_CDPOS LIKE STANDARD TABLE
    OF FS_CDPOS,
    Temp. Internal Table to hold Change document items *
    T_CDPOS_TEMP LIKE STANDARD TABLE
    OF FS_CDPOS,
    Internal Table to hold Data Element Name *
    T_DATAELE LIKE STANDARD TABLE
    OF FS_DATAELE,
    Temp. Internal Table to hold Data Element Name *
    T_DATAELE_TEMP LIKE STANDARD TABLE
    OF FS_DATAELE,
    Internal Table to hold Short Text of the Date Element *
    T_TEXT LIKE STANDARD TABLE
    OF FS_TEXT,
    Internal Table to hold data to be displayed on the ALV grid *
    T_OUTTAB LIKE STANDARD TABLE
    OF FS_OUTTAB.
    C L A S S D E F I N I T I O N *
    CLASS LCL_EVENT_HANDLER DEFINITION DEFERRED.
    *" Data declarations...................................................
    Work variables *
    DATA:
    W_EBELN TYPE EKKO-EBELN, " Purchasing Document Number
    W_LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    W_EKGRP TYPE EKKO-EKGRP, " Purchasing group
    W_VALUE TYPE EKKO-EBELN, " Reflected Value
    W_SPACE VALUE ' ', " Space
    W_FLAG TYPE I, " Flag Variable
    W_VARIANT TYPE DISVARIANT, " Variant
    *--- ALV Grid
    W_GRID TYPE REF TO CL_GUI_ALV_GRID,
    *--- Event Handler
    W_EVENT_CLICK TYPE REF TO LCL_EVENT_HANDLER,
    *--- Field catalog table
    T_FIELDCAT TYPE LVC_T_FCAT.
    AT SELECTION-SCREEN EVENT *
    AT SELECTION-SCREEN ON S_EBELN.
    Subroutine to validate Purchase Document Number.
    PERFORM VALIDATE_PD_NUM.
    AT SELECTION-SCREEN ON S_LIFNR.
    Subroutine to validate Vendor Number.
    PERFORM VALIDATE_VEN_NUM.
    AT SELECTION-SCREEN ON S_EKGRP.
    Subroutine to validate Purchase Group.
    PERFORM VALIDATE_PUR_GRP.
    START-OF-SELECTION EVENT *
    START-OF-SELECTION.
    Subroutine to select all Purchase orders.
    PERFORM SELECT_PO.
    CHECK W_FLAG EQ 0.
    Subroutine to select Object values.
    PERFORM SELECT_OBJ_ID.
    CHECK W_FLAG EQ 0.
    Subroutine to select Changed values.
    PERFORM SELECT_CHANGED_VALUE.
    CHECK W_FLAG EQ 0.
    Subroutine to Select Purchase Orders.
    PERFORM SELECT_PUR_DOC.
    Subroutine to select Vendor Details.
    PERFORM SELECT_VENDOR.
    Subroutine to select Text for the Changed values.
    PERFORM DESCRIPTION.
    END-OF-SELECTION EVENT *
    END-OF-SELECTION.
    IF NOT T_EKKO IS INITIAL.
    Subroutine to populate the Output Table.
    PERFORM FILL_OUTTAB.
    Subroutine to build Field Catalog.
    PERFORM PREPARE_FIELD_CATALOG CHANGING T_FIELDCAT.
    CALL SCREEN 100.
    ENDIF. " IF NOT T_EKKO...
    CLASS LCL_EVENT_HANDLER DEFINITION
    Defining Class which handles events
    CLASS LCL_EVENT_HANDLER DEFINITION .
    PUBLIC SECTION .
    METHODS:
    HANDLE_HOTSPOT_CLICK
    FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
    IMPORTING E_ROW_ID E_COLUMN_ID.
    ENDCLASS. " LCL_EVENT_HANDLER DEFINITION
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION
    Implementing the Class which can handle events
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION .
    *---Handle Double Click
    METHOD HANDLE_HOTSPOT_CLICK .
    Subroutine to get the HotSpot Cell information.
    PERFORM GET_CELL_INFO.
    SET PARAMETER ID 'BES' FIELD W_VALUE.
    CALL TRANSACTION 'ME23N'.
    ENDMETHOD. " HANDLE_HOTSPOT_CLICK
    ENDCLASS. " LCL_EVENT_HANDLER
    *& Module STATUS_0100 OUTPUT
    PBO Event
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'OOPS'.
    SET TITLEBAR 'TIT'.
    Subroutine to fill the Variant Structure
    PERFORM FILL_VARIANT.
    IF W_GRID IS INITIAL.
    CREATE OBJECT W_GRID
    EXPORTING
    I_SHELLSTYLE = 0
    I_LIFETIME =
    I_PARENT = CL_GUI_CONTAINER=>SCREEN0
    I_APPL_EVENTS =
    I_PARENTDBG =
    I_APPLOGPARENT =
    I_GRAPHICSPARENT =
    I_NAME =
    I_FCAT_COMPLETE = SPACE
    EXCEPTIONS
    ERROR_CNTL_CREATE = 1
    ERROR_CNTL_INIT = 2
    ERROR_CNTL_LINK = 3
    ERROR_DP_CREATE = 4
    OTHERS = 5.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF. " IF SY-SUBRC <> 0
    CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT = W_VARIANT
    I_SAVE = 'A'
    I_DEFAULT = 'X'
    IS_LAYOUT =
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    IR_SALV_ADAPTER =
    CHANGING
    IT_OUTTAB = T_OUTTAB
    IT_FIELDCATALOG = T_FIELDCAT
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    INVALID_PARAMETER_COMBINATION = 1
    PROGRAM_ERROR = 2
    TOO_MANY_LINES = 3
    OTHERS = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF. " IF SY-SUBRC <> 0.
    ENDIF. " IF W_GRID IS INITIAL
    CREATE OBJECT W_EVENT_CLICK.
    SET HANDLER W_EVENT_CLICK->HANDLE_HOTSPOT_CLICK FOR W_GRID.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    PAI Event
    MODULE USER_COMMAND_0100 INPUT.
    CASE SY-UCOMM.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    WHEN 'CANCEL'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Form PREPARE_FIELD_CATALOG
    Subroutine to build the Field catalog
    <--P_T_FIELDCAT Field Catalog Table
    FORM PREPARE_FIELD_CATALOG CHANGING PT_FIELDCAT TYPE LVC_T_FCAT .
    DATA LS_FCAT TYPE LVC_S_FCAT.
    Purchasing group...
    LS_FCAT-FIELDNAME = 'EKGRP'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Purchasing Document Number...
    LS_FCAT-FIELDNAME = 'EBELN'.
    LS_FCAT-REF_TABLE = 'EKKO' .
    LS_FCAT-EMPHASIZE = 'C411'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-HOTSPOT = 'X'.
    APPEND LS_FCAT TO PT_FIELDCAT .
    CLEAR LS_FCAT .
    Name of Person who Created the Object...
    LS_FCAT-FIELDNAME = 'ERNAM'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-OUTPUTLEN = '15' .
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Purchasing Document Date...
    LS_FCAT-FIELDNAME = 'BEDAT'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Vendor's account number...
    LS_FCAT-FIELDNAME = 'LIFNR'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Account Number of Vendor or Creditor...
    LS_FCAT-FIELDNAME = 'NAME1'.
    LS_FCAT-REF_TABLE = 'LFA1'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-COLTEXT = 'Vendor Name'(001).
    LS_FCAT-SELTEXT = 'Vendor Name'(001).
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Creation date of the change document...
    LS_FCAT-FIELDNAME = 'UDATE'.
    LS_FCAT-REF_TABLE = 'CDHDR'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-COLTEXT = 'Change Date'(002).
    LS_FCAT-SELTEXT = 'Change Date'(002).
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    User name of the person responsible in change document...
    LS_FCAT-FIELDNAME = 'USERNAME'.
    LS_FCAT-REF_TABLE = 'CDHDR'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-COLTEXT = 'Modified by'(003).
    LS_FCAT-SELTEXT = 'Modified by'(003).
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Short Text Describing R/3 Repository Objects...
    LS_FCAT-FIELDNAME = 'DDTEXT'.
    LS_FCAT-REF_TABLE = 'DD04T'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '15'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Old contents of changed field...
    LS_FCAT-FIELDNAME = 'VALUE_OLD'.
    LS_FCAT-REF_TABLE = 'CDPOS'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '12'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    New contents of changed field...
    LS_FCAT-FIELDNAME = 'VALUE_NEW'.
    LS_FCAT-REF_TABLE = 'CDPOS'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '12'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    ENDFORM. " PREPARE_FIELD_CATALOG
    *& Form SELECT_PO
    Subroutine to select all the Purchase Orders
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_PO .
    SELECT EBELN " Purchasing Document Number
    ERNAM " Name of Person who Created
    " the Object
    LIFNR " Vendor's account number
    EKGRP " Purchasing group
    BEDAT " Purchasing Document Date
    FROM EKKO
    PACKAGE SIZE 10000
    APPENDING TABLE T_EBELN
    WHERE EBELN IN S_EBELN
    AND BEDAT IN S_BEDAT.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    W_FLAG = 1.
    MESSAGE S401(M8).
    ENDIF. " IF SY-SUBRC NE 0
    ENDFORM. " SELECT_PO
    *& Form SELECT_OBJ_ID
    Subroutine to select Object ID
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_OBJ_ID .
    IF NOT T_EBELN IS INITIAL.
    SELECT OBJECTCLAS " Object Class
    OBJECTID " Object value
    CHANGENR " Document change number
    USERNAME " User name
    UDATE " Creation date
    FROM CDHDR
    INTO TABLE T_CDHDR
    FOR ALL ENTRIES IN T_EBELN
    WHERE OBJECTID EQ T_EBELN-EBELN
    AND UDATE IN S_UDATE
    AND TCODE IN ('ME21N','ME22N','ME23N').
    ENDSELECT.
    IF SY-SUBRC NE 0.
    W_FLAG = 1.
    MESSAGE S833(M8) WITH 'Header Not Found'(031).
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_EBELN IS INITIAL
    ENDFORM. " SELECT_OBJ_ID
    *& Form SELECT_CHANGED_VALUE
    Subroutine to select Changed Values
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_CHANGED_VALUE .
    IF NOT T_CDHDR IS INITIAL.
    SELECT OBJECTCLAS " Object class
    OBJECTID " Object value
    CHANGENR " Document change number
    TABNAME " Table Name
    FNAME " Field Name
    VALUE_NEW " New contents of changed field
    VALUE_OLD " Old contents of changed field
    FROM CDPOS
    PACKAGE SIZE 10000
    APPENDING TABLE T_CDPOS
    FOR ALL ENTRIES IN T_CDHDR
    WHERE OBJECTCLAS EQ T_CDHDR-OBJECTCLAS
    AND OBJECTID EQ T_CDHDR-OBJECTID
    AND CHANGENR EQ T_CDHDR-CHANGENR.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    W_FLAG = 1.
    MESSAGE S833(M8) WITH 'Item Not Found'(032).
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_CDHDR IS INITIAL
    T_CDPOS_TEMP[] = T_CDPOS[].
    ENDFORM. " SELECT_CHANGED_VALUE
    *& Form SELECT_PUR_DOC
    Subroutine to select Purchase Order Details
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_PUR_DOC .
    IF NOT T_CDPOS IS INITIAL.
    SORT T_EBELN BY EBELN.
    LOOP AT T_CDPOS INTO FS_CDPOS.
    READ TABLE T_EBELN INTO FS_EBELN WITH KEY EBELN =
    FS_CDPOS-OBJECTID BINARY SEARCH.
    IF SY-SUBRC NE 0.
    DELETE TABLE T_EBELN FROM FS_EBELN.
    ENDIF. " IF SY-SUBRC NE 0.
    ENDLOOP. " LOOP AT T_CDPOS...
    LOOP AT T_EBELN INTO FS_EBELN.
    MOVE FS_EBELN-EBELN TO FS_EKKO-EBELN.
    MOVE FS_EBELN-ERNAM TO FS_EKKO-ERNAM.
    MOVE FS_EBELN-LIFNR TO FS_EKKO-LIFNR.
    MOVE FS_EBELN-EKGRP TO FS_EKKO-EKGRP.
    MOVE FS_EBELN-BEDAT TO FS_EKKO-BEDAT.
    APPEND FS_EKKO TO T_EKKO.
    ENDLOOP. " LOOP AT T_EBELN...
    T_EKKO_TEMP[] = T_EKKO[].
    ENDIF. " IF NOT T_CDPOS IS INITIAL
    ENDFORM. " SELECT_PUR_DOC
    *& Form SELECT_VENDOR
    Subroutine to select Vendor details
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_VENDOR .
    IF NOT T_EKKO IS INITIAL.
    SORT T_EKKO_TEMP BY LIFNR.
    DELETE ADJACENT DUPLICATES FROM T_EKKO_TEMP COMPARING LIFNR.
    SELECT LIFNR " Account Number of Vendor or
    " Creditor
    NAME1 " Name 1
    FROM LFA1
    INTO TABLE T_LFA1
    FOR ALL ENTRIES IN T_EKKO_TEMP
    WHERE LIFNR EQ T_EKKO_TEMP-LIFNR.
    IF SY-SUBRC NE 0.
    MESSAGE S002(M8) WITH 'Master Details'(033).
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_EKKO IS INITIAL
    ENDFORM. " SELECT_VENDOR
    *& Form DESCRIPTION
    Subroutine to get the description
    There are no interface parameters to be passed to this subroutine.
    FORM DESCRIPTION .
    IF NOT T_CDPOS IS INITIAL.
    SORT T_CDPOS_TEMP BY TABNAME FNAME.
    DELETE ADJACENT DUPLICATES FROM T_CDPOS_TEMP COMPARING TABNAME FNAME
    SELECT TABNAME " Table Name
    FIELDNAME " Field Name
    ROLLNAME " Data element
    FROM DD03L
    INTO TABLE T_DATAELE
    FOR ALL ENTRIES IN T_CDPOS_TEMP
    WHERE TABNAME EQ T_CDPOS_TEMP-TABNAME
    AND FIELDNAME EQ T_CDPOS_TEMP-FNAME.
    IF NOT T_DATAELE IS INITIAL.
    T_DATAELE_TEMP[] = T_DATAELE[].
    SORT T_DATAELE_TEMP BY ROLLNAME.
    DELETE ADJACENT DUPLICATES FROM T_DATAELE_TEMP COMPARING ROLLNAME.
    SELECT ROLLNAME " Data element
    DDTEXT " Short Text Describing R/3
    " Repository Objects
    FROM DD04T
    INTO TABLE T_TEXT
    FOR ALL ENTRIES IN T_DATAELE_TEMP
    WHERE ROLLNAME EQ T_DATAELE_TEMP-ROLLNAME
    AND DDLANGUAGE EQ SY-LANGU.
    IF SY-SUBRC NE 0.
    EXIT.
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_DATAELE IS INITIAL.
    ENDIF. " IF NOT T_CDPOS IS INITIAL.
    ENDFORM. " DESCRIPTION
    *& Form FILL_OUTTAB
    Subroutine to populate the Outtab
    There are no interface parameters to be passed to this subroutine.
    FORM FILL_OUTTAB .
    SORT T_CDHDR BY OBJECTCLAS OBJECTID CHANGENR.
    SORT T_EKKO BY EBELN.
    SORT T_LFA1 BY LIFNR.
    SORT T_DATAELE BY TABNAME FIELDNAME.
    SORT T_TEXT BY ROLLNAME.
    LOOP AT T_CDPOS INTO FS_CDPOS.
    READ TABLE T_CDHDR INTO FS_CDHDR WITH KEY
    OBJECTCLAS = FS_CDPOS-OBJECTCLAS
    OBJECTID = FS_CDPOS-OBJECTID
    CHANGENR = FS_CDPOS-CHANGENR
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_CDHDR-USERNAME TO FS_OUTTAB-USERNAME.
    MOVE FS_CDHDR-UDATE TO FS_OUTTAB-UDATE.
    READ TABLE T_EKKO INTO FS_EKKO WITH KEY
    EBELN = FS_CDHDR-OBJECTID
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_EKKO-EBELN TO FS_OUTTAB-EBELN.
    MOVE FS_EKKO-ERNAM TO FS_OUTTAB-ERNAM.
    MOVE FS_EKKO-LIFNR TO FS_OUTTAB-LIFNR.
    MOVE FS_EKKO-EKGRP TO FS_OUTTAB-EKGRP.
    MOVE FS_EKKO-BEDAT TO FS_OUTTAB-BEDAT.
    READ TABLE T_LFA1 INTO FS_LFA1 WITH KEY
    LIFNR = FS_EKKO-LIFNR
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_LFA1-NAME1 TO FS_OUTTAB-NAME1.
    ENDIF. " IF SY-SUBRC EQ 0.
    ENDIF. " IF SY-SUBRC EQ 0.
    ENDIF. " IF SY-SUBRC EQ 0.
    MOVE FS_CDPOS-VALUE_NEW TO FS_OUTTAB-VALUE_NEW.
    MOVE FS_CDPOS-VALUE_OLD TO FS_OUTTAB-VALUE_OLD.
    READ TABLE T_DATAELE INTO FS_DATAELE WITH KEY
    TABNAME = FS_CDPOS-TABNAME
    FIELDNAME = FS_CDPOS-FNAME
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    READ TABLE T_TEXT INTO FS_TEXT WITH KEY
    ROLLNAME = FS_DATAELE-ROLLNAME
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_TEXT-DDTEXT TO FS_OUTTAB-DDTEXT.
    ENDIF. " IF SY-SUBRC EQ 0.
    ENDIF. " IF SY-SUBRC EQ 0.
    APPEND FS_OUTTAB TO T_OUTTAB.
    CLEAR FS_OUTTAB.
    ENDLOOP.
    ENDFORM. " FILL_OUTTAB
    *& Form GET_CELL_INFO
    Subroutine to get the Cell Information
    --> W_VALUE Holds the value of Hotspot clicked
    FORM GET_CELL_INFO .
    CALL METHOD W_GRID->GET_CURRENT_CELL
    IMPORTING
    E_ROW =
    E_VALUE = W_VALUE
    E_COL =
    ES_ROW_ID =
    ES_COL_ID =
    ES_ROW_NO =
    ENDFORM. " GET_CELL_INFO
    *& Form VALIDATE_PD_NUM
    Subroutine to validate Purchase Document Number
    There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_PD_NUM .
    IF NOT S_EBELN[] IS INITIAL.
    SELECT EBELN " Purchase Document Number
    FROM EKKO
    INTO W_EBELN
    UP TO 1 ROWS
    WHERE EBELN IN S_EBELN.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    CLEAR SSCRFIELDS-UCOMM.
    MESSAGE E717(M8).
    ENDIF. " IF SY-SUBRC NE 0
    ENDIF. " IF NOT S_EBELN[]...
    ENDFORM. " VALIDATE_PD_NUM
    *& Form VALIDATE_VEN_NUM
    Subroutine to validate Vendor Number
    There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_VEN_NUM .
    IF NOT S_LIFNR[] IS INITIAL.
    SELECT LIFNR " Vendor Number
    FROM LFA1
    INTO W_LIFNR
    UP TO 1 ROWS
    WHERE LIFNR IN S_LIFNR.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    CLEAR SSCRFIELDS-UCOMM.
    MESSAGE E002(M8) WITH W_SPACE.
    ENDIF. " IF SY-SUBRC NE 0
    ENDIF. " IF NOT S_LIFNR[]...
    ENDFORM. " VALIDATE_VEN_NUM
    *& Form VALIDATE_PUR_GRP
    Subroutine to validate the Purchase Group
    There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_PUR_GRP .
    IF NOT S_EKGRP[] IS INITIAL.
    SELECT EKGRP " Purchase Group
    FROM T024
    INTO W_EKGRP
    UP TO 1 ROWS
    WHERE EKGRP IN S_EKGRP.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    CLEAR SSCRFIELDS-UCOMM.
    MESSAGE E622(M8) WITH W_SPACE.
    ENDIF. " IF SY-SUBRC NE 0
    ENDIF. " IF NOT S_EKFRP[]...
    ENDFORM. " VALIDATE_PUR_GRP
    *& Form FILL_VARIANT
    Subroutine to fill the Variant Structure
    There are no interface parameters to be passed to this subroutine
    FORM FILL_VARIANT .
    Filling the Variant structure
    W_VARIANT-REPORT = SY-REPID.
    W_VARIANT-USERNAME = SY-UNAME.
    ENDFORM. " FILL_VARIANT
    reward point if helpful.
    thanks
    mrutyun^

  • Improving the performance of Crystal Reports for Eclipse 2.0

    Hi,
    I am having some performance issues with displaying reports where it can take upto 30 seconds per user for each new session for the report to display. If we run this directly from the client (through Crystal 2008) it takes about 2 seconds.
    The product only has 4 different rpt files but are constantly viewed by the clients (although with diffferent parameters). The users tend to come onto the system browse a couple of reports and log-off. They will do this about 3 - 5 x a day.
    1) Can you cache the reports at an application level (rather than the session) (and is it recommended)
    2) Create a separate web-service just hosting the Crystal Reports
    3) Other mechanisms of calling the report (currently using addDiscreteParameterValue, replaceConnection, Logon [this replaceConnection and Logon is done for the master and every subreport], then using processHttpRequest
    Anyone got any advice , recommendations or pearls of wisdom?
    Probably have max 15 concurrent users which process these 4 reports.
    Kind regards
    Matt.

    CR4E 2.0 currently uses 5 CPLs - 5 concurrent process license, which means it services up to five concurrent report requests.  This isn't per-session, per-report, or per-user, but per-request (open report, next page, export).
    So having 15 simultaneous users may lead to some requests being queued till a license is free.
    For a more scalable solution, the recommendation is to go with a server-client solution like Crystal Reports Server Embedded or BusinessObjects Enterprise.
    But to tune your CR4E app to see how much you'll be able to service, what I recommend is turning on Log4J logging to see where the performance is going.
    Going from 2 sec to 30 sec between CR Designer (binary app) to CRJ (pure Java app) isn't out of performance expectations, but there may be ways to tune it.
    For example, if you're doing replaceConnection or setTableLocation, you may just want to do it once to the rpt file during deployment, so you'd not need to change the connection info every time the report is run.
    Saving to application context isn't something that CRJ is designed for - it's designed to have the ReportSource per-Session.
    Sincerely,
    Ted Ueda

  • Performance in the Server with the created report - Crystal Report 2008

    Hi
          We have developed a complex report and deployed in the server. It takes more time to process and once if the report created and we are trying to expand a group/navigate different pages, the same time delay is happeneing. Sometimes it takes more than a minute which really kills the performance. My client has accepted the delay while the report is being genrated but  they raise question like why it takes too much time just to display the created report.
      I tried keeping the created report in Session and rebind on page_load as well stored a copy on the server and rebind whenver postback happens. Both methods working simliar and no improvement the in the performance. Is there any way to kill the time delay in this.( we have an idea like , if we store the created report  at client machine and whenever postback happens just bind from client machine instead to hit the server back, Is this achievable)
    Any Help would helpful to me
    Thanks

    Hi
    What version of CR are you using?
         Crystal report 2008, I think its in subject of this thread itself. (Version 12.0.0.683)
    What if any CR SP have you applied?
        No
    What version of .NET are you using?
      .Net 3.5 using C# technology (.Net framework 3.5)
    What database are you using?
        SQL Server2008
    What connection type are you using?
       We have created a Stored Procedure and connected the SP to the crystal report.
    What are you comparing the performance to? E.g.; is it faster somewhere else? How much faster?
        No, we didnt compare anywhere. but my question is to avoid the delay in navigation of pages or selecting an item in the group tree. The report contains 100+ pages and client is accepting delay while creating the report but not during navigation or selection( why do the already created report takes more time(even in minutes) to render on navigation or selection and how to avoid the delay))
    Define "complex report ".
    Nothing complexity in the report even we have used oly less formulas(less than 5) but chats are included and used for each group( we have 6 groups in the report)
    Thanks

Maybe you are looking for

  • TDS query

    Hi All, I am developing a report for Monthly TDS Statement.(for vendors only) Selection criteria are 1) Company Code 2) Posting Date 3) Vendor I am getting the required data from WITH_ITEM table. But my doubt is what should be my starting point to fe

  • Pdf complete does not always create a correct pdf document

    The HP Z230 I bought recently was equipped with PDF Complete to print to a pdf file.  Unfortunately, it is inferior to the freeware CutePDF, in that sometimes it doesn't convert all of the letters in the document, and the font is strange.  I've made

  • French characters in a JSP page

    I have an HTML page with a form that has a text field that can accept text from the user. This text can be multilanguage and when French charcters are in the text field, when the user submits the HTML form, my JSP that retrieves the text from the tex

  • Workflow that maintains clip handles going from FCP to Motion & back

    I have a 25 minute Final Cut Pro sequence that consists of about 200 clips each about 7 seconds long. Each clip has a different linear speed change applied to it. I've already run the project through Media Manager, adding 5 second handles to each cli

  • EPub and iBooks Author

    I have written a book. I have it in iBooks and ePub format. I want to upload both the formats to iTunes iBookStore. I have already uploaded iBook format. But what I want to do is upload both iBook and ePub in the same book. Like for example, if the i