Defaulting fiscal year in GR55 reports

Hi Experts,
I had a requirement in defaulting the fiscal year to 2011 in our client's GR55 trial balance. What I did was, that I got the relevant variable (YEAR) and in GS12 changed the default value as 2011. Then when the report was run the fiscal year appeared as 2011.  However,   when I ran it for the second time I received the following error (when executing)
"REPLACE_VARIABLES; SUBRC= 0; &PERLAST
Message no. GR016"
Could you please let me know if you have ever encountered this problem and how I could resolve this
Thanks in advance
Dasuni

Hi Gaurav,
Thanks for your feedback. We are unable to do as you have suggested. We found out that when a value for period has been entered this error doesn't come up. So now could you please let me know how to make a variable mandatory in GR55 reports.
Thanks a lot
Dasuni

Similar Messages

  • How to get or set default fiscal year value in billing doc

    Hi All, my question is simple, how to get or set default fiscal year value (VBRK_GJAHR) in billing document.. is it possible.
    Thanks.
    Regards,
    Michael

    Hi Michel
    If you feel that the fiscal year value should come  in the billing document then you have to use a user exit USEREXIT_NUMBER_RANGE .
    As this is a related to ABAP , you should give the inputs and ABAP'ers will give the number range as per our requirement .
    Regards
    Srinath

  • 0 fiscper3 (posting period)and 0fiscyear (fiscal year) in bw report

    Hi I need a quick help, please resolve my issue in step by step. Report is required to display the 0 fiscper3 (posting period)and 0fiscyear (fiscal year) in bw report. I have a 0fiscper Fiscal Yr / Period in my datasource and infosource but not 0fiscper3 (posting period)and 0fiscyear (fiscal year). Can any body help me how to add the abap code to convert the 0fiscper Fiscal Yr / Period to display 0fiscper3 (posting period)and 0fiscyear (fiscal year in report or how to add by abap code 0fiscper3 (posting period)and 0fiscyear (fiscal year)in datasource. User will select the value of 0FISCYEAR
    Fiscal year during the execution of report. please help
    will reward all points.
    thanks
    soniya kapoor

    In de update rules from infosource to datatarget you fill the rules like this:
    For 0FISCYEAR:
      result = comm_structure-fiscper(4).
    For 0FISPER3
      result = comm_structure-fiscper+4(3).
    Note that this can also be done by using formula's. If you can't ABAP you may prefer to use formula's.

  • Period and Fiscal Year in a report selction screen (3.1 I version of SAP.)

    Hi Team,
    I have a requirement on a Zreport. Suppose if we are executing a report in the month of March (3)-fiscal year 2011 and if I select a variant and the varinat should populate period as Feb (2 period) and fiscal year as last year (2010).
    In Nut shull if i am executing the report todays date the period and fiscal year in the selection screen should be 2 and 2010.
    Also please note that i am working on 3.1 I version of SAP.
    Your inputs are highly appreciated.
    Thank you
    Venkatesh Billa

    Hi,
    Generatlly while saing the variant for the report selection screen you can use the dynamic date calculation , where the last period and last fiscal year options are available.
    Also you can choose the option of calculating the period and fiscal year in your program and can default the same on the selection screen. But I think you should check in ABAP forum for this, whether there anything in coding also.
    Regards,
    Gaurav

  • Fiscal period / fiscal year shift in Reporting

    Hello all,
    our company has defined 0FISCVARNT = V6 because our fiscal year end in June. I want to provide the time char 0FISCPER in our reports as key and text.
    The text table table T009C is maintained as Jan fo period 007, Feb for period 008.
    When I run a report and drill down by FISCPER and display text and key and the characteristic 0FISCYEAR is combined with 0FISCPER. Therefore text information is correct for july until December (July 2006 - December 2006) but from January on the result is not correct (January 2006 instead of January 2007).
    Is there a way to adjust or to shift the Fiscal year in the query output. Any help would be great.
    Best Regards,
    Stefan from Munich/Germany

    Stefanos,
    The result with the Fiscal Year is fine.
    Fiscal Year, even though you're reporting January 2007, is still 2006. If you "shift" the Fiscal Year, then the result would be wrong.
    Make a simple test, make a drill-down by 0FISCPER and 0CALMONTH. I'm sure 0CALMONTH will show "January 2007".
    Regards,
    Luis

  • Asset Report to check periods in Closed Fiscal Year

    Hi Gurus,
    Would want to check what other standard SAP t-codes that could be used to check the periods for the closed Fiscal year in asset reporting? i.e. FY 2008 closed, would need to check asset balances, NBV, etc for period 7, system prompts an error and could only execute for period 12.
    Appreciate feedback
    Many thanks
    eddie lim

    Hi
    If you are using the report S_ALR_87011963, following is the limitation for it.
    You cannot run a report for any day you choose within a period. The
    following restrictions apply to the report date:
    o   If the report date is in the past, or in the current fiscal year:
         You can use the end of a fiscal year or the end of any period as the
         report date. If the fiscal year is already closed, you can only use
         the end of the fiscal year as the date.
    o   If the report date is in a future fiscal year:
         The system always uses the last day of the fiscal year as the report
         date.
    o   If the report date is the first day of a fiscal year:
         To ensure that the values for the beginning of the fiscal year are
         same as those for the end of the previous fiscal year, the
         system runs reports with the report date 1/1/YYYY for the date
         12/31/YYYY-1 (the same applies for a non-calendar fiscal year).
    If you want to run report for forcating depreciation and NBV, use TCOD - S_ALR_87012026
    Thanks
    GG

  • Report ... conversion for fiscal year representation

    have a report which prints the actuals for a fiscal year . Its like each country has their own fiscal year representation , The report is currently printing the data based on its own fiscal year representation , i have to modify the report and want it to print based on US(sep-aug) fiscal representation .. like for example for india its printing with may as fiscal period 1 , instead i want to print it with may data as fiscal period 9 and to print the data from sep-aug for all countries. I dont understand how to give the select statement and how to proceed with this. I appreciate if anyone can help me with this.
    Lets load up the yps_costplan table for loading.
    if they didn't specify a project to single load, go get them all.
    if s_objnr is initial.
    if in first fiscal month, "Sept", then get previous years data to
    fill in the last month, month 12.
    if t_t009b-poper = '001'.
    select * from yps_costplan into table i_yps_costplan
    where yyobjnr gt 'PR00000000' and yygjahr ge yprevyear and
    yygjahr lt yplus1year.
    else.
    select * from yps_costplan into table i_yps_costplan
    where yyobjnr gt 'PR00000000' and yygjahr ge p_fiscal and
    yygjahr lt yplus1year.
    endif.
    When getting all, start with 2003, when doing month, use current
    fiscal year only.
    yygjahr between t_yearm1 and t_yearp1.
    else.
    They secified 1 project, go get his data.
    if not s_objnr-LOW cs '*'.
    concatenate s_objnr-low '%' into hold_projn.
    loop at s_objnr.
    if s_objnr-high eq space.
    concatenate s_objnr-low '*' into s_objnr-low.
    s_objnr-option = 'CP'.
    modify s_objnr.
    endif.
    endloop.
    select posid objnr from prps into table t_prps
    WHERE POSID IN S_OBJNR.
    else.
    concatenate s_objnr-low(sy-fdpos) '%' into hold_projn.
    select posid objnr from prps into table t_prps
    where posid like hold_projn.
    WHERE POSID IN S_OBJNR.
    endif.
    if sy-subrc eq 0.
    loop at t_prps.
    if in first fiscal month, "Sept", then get previous years data to
    fill in the last month, month 12.
    if t_t009b-poper = '001'.
    select * from yps_costplan into table h_yps_costplan where
    yyobjnr = t_prps-objnr and yygjahr ge yprevyear and
    yygjahr lt yplus1year.
    else.
    select * from yps_costplan into table h_yps_costplan where
    yyobjnr = t_prps-objnr and yygjahr ge p_fiscal and
    yygjahr lt yplus1year.
    endif.
    if sy-subrc eq 0.
    loop at h_yps_costplan.
    i_yps_costplan = h_yps_costplan.
    append i_yps_costplan.
    endloop.
    endif.
    endloop.
    endif.
    endif.

    someone please help me with this ..

  • Fiscal year-report

    1.HOw will compare different fiscal year variant for reporting prupose?
    2. How will assigne the business area, and how will get u business areas wise report.

    Consider this I have a restricted KF which brings in the value YTD cumulative and have created another restricted KF which brings in the value YTD cumulative offset by -1.
    For instance when the user punches in Jan to March
    the first RKF1 brings in JAN FEB MARCH
    the second RKF2 brings in JAN FEB MARCH too
    only difference being March is blank in RKF2.
    If RKF2 brings in only JAN and FEB values then it would be easier to solve this issue by simple subtracting  RKF1- RKF2.
    The desired columns in the report should look like
    Jan-Null
    Feb-Jan
    March - Feb
    Hope you understand what I am getting at
    Thanks
    Raj

  • Fiscal Year field when Setting up posting period

    Hi,
    Our client has financial year from 1st July - 30 June.  How we normally do is:
    for 1/7/2007 - 30/6/2008, Fiscal Year field = 2008 and 1/7/2008 - 30/6/2009, Fiscal Year field = 2009. etc etc.
    However, what I notice is:
    When creating new period, eg: for 1/7/2008 - 30/6/2009, SAP will default the Fiscal Year = 2008.  So, it really requires our client to be very careful and overwrites the default.
    My question is:
    (a) Does the field 'Fiscal Year' play any signigicant role in SAP?
    (b) What is your normal approach about filling in this 'Fiscal Year' field?
    (c) We also notice that when we put in 2008 as the Fiscal Year, when writing report using XL Reporter, we can never reply on the Period code.  We need to refer to the Period name instead.    It is rather confusing for some of our client.
    Any thoughts appreciated.

    Hi
    I'm not sure what impact that it has but I usually change it to be 2008 (Jul 07 to Jun 08) etc.. as this make more sense to our clients.
    Also, I change the period names to be more logical as well, like July 2007 rather than 2007/08-1. This means that on reports (like XLReporter) it makes more sense to the non-financial people receiving the reports.
    Regards
    Jenny

  • Fiscal year varient creation in BI

    Hi,
    I ahve report where we have already fiscal year varient coming from R/3 it is V3 for specified periods like if i give
    Fiscal year varient 007.2008 it will add all the last 6 month + this month value and disply on the screen now the client want to cahnge the pattern in BI only instead of 6-6 months they would like cumulate the value for 3-3-3-3 . Can anyone will give me an idea how to create the varient for Fical year only Bw  for this 3-3-3-3 values..
    Thanks

    What you need to do is to create 4 RKFs
    RKF 1 - is key figure + cmod date variable qtr1
    RKF 2 - is key figure + cmod date variable qtr2
    etc..
    I take it you are going put a selection of fiscal year into the report so
    create 4 date variables all of user exits
    cmod date variable qtr1
    read the selection of year
    concatenate year and 001 into date low
    concatenate year and 003 into date high
    cmod date variable qtr2
    read the selection of year
    concatenate year and 004 into date low
    concatenate year and 006 into date high
    etc etc
    You shoudl be able to code the ABAP yourself based on that info

  • Display the 0 fiscper3 (posting period)and 0fiscyear (fiscal year) in bw re

    Hi I need a quick help, please resolve my issue in step by step. Report is required to display the 0 fiscper3 (posting period)and 0fiscyear (fiscal year) in bw report. I have a  0fiscper Fiscal Yr / Period in my datasource and infosource but not 0fiscper3 (posting period)and 0fiscyear (fiscal year). Can any body help me how to add the abap code to convert the 0fiscper Fiscal Yr / Period to display 0fiscper3 (posting period)and 0fiscyear (fiscal year in report or how to add by abap code 0fiscper3 (posting period)and 0fiscyear (fiscal year)in datasource. User will select the value of 0FISCYEAR
    Fiscal year during the execution of report. please help
    will reward all points.
    thanks
    soniya kapoor

    Hi Soniya,
    Y don't you enhance ur datasource with these fields?
    Anyways the workaround could be add 0FISCPER3 and 0FISCYEAR in ur data target, and write ABAP code for it in transformation.
    Map 0FISCPER with both the fields, and now click rule type of both the fields independently.  Select rule type as routine.
    0FISCPER stores data in format YYYYPPP, so you have to write code accordingly.
    Likie in 0FISCPER3 assign last 3 digits of 0FISCPER to 0FISCPER3 and first 4 to 0FISCYEAR.
    Suppose u have pne temp variable with name fis_yp which stores value of 0FISCYEAR. For getting period from it you have to write:
    period = fis_yp+4(3), ( 3 characters from 4 place)
    and similarly for year,
    year = fis_yp+0(4),  ( 4 charaters from 0 place)
    I hope now u can write code for it easily?
    KJ!!!

  • How to get fiscal period based on date and Fiscal year?

    Hi Guys,
               Can anybody tell me how to get Fiscal period based on date and Fiscal Year or fiscal year variant?
    Thanks,
    Gopi.

    Hi,
    Please refer the code below:
    *: Report:  ZFISCALYR                                                  :
    *: Date  :  2004                                                       :
    *: Description: Demonstrates how to return the corresponding fiscal    :
    *:              year and posting period for a company code and posting :
    *:              date or posting date and fiscal year variant.          :
    REPORT  zfiscalyr NO STANDARD PAGE HEADING.
    TABLES: ekko.
    PARAMETERS:     p_bukrs TYPE ekko-bukrs,
                    p_bedat TYPE ekko-bedat.
    DATA: gd_fiscalyr  TYPE bapi0002_4-fiscal_year,
          gd_fiscalp   TYPE bapi0002_4-fiscal_period.
    DATA: gd_fiscalyr2 TYPE T009B-BDATJ,
          gd_fiscalp2  TYPE bapi0002_4-fiscal_period.
    DATA: gd_periv     TYPE t009-periv.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    * get fiscal year and period - (requires date and company code)
      CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
        EXPORTING
          companycodeid = p_bukrs
          posting_date  = p_bedat
        IMPORTING
          fiscal_year   = gd_fiscalyr
          fiscal_period = gd_fiscalp.
    * Alternative fiscal year function module
    * - (requires date and fiscal year variant code from T009 table)
    * gets first entry in fiscal year variant table (will need to choose
    * correct one from table rather than just using first entry)
      SELECT SINGLE periv
        FROM t009
        INTO gd_periv.
    * get fiscal year and period
      CALL FUNCTION 'DETERMINE_PERIOD'
        EXPORTING
          date                      = p_bedat
    *    PERIOD_IN                 = '000'
          version                   = gd_periv
       IMPORTING
          period                    = gd_fiscalp2
          year                      = gd_fiscalyr2
       EXCEPTIONS
          period_in_not_valid       = 1
          period_not_assigned       = 2
          version_undefined         = 3
          OTHERS                    = 4.
    *END-OF-SELECTION.
    END-OF-SELECTION.
      WRITE:/ 'From function module: BAPI_COMPANYCODE_GET_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr,
            / 'Fiscal period is:', gd_fiscalp.
      SKIP.
      WRITE:/ 'From function module: DETERMINE_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr2,
            / 'Fiscal period is:', gd_fiscalp2.
    Thanks,
    Sriram Ponna.
    Edited by: Sriram Ponna on Apr 17, 2008 8:59 PM

  • Procedure for maintaning quarters with two fiscal years

    My InfoCube
    Charecterstics :  ZCFBNO,0PROFIT_CTR,ZPARAMETER,ZSCALE
    Keyfigures       :  ZRATING,ZINVHRS,ZBILLHRS
    Time Char        :  0FISCYEAR,0FISCPER3
    I want to show Report with Selections
    YEAR
    PROFIT_CTR --- it is a hierarchy variable
    PARAMETER
    QUARTER
    Report Output will be
    PROFIT_CTR || SCALE || RATING IN THIS QUARTER || RATING CUMMULATIVE FOR THE YEAR
    but here Q1 : apr to Jun  || And ||   Jan to Mar
                 Q2 : Jul to Sep  || And ||   Apr to Jun
                 Q3 : oct to Dec  || And ||   Jul to Sep
                 Q4 : jan to Mar  || And ||   Oct to Dec
    How can I maintain these two fiscal years in this report can any one suggest me step by step procedure for this.

    My Cube Charecters : CFBNO,PARAMETER,VERTICAL,DEPARTMENT,PROFITCENTER
    Keyfigures : RATING
    Time Charecteristics : 0FISCYEAR,0FISCPER3
    I want to show Numberof CFBS and Rating in a Selected Quarter and for Selected Vertcal
    as
    VERTICAL | DEPARTMENT | CURRENT QUARTER CFB's | CURRENT QUARTER RATING |
    CUMMULATIVE FOR THE YEAR RATING

  • Asset Aquisition report date problem in indian fiscal year style  (urgent)

    hi all genius there,
    i am developing asset aquisiton report in which i should get
    the record of asset depending on indian fiscal year (1st april to 31st march).
    so that means if i enter 31.03.2006 then i should get all the asset records
    from 01.04.2005 to 31.03.2006.
    how to do it. its very urgent. plz if aany one has done this scenario for
    asset aquisition report then plz send me the code.
    my id is- [removed by moderator]
    or otherwise i am sending my code plz check it and do the modification to get the above requirement.
    REPORT Z_FA_ACQ  NO STANDARD PAGE HEADING
                     LINE-SIZE 400
                     LINE-COUNT 65(3).
    TYPE-POOLS : SLIS.
    TABLES : ANLA,                         "ASSET MASTER RECORD-SEGMENT
             ANLZ,                         "time dependent asset allocations
             ANLC,
             ANEK.
    DATA : BEGIN OF T_ANLA OCCURS 0,
           BUKRS LIKE ANLA-BUKRS,
           ANLN1 LIKE ANLA-ANLN1,
           ANLN2 LIKE ANLA-ANLN2,
           AKTIV LIKE ANLA-AKTIV,
           TXT50 LIKE ANLA-TXT50,
           ZUGDT LIKE ANLA-ZUGDT,
           MENGE LIKE ANLA-MENGE,
           MEINS LIKE ANLA-MEINS,
           ANLKL LIKE ANLA-ANLKL,
           END OF T_ANLA.
    DATA : BEGIN OF T_ANLZ OCCURS 0,
           BUKRS LIKE ANLZ-BUKRS,
           ANLN1 LIKE ANLZ-ANLN1,
           ANLN2 LIKE ANLZ-ANLN2,
           GSBER LIKE ANLZ-GSBER,
           KOSTL LIKE ANLZ-KOSTL,
           STORT LIKE ANLZ-STORT,
           RAUMN LIKE ANLZ-RAUMN,
           KFZKZ LIKE ANLZ-KFZKZ,
           WERKS LIKE ANLZ-WERKS,
           END OF T_ANLZ.
    DATA : BEGIN OF T_ANEK OCCURS 0,
           BUKRS LIKE ANEK-BUKRS,
           ANLN1 LIKE ANEK-ANLN1,
           ANLN2 LIKE ANEK-ANLN2,
           BELNR LIKE ANEK-BELNR,
           BUDAT LIKE ANEK-BUDAT,
           XBLNR LIKE ANEK-XBLNR,
           SGTXT LIKE ANEK-SGTXT,
           GJAHR LIKE ANEK-GJAHR,
          pdate LIKE anek-budat, " modified by sanjeev for date logic
           END OF T_ANEK.
    DATA : BEGIN OF T_ANLC OCCURS 0,
           BUKRS LIKE ANLC-BUKRS,
           ANLN1 LIKE ANLC-ANLN1,
           ANLN2 LIKE ANLC-ANLN2,
           ANSWL LIKE ANLC-ANSWL,
           NAFAP LIKE ANLC-NAFAP,
           AAFAP LIKE ANLC-AAFAP,
           AFABE LIKE ANLC-AFABE,
           GJAHR LIKE ANLC-GJAHR,
           END OF T_ANLC.
    DATA : BEGIN OF IT_FINAL OCCURS 0,
            ANLN1 LIKE ANLA-ANLN1,
            ANLN2 LIKE ANLA-ANLN2,
            AKTIV LIKE ANLA-AKTIV,
            TXT50 LIKE ANLA-TXT50,
            ZUGDT LIKE ANLA-ZUGDT,
            MENGE LIKE ANLA-MENGE,
            MEINS LIKE ANLA-MEINS,
            GSBER LIKE ANLZ-GSBER,
            KOSTL LIKE ANLZ-KOSTL,
            STORT LIKE ANLZ-STORT,
            RAUMN LIKE ANLZ-RAUMN,
            KFZKZ LIKE ANLZ-KFZKZ,
            BELNR LIKE ANEK-BELNR,
            BUDAT LIKE ANEK-BUDAT,
          pdate LIKE anek-budat,
            XBLNR LIKE ANEK-XBLNR,
            SGTXT LIKE ANEK-SGTXT,
            ANSWL LIKE ANLC-ANSWL,
            NAFAP LIKE ANLC-NAFAP,
            AAFAP LIKE ANLC-AAFAP,
            GJAHR LIKE ANEK-GJAHR,
            ANLKL LIKE ANLA-ANLKL,
            END OF IT_FINAL.
    DATA: PDATE LIKE ANEK-BUDAT.
    PDATE = SY-DATUM.
    DATA:V_LOW LIKE SY-DATUM,
        V_HIGH LIKE SY-DATUM,
        V_DATE(04) TYPE N,
        V_YEAR(04) TYPE N.
    V_YEAR = V_DATE(04).
    V_YEAR = V_YEAR - 1.
    CONCATENATE V_YEAR '0401' INTO V_LOW.
    CLEAR V_YEAR.
    V_YEAR = V_DATE(04).
    CONCATENATE V_YEAR '0331' INTO V_HIGH.
    DATA : LINE_COLOR(4) TYPE C.
    DATA : FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
           GD_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: EVENT  TYPE SLIS_ALV_EVENT OCCURS 0 WITH HEADER LINE.
    SELECTION-SCREEN : BEGIN OF BLOCK B_FA WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS : S_BUKRS FOR ANLA-BUKRS DEFAULT 'ML',
                     S_ANLN1 FOR ANLA-ANLN1,
                     S_ANLN2 FOR ANLA-ANLN2,
                     S_ANLKL FOR ANLA-ANLKL,
                     S_AKTIV FOR ANLA-AKTIV,
                     S_GSBER FOR ANLZ-GSBER,
                     S_KOSTL FOR ANLZ-KOSTL,
                     S_WERKS FOR ANLZ-WERKS,
                     S_STORT FOR ANLZ-STORT,
                   S_BUDAT FOR ANEK-BUDAT,
                     S_GJAHR FOR ANEK-GJAHR.
    SELECTION-SCREEN : END OF BLOCK B_FA.
    *PARAMETERS : budat LIKE anek-budat.
    SET PF-STATUS '100'.
    SELECT BUKRS ANLN1 ANLN2 AKTIV TXT50 ZUGDT MENGE MEINS ANLKL
           FROM ANLA
           INTO CORRESPONDING FIELDS OF TABLE T_ANLA
           WHERE ANLN1 IN S_ANLN1
           AND   ANLN2 IN S_ANLN2
           AND   BUKRS IN S_BUKRS
           AND   ANLKL IN S_ANLKL
           AND   AKTIV IN S_AKTIV.
    CHECK : NOT T_ANLA[] IS INITIAL.
    SELECT BUKRS ANLN1 ANLN2 GSBER KOSTL STORT RAUMN KFZKZ
           FROM ANLZ
           INTO CORRESPONDING FIELDS OF TABLE T_ANLZ
           FOR ALL ENTRIES IN T_ANLA
           WHERE ANLN1 = T_ANLA-ANLN1
           AND   ANLN2 = T_ANLA-ANLN2
           AND   BUKRS = T_ANLA-BUKRS
           AND   GSBER NOT IN S_GSBER
           AND   KOSTL IN S_KOSTL
           AND   WERKS IN S_WERKS.
    SELECT BUKRS ANLN1 ANLN2 BELNR BUDAT XBLNR SGTXT GJAHR
           FROM ANEK
           INTO CORRESPONDING FIELDS OF TABLE T_ANEK
           FOR ALL ENTRIES IN T_ANLA
           WHERE ANLN1 = T_ANLA-ANLN1
           AND   ANLN2 = T_ANLA-ANLN2
           AND   BUKRS = T_ANLA-BUKRS
           AND   BUDAT >= V_LOW
           AND   BUDAT <= V_HIGH.
          AND  gjahr IN s_gjahr. " modified for date logic by Sanjeev
    SELECT BUKRS ANLN1 ANLN2 ANSWL NAFAP AAFAP AFABE GJAHR
           FROM ANLC
           INTO CORRESPONDING FIELDS OF TABLE T_ANLC
           FOR ALL ENTRIES IN T_ANLA
           WHERE ANLN1 = T_ANLA-ANLN1
           AND   ANLN2 = T_ANLA-ANLN2
           AND   BUKRS = T_ANLA-BUKRS
           AND   AFABE = '01'.
    LOOP AT T_ANLA.
      MOVE : T_ANLA-ANLN1 TO IT_FINAL-ANLN1,
             T_ANLA-ANLN2 TO IT_FINAL-ANLN2,
             T_ANLA-AKTIV TO IT_FINAL-AKTIV,
             T_ANLA-TXT50 TO IT_FINAL-TXT50,
             T_ANLA-ZUGDT TO IT_FINAL-ZUGDT,
             T_ANLA-MENGE TO IT_FINAL-MENGE,
             T_ANLA-MEINS TO IT_FINAL-MEINS.
      READ TABLE T_ANLZ WITH KEY BUKRS = T_ANLA-BUKRS
                                 ANLN1 = T_ANLA-ANLN1
                                 ANLN2 = T_ANLA-ANLN2 BINARY SEARCH.
      IF SY-SUBRC EQ 0.
        MOVE : T_ANLZ-GSBER TO IT_FINAL-GSBER,
               T_ANLZ-KOSTL TO IT_FINAL-KOSTL,
               T_ANLZ-STORT TO IT_FINAL-STORT,
               T_ANLZ-RAUMN TO IT_FINAL-RAUMN,
               T_ANLZ-KFZKZ TO IT_FINAL-KFZKZ.
      ENDIF.
      READ TABLE T_ANLC WITH KEY BUKRS = T_ANLA-BUKRS
                                 ANLN1 = T_ANLA-ANLN1
                                 ANLN2 = T_ANLA-ANLN2 BINARY SEARCH.
      IF SY-SUBRC EQ 0.
        MOVE : T_ANLC-ANSWL TO IT_FINAL-ANSWL,
               T_ANLC-NAFAP TO IT_FINAL-NAFAP,
               T_ANLC-AAFAP TO IT_FINAL-AAFAP.
      ENDIF.
    LOOP AT T_ANEK WHERE BUKRS = T_ANLA-BUKRS AND ANLN1 = T_ANLA-ANLN1 AND
        ANLN2 = T_ANLA-ANLN2 AND   BUDAT >= V_LOW
                                 AND   BUDAT <= V_HIGH AND BUDAT IN S_BUDAT.
        MOVE : T_ANEK-BELNR TO IT_FINAL-BELNR,
               T_ANEK-BUDAT TO IT_FINAL-BUDAT,
               T_ANEK-GJAHR TO IT_FINAL-GJAHR,
               T_ANEK-XBLNR TO IT_FINAL-XBLNR,
               T_ANEK-SGTXT TO IT_FINAL-SGTXT.
        APPEND IT_FINAL.
      ENDLOOP.
    ENDLOOP.
    PERFORM BUILD_FIELDCATALOG.
    PERFORM DISPLAY_ALV_REPORT.
    PERFORM BUILD_LAYOUT.
          FORM BUILD_FIELDCATALOG                                       *
    FORM BUILD_FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'ANLN1'.
      FIELDCATALOG-SELTEXT_M = 'ASSET MAIN NO'.
      FIELDCATALOG-COL_POS   = 0.
      FIELDCATALOG-OUTPUTLEN = 14.
      FIELDCATALOG-EMPHASIZE = 'X'.
      FIELDCATALOG-KEY       = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'ANLN2'.
      FIELDCATALOG-SELTEXT_M = 'SUB NO'.
      FIELDCATALOG-COL_POS   = 1.
      FIELDCATALOG-OUTPUTLEN = 7.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'AKTIV'.
      FIELDCATALOG-SELTEXT_M = 'CAP.DATE'.
      FIELDCATALOG-COL_POS   = 2.
      FIELDCATALOG-OUTPUTLEN = 10.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'TXT50'.
      FIELDCATALOG-SELTEXT_M = 'NAME'.
      FIELDCATALOG-COL_POS   = 3.
      FIELDCATALOG-OUTPUTLEN = 50.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'ZUGDT'.
      FIELDCATALOG-SELTEXT_M = 'POSTING DATE'.
      FIELDCATALOG-COL_POS   = 4.
      FIELDCATALOG-OUTPUTLEN = 10.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'MENGE'.
      FIELDCATALOG-SELTEXT_M = 'QTY'.
      FIELDCATALOG-COL_POS   = 5.
      FIELDCATALOG-OUTPUTLEN = 13.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'MEINS'.
      FIELDCATALOG-SELTEXT_M = 'UNITS'.
      FIELDCATALOG-COL_POS   = 6.
      FIELDCATALOG-OUTPUTLEN = 3.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'GSBER'.
      FIELDCATALOG-SELTEXT_M = 'BA'.
      FIELDCATALOG-COL_POS   = 7.
      FIELDCATALOG-OUTPUTLEN = 4.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'KOSTL'.
      FIELDCATALOG-SELTEXT_M = 'COST CENTER'.
      FIELDCATALOG-COL_POS   = 8.
      FIELDCATALOG-OUTPUTLEN = 13.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'STORT'.
      FIELDCATALOG-SELTEXT_M = 'LOCATION'.
      FIELDCATALOG-COL_POS   = 9.
      FIELDCATALOG-OUTPUTLEN = 10.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'RAUMN'.
      FIELDCATALOG-SELTEXT_M = 'ROOM'.
      FIELDCATALOG-COL_POS   = 10.
      FIELDCATALOG-OUTPUTLEN = 10.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'KFZKZ'.
      FIELDCATALOG-SELTEXT_M = 'LICENSE PLATE NO'.
      FIELDCATALOG-COL_POS   = 11.
      FIELDCATALOG-OUTPUTLEN = 20.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'BELNR'.
      FIELDCATALOG-SELTEXT_M = 'DOC NO'.
      FIELDCATALOG-COL_POS   = 12.
      FIELDCATALOG-OUTPUTLEN = 13.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'BUDAT'.
      FIELDCATALOG-SELTEXT_M = 'POSTING DATE'.
      FIELDCATALOG-COL_POS   = 13.
      FIELDCATALOG-OUTPUTLEN = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'XBLNR'.
      FIELDCATALOG-SELTEXT_M = 'REF NO'.
      FIELDCATALOG-COL_POS   = 14.
      FIELDCATALOG-OUTPUTLEN = 25.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'SGTXT'.
      FIELDCATALOG-SELTEXT_M = 'TEXT'.
      FIELDCATALOG-COL_POS   = 15.
      FIELDCATALOG-OUTPUTLEN = 50.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'ANSWL'.
      FIELDCATALOG-SELTEXT_M = 'ACQ VAL'.
      FIELDCATALOG-COL_POS   = 16.
      FIELDCATALOG-OUTPUTLEN = 13.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'NAFAP'.
      FIELDCATALOG-SELTEXT_M = 'ORD.DEP'.
      FIELDCATALOG-COL_POS   = 17.
      FIELDCATALOG-OUTPUTLEN = 13.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'AAFAP'.
      FIELDCATALOG-SELTEXT_M = 'UNPLAN DEP'.
      FIELDCATALOG-COL_POS   = 18.
      FIELDCATALOG-OUTPUTLEN = 13.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
    ENDFORM.
    PERFORM ALVDISPLAY.
    FORM ALVDISPLAY.
    EVENT-FORM = 'USERCOMMAND'(002).
    EVENT-NAME = 'USER_COMMAND'(001).
    APPEND EVENT.
    ENDFORM.
    FORM DOWNLOADEXCEL.
    DATA : B_FILE1 LIKE RLGRAP-FILENAME.
    ENDFORM.
          FORM BUILD_LAYOUT                                             *
    FORM BUILD_LAYOUT.
      GD_LAYOUT-ZEBRA = 'X'.
      GD_LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
    ENDFORM.
          FORM DISPLAY_ALV_REPORT                                       *
    FORM DISPLAY_ALV_REPORT.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
            I_INTERFACE_CHECK        = ' '
             I_CALLBACK_PROGRAM       = SY-REPID
            i_callback_pf_status_set = 100
            i_callback_user_command  = sy-ucomm
            I_STRUCTURE_NAME         =
             IS_LAYOUT                = GD_LAYOUT
               IT_FIELDCAT              = FIELDCATALOG[]
            IT_EXCLUDING             =
            IT_SPECIAL_GROUPS        =
            IT_SORT                  =
            IT_FILTER                =
            IS_SEL_HIDE              =
            I_DEFAULT                = 'X'
            I_SAVE                   = ' '
            IS_VARIANT               = ' '
            IT_EVENTS                =
            IT_EVENT_EXIT            = EVENT[]
            IS_PRINT                 =
            I_SCREEN_START_COLUMN    = 0
            I_SCREEN_START_LINE      = 0
            I_SCREEN_END_COLUMN      = 0
            I_SCREEN_END_LINE        = 0
       IMPORTING
            E_EXIT_CAUSED_BY_CALLER  =
            ES_EXIT_CAUSED_BY_USER   =
           TABLES
                T_OUTTAB                 = IT_FINAL
           EXCEPTIONS
                PROGRAM_ERROR            = 1
                OTHERS                   = 2.
    ENDFORM.
    Hi,
    we encourage open discussion and no emails, as the answer to your question shall be posted in the forum to be read by other users, who might be interested in it as well.
    Mario

    hi,
    i've tried to correct your code:
    -> v_year, v_low and v_high was not filled
    ...SELECTION-SCREEN : END OF BLOCK b_fa.
    PARAMETERS p_year LIKE anlc-gjahr DEFAULT sy-datum(4).
    *PARAMETERS : budat LIKE anek-budat.
    SET PF-STATUS '100'.
    v_year = p_year.
    v_year = v_year - 1.
    CONCATENATE v_year '0401' INTO v_low.
    CLEAR v_year.
    v_year = p_year.
    CONCATENATE v_year '0331' INTO v_high.
    SELECT bukrs anln1 anln2 aktiv txt50 zugdt menge meins anlkl
    FROM anla
    pls reward useful answers
    thx.
    Andreas

  • Fiscal Year on Reports

    Hi,
    I would like to find out if it's possible to add the fiscal year field to default to the line item reports for AP, AR and G/L.
    Is it possible?
    ple help..
    Thanks
    Kishore

    DO the config for AP -AR
    IMG>Fi>AP-AR>Customer/vendor acounts>line items> Define additional fields for line item display
    Table-BSEG, Field-GJAHR
    And for GL do the same
    Thanks
    Ron

Maybe you are looking for

  • Can't update iWeb 1.0 to 1.1.1- Strange Error Message

    I'm updating iWeb 1.0 to 1.1.1 in order to remove the conflict PC visitors are having to my website: www.ifsongs.com. Those PC visitors get ActiveX control panel warnings everytime they try to listen to an mp3 on my Audio Sample page. So...I download

  • Cold fusion files not compile by  the cfcompile utility

    Hi, I am trying to compile coldfusion file using cfcompile , but not find the compiled file in the output-directory. here some help about what i did: coldfusion mx 7 load on linux, and coldfusion files exist in the directory that exist in a directory

  • Can't stop pop-up ads on Safari

    Using OS X 10.9.2, Mavericks. Safari preferences has pop-up blocker turned on, but in the lower left corner of the Safari window, a square pops up with some sort of ad. There is a button that when clicked, causes the ad to reduce in size, but not dis

  • C4780 scan this alignment page for best print quality problem

    My C4780 photosmart printer is stuck in the "scan this alignment page for best print quality" loop.    i.e. It keep display this message and refuse to print. My OS is windows Vista Home.  I had followed the steps in the user manual but still cannot f

  • Data Validation - Tool selection.

    We are trying to validate our Enterprise Data warehouse and we would like to avoid giving SQL Server Management Studio access to the untrained Analysts. We initially wanted to use a single ODC connection in a spreadsheet and have each table tied to o