F8 key in Reports  --- Urgent

Hi Guys/Gals,
Is there any possibility to hide F8 button (ONLI) in a customized report???
Regards
Jiku

Hi,
set a menu for that report and write
SET PF-STATUS 'MENU' EXCLUDING 'ONLI'.
rgds,
bharat.

Similar Messages

  • Cost key figure report

    Hi
    all
    cam some one told me the trs for cost key figure report
    i assign the value categories in pm to sap standard cost key figures
    how to get the report on the basis of this

    hi,
    all
    i want to settle maintenance order
    i know the maint activity type flows to maintenance equipment cost centre the work center work hours
    i don't understand the cost flow of material from sprees account to the equipment cost centre account
    when i settle the order.
    if itick the by cost element and receiver category cost centre
    how the assignments mentioned in allocation structure links with the spares material cost element
    can some body explain me

  • URGENT: Issue with hierarchy level keys and report drill down

    Hi,
    BASIC STRUCTURE:
    I have created a subject area with 3 facts (FACT_A, FACT_B, FACT_C) and 4 dimesnions (TIME_DIM,DIM_2,DIM_3,DIM_4). Each fact table also has additional aggregate tables aggregated along levels of the time dimension. Also our timw dimension has aggregated dimension tables like TIME_DIM_WEEK, TIME_DIM_MONTH, TIME_DIM_QUARTER and TIME_DIm_YEAR.
    GOAL:
    All 3 facts have the same measures M_1 and M_2 in them but may not have data for the same dimension values selected.
    For example
    For month JAN 2000 FACT_A.M1=100$ and no data exists for JAN 2000 in FACT_B and FACT_C. Then in the report
    for JAN2000 it should show FACT_A.M1= $100, FACT_B.M1 = 0 and FACT_C.M1 =0. In this case I should be able to drill down to the lowest level.
    ISSUE:
    The time dimension TIME_DIM has the following levels - Total -> Year -> Quarter -> Month -> Week -> Day
    However I am having an issue with drill down in the reports whenever I pull metrics from more than 1 fact at a time. I have defined the level keys but not sure if I need to do anything in addition since I am using aggregates.
    I have to fix this issue quickly. Please help me.

    Alastair,
    All the fact tables have aggregated facts as sources.
    I have checked the levels set for each of the sources to the time dimesnion table in BMM and they look okay. So the Time dim table in BMM has 4 source tables
    Time_Day (level set to day, table key is "day"),
    Time_month (level set to month, table key is "Fiscal_Month_Code"),
    Time_Quarter(level set to quarter, table key is "Fiscal_Quarter_Code") and
    Time_Year(level set to year, table key is :Fiscal_Year_Code").
    Note: No time week aggregate added as logical source.
    Again the time dim hierarchy based off of this table has levels: Total -> Year ->quarter -> Month -> week -> day
    The levels keys set for each level are
    Year -> Primary key is Year_Name (YYYY)(Checked as chronological key) and another key is Year_Num (YYYY)(Checked as chronological key)
    Quarter->Primary Key is Quarter_Name (YYYY Qn), another key is Quarter_Number (Format n where n can assum values 1,2,3,4). Both keys are set as chronological keys
    Month -> Primary key is Month_Name (MON YYYY), another key is Month_Num (Format n where n can assume values from 1 to 12) Both keys are set as chronological keys
    Week -> Primary Key is week name (YYYY Wk nn, where nn can have values from 1 to 53), another key is week num (nn, where nn can have values from 1 to 53)
    Day -> primary key set to day (date format)
    Issue1: When I try to drill to lower levels it throws out an error saying report cannot find any data because filters may be too restrictive even though I see data at higher level
    For ex: If I drill down to Year: 2010 and Qtr: 2010 Q2 and M1:$100 when I click on Qtr to drll to month level it throws me the error
    Issue2: when I add year and qtr colums to the report I see data as below which is incorrect
    Year_Name Qtr_Name data:FACTA_M1 Data: FactB_M1
    2009 2009 Q1 $10 $5
    2009 2009 Q2 $20 $80
    2009 2009 Q3 $20
    2009 2009 Q4 $30
    2010 2010 Q1 $100
    2010 Q2 $101
    2010 Q3 $102 $230
    2010 Q4 $103
    2011 Q1 $10
    In the above example year_name is not showing up for 2010 Q2 and after. However if I change the primary key for level 'Quarter' by having key consist of year name and quarter name instead of just quarter name the issue doesnt occur and drill down works great. The only issue is when I drill from qtr it first shows year name and quarter name instead of showing the next level which would be month name.
    Sorry about the long message but I thought you might notice something in how I have set up the keys.
    Thanks

  • # in output of report: urgent

    Hi,
    I am facing a problem. I have an infobject 0class_num of character type. In any case if we dont have value then in output we get # instead of blank. But when i execute my report which is having a column contract type (0class_num) then in output it gives me something like '#/Warranty'. I tried to change display setting which is set to key by default and if i make ti to text then this value comes up 'Not assigned' but when i look up at data in the cube then there is no # preeceding the data. Can anybody please tell me from where this # is coming up and how to remove it ?
    Its urgent please help,
    Thanks !

    Yes you are right its having compounding infoobject 0class_type. Please tell me how to remove it. My object 0class_num is being used in a cube, i tried to remove 0 class_type from there but when i remove its compounding from object 0class_num i get following error:
    Infoobject 0class_type is used in  transfer rules(T) of char 0class_num.
    We are not mainting master data for it. so there is no transformation but in text table of 0class_num this 0class_type is present how to remove it.
    Please guide !
    Thanks

  • OBIEE Report - Urgent Help!!!! (May be Self Join - Then How)

    Hi,
    We have an urgent situation here and trouble finding the solution in correct way. Below is the explanation....Hope it would not be so complicated....
    I have 3 tables - 2 dimension (Product, Customer), 1 Fact (Dollars) as below - I want to have a report as Dollars by Customer for a specific product group below is the structure and Desired result output.
    I want the actual steps to implement it - Its kind of Urgent - Truly appreciate your help!!!
    Customer Table:*
    Customer ID - Customer Name                    
    1     - Tom                    
    2     - Jill                     
    3     - Caron     
    Product Table:_
    Product ID -     Product Type -      Product Key               
    100     -     DL      -     28               
    200     -     HS      -     28               
    Dollars (Fact):_
    Universal ID     - Dollars -     Customer ID - Product ID           
    1001     -     2222 -          1     - 100          
    1001 -     0     -     2     - 200          
    1002     -     3333 -     1     - 100          
    1002     -     0     -     3     - 200          
    1003     -     4444 -     1     - 100          
    1003     -     0     -     3     - 200          
    Want to See the Result as below     (Like Profit by each customer for Product Key =28)
    Customer Name     - Dollars                          
    Tom      - 0                    
    Jill      - 2222                    
    Caron - 7777                    
    Condition: Where Product Key = 28
    Edited by: 964859 on Oct 11, 2012 4:17 PM

    And you think if you yell "Urgent!" and put a lot of exclamation points that we will do your homework for you?
    >
    I want the actual steps to implement it - Its kind of Urgent > This is a free forum, not a personal "do it for you service." If it is urgent, you should hire a consultant.

  • Help Needed on report Urgent

    Hi Experts
    my requirement is to combine the standard selection screens of T-CODE IW39 & IW59 as a one selection screen.
    i tried  a lot but i'm unable to do it.
    in these selection screens some blocks are called by dynamically through ldb. if i copied standard prog of T-CODE IW39 as zprogram it dispalying the whole selection screen but at that time i'm unable to merge IW59 selection screen code with this caode.
    can any help me urgent .plz

    hi
    chk this out
    SELECTION-SCREEN: Special Variant for Logical Databases
    You may only use these variants in the INCLUDE program DBldbSEL of logical database ldb.
    Variants:
    1.SELECTION-SCREEN BEGIN OF VERSION vers TEXT-xxx.
    2. SELECTION-SCREEN END OF VERSION vers.
    3. SELECTION-SCREEN EXCLUDE ... .
    4.SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE dbtab.
    5.SELECTION-SCREEN FIELD SELECTION FOR TABLE dbtab.
    6.SELECTION-SCREEN DYNAMIC SELECTIONS FOR NODE node.
    7.SELECTION-SCREEN FIELD SELECTION FOR NODE node.
    Variant 1
    SELECTION-SCREEN BEGIN OF VERSION vers TEXT-xxx.
    Variant 2
    SELECTION-SCREEN END OF VERSION vers.
    Variant 3
    SELECTION-SCREEN EXCLUDE ... .
    Effect
    Defines a selection screen version (three character name vers). Between BEGIN OF VERSION and END OF VERSION , you can exclude selection screen objects from version vers using SELECTION-SCREEN EXCLUDE. This allows you to reduce the database-specific part of the standard selection screen to those objects relevant to the report in question without having to sacrifice important selection criteria in other reports.
    You activate a selection screen version for a report by entering it in the report attributes. If the database access program SAPDBldb itself has a selection screen version in its attributes, this applies to all reports that use the logical database and for which you have not declared a particular selection screen variant.
    The function of the text symbol TEXT-xxx is to enable users to choose a selection screen variant using F4 help on the program attributes screen.
    Extras:
    (for SELECTION-SCREEN EXCLUDE) 1. ... PARAMETERS par 2. ... SELECT-OPTIONS sel
    3. ... RADIOBUTTON GROUPS radi
    4. ... BLOCKS block
    5. ... IDS id
    Effect
    Excludes selection screen objects between SELECTION-SCREEN BEGIN and END OF VERSION. You can also exclude individual parameters, select-options, and radiobutton groups, within SELECTION-SCREEN BEGIN/END OF BLOCK blocks, and other SELECTION-SCREEN objects such as comments and underlines using the ID id addition.
    Notes
    You can only exclude objects of the DS:ABEN.SELECTION_SCREEN>standard selection screen 1000, not any that belong to a screen defined using SELECTION-SCREEN BEGIN OF SCREEN ... AS SUBSCREEN. If the standard selection screen includes objects from other screens ( SELECTION-SCREEN INCLUDE ... ID ...), you can use SELECTOIN-SCREEN EXCLUDE IDS ... to exclude them from the screen.
    The database program SAPDBldb can use the function module RS_SELSCREEN_VERSION to use the active version of the selection screen for the current report.
    Example
    TABLES SPFLI.
    NODES CHARLY.                  " with structure SFLIGHT
    PARAMETERS PAR_1 LIKE SPFLI-CARRID FOR TABLE SPFLI.
    SELECT-OPTIONS SEL_1 FOR SPFLI-CONNID.
    SELECT-OPTIONS SEL_2 FOR CHARLY-FLDATE.
    SELECT-OPTIONS SEL_3 FOR SPFLI-CITYFROM.
    SELECTION-SCREEN COMMENT /10(20) TEXT-100 FOR TABLE SFLIGHT ID 001.
    SELECTION-SCREEN COMMENT /8(30) TEXT-200 FOR NODE CHARLY ID 002.
    SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN NO INTERVALS.
      SELECTION-SCREEN BEGIN OF BLOCK B100 WITH FRAME TITLE TEXT_001.
        PARAMETERS P100_1 TYPE SFLIGHT-SEATSMAX FOR NODE CHARLY.
      SELECTION-SCREEN END OF BLOCK B100.
    SELECTION-SCREEN END OF SCREEN 100.
    PARAMETERS PAR_2 LIKE SY-SUBRC FOR TABLE SFLIGHT.
    PARAMETERS PAR_3 LIKE CHARLY-PLANETYPE FOR NODE CHARLY.
    SELECTION-SCREEN BEGIN OF VERSION ABC TEXT-008.
      SELECTION-SCREEN EXCLUDE PARAMETERS: PAR_1, PAR_3.
      SELECTION-SCREEN EXCLUDE SELECT-OPTIONS SEL_2.
      SELECTION-SCREEN EXCLUDE IDS 001.
    SELECTION-SCREEN END   OF VERSION ABC.
    SELECTION-SCREEN BEGIN OF VERSION XYZ TEXT-XYZ.
      SELECTION-SCREEN EXCLUDE IDS 100.
    SELECTION-SCREEN END OF VERSION XYZ.
    If the report attributes (or the attributes of database program SAPDBldb) contain the selection screen version ABC, the parameters PAR_1 and PAR_3, the select-option SEL_2 and the comment with text number 100 (ID 001) do not appear on the selection screen. Text symbol 008 of SAPDBldb is displayed if you choose F4 help for the 'Selection screen version' field.
    If the program attributes (or the attributes of the database program SAPDBldb) contain the selection screen version XYZ, the block B100 containing the parameter P100_1 does not appear on the standard selection screen 1000, but it does appear on the subscreen 100..
    Variant 4
    SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE dbtab.
    Variant 6
    SELECTION-SCREEN DYNAMIC SELECTIONS FOR NODE
    node.
    Extras:
    ... ID id
    Effect
    This statement returns the tables or nodes of the logical database for which additional selections are supported. If one of these tables or nodes is active in the report (declared using TABLES or NODES, or in the path from the database hierarchy root to a table declared using TABLES or NODES), the 'Free selections' pushbutton appears on the selection screen. If the user chooses this function, the system branches to a dialog in which the user can enter selections for the relevant fields of the appropriate tables. There are two ways to set the fields for which users can make free selections:
    Using a selection view created for that purpose:
    You maintain selection views within logical database maintenance. They consist of a set of fields from tables in the logical database that are divided into groups. You can also preselect fields here. Customers may overlay the selection view (that is, the system searches first for a customer-specific selection view. Only if one does not exist will the system display the SAP selection view).
    If you have already made a preselection in the selection view, the user sees the selection screen for the preselected fields on which to enter his or her selections. If no fields have been preselected, the user must first select some.
    Using all fields of all tables
    In this case, the user must choose the table and then the fields for which he or she wants to define additional selections. Having selected these, he or she then passes to the selection screen for entering the free selections.
    The database access program SAPDBldb takes on the form of a complex data object DYN_SEL consisting of WHERE clauses generated by the user input for dynamic database access.
    Note
    You cannot use free selections for nodes with type C (complex data objects).
    Note
    The precise definition of the object DYN_SEL is stored in TYPE-POOL RSDS and reads:
    TYPES: BEGIN OF RSDS_WHERE,
             TABLENAME LIKE RSDSTABS-PRIM_TAB,
             WHERE_TAB LIKE RSDSWHERE OCCURS 5,
           END OF RSDS_WHERE.
    TYPES: BEGIN OF RSDS_TYPE,
             CLAUSES TYPE RSDS_WHERE OCCURS 5,
             TEXPR   TYPE RSDS_TEXPR,
             TRANGE  TYPE RSDS_TRANGE,
           END   OF RSDS_TYPE.
    DATA DYN_SEL TYPE RSDS_TYPE.
    The object DYN_SEL contains (amongst other elements) a component (CLAUSES), which is an internal table. Each line in the internal table contains a table name (TABLENAME) and a further internal table (WHERE_TAB), that contains the WHERE clauses for table (TABLENAME).
    The structure of the two other components is contained in type pool RSDS.
    TEXPR contains the selections in a storeable format that you can use for the 'freely callable' function modules used to enter free selections ( FREE_SELECTIONS_INIT, FREE_SELECTIONS_DIALOG). TRANGE contains the selections in the form of RANGES tables , that you can use with the IN operator in the SELECT, CHECK and IF statements.
    Note
    Neither the TYPE-POOL RSDS nor the declaration of DYN_SEL need to be written into the database program: both are automatically included by the system.
    In the database program SAPDBldb, an access to a table XXXX might look like this:
    FORM PUT_XXXX.
      DATA L_DS_CLAUSES TYPE RSDS_WHERE.
      MOVE 'XXXX' TO L_DS_CLAUSES-TABLENAME.
      READ TABLE DYN_SEL-CLAUSES WITH KEY L_DS_CLAUSES-TABLENAME
                                 INTO L_DS_CLAUSES.
      SELECT * FROM XXXX
               WHERE field1 IN ...
               AND   field2 ....
               AND (L_DS_CLAUSES-WHERE_TAB).
          PUT XXXX.
      ENDSELECT.
    ENDFORM.
    Note
    If the table L_DS_CLAUSES-WHERE_TAB is empty (in other words, there are no free selections for table XXXX), the system ignores the addition ... AND (L_DS_CLAUSES-WHERE_TAB) in the SELECT statement.
    Variant 5
    SELECTION-SCREEN FIELD SELECTION FOR TABLE dbtab.
    Variant 7
    SELECTION-SCREEN FIELD SELECTION FOR NODE node.
    Extras:
    ... ID id
    Effect
    This statement returns the tables and nodes of the logical database for which field selections are supported.
    If required by the report, not all fields of these tables and nodes are filled from the database, but only those that the report needs. You declare these fields in the report using GET dbtab FIELDS f1 ... fn or GET dbtab LATE FIELDS f1 ... fn (the field list is then completed by the system, using the key fields of table dbtab).
    You can improve performance considerably by restricting the fields used to those that are really necessary.
    The database access program SAPDBldb receives the fields for the dynamic field selection in the form of an internal table SELECT_FIELDS.
    Note
    You cannot use this addition for nodes with type C (complex data objects).
    Note
    The exact definition of the object SELECT_FIELDS is stored in TYPE-POOL RSFS and reads:
    TYPES: BEGIN OF RSFS_TAB_FIELDS,
             TABLENAME LIKE RSDSTABS-PRIM_TAB,
             FIELDS LIKE RSFS_STRUC OCCURS 10,
           END OF RSFS_TAB_FIELDS.
    TYPES: RSFS_FIELDS TYPE RSFS_TAB_FIELDS OCCURS 10.
    DATA SELECT_FIELDS TYPE RSFS_FIELDS.
    SELECT_FIELDS is an internal table. Each line of the internal table contains a table name (TABLENAME) and a further internal table (FIELDS) containing the fields of table (TABLENAME).
    Note
    You do not need to declare the TYPE-POOL RSFS or SELECT_FIELDS in the database program, since both are included automatically by the system. Unlike the objects linked using the DYNAMIC SELECTIONS addition, SELECT_FIELDS is also available in the report.
    In the database program SAPDBldb, an access to table XXXX might look like this:
    FORM PUT_XXXX.
      DATA L_TAB_FIELDS TYPE RSFS_TAB_FIELDS.
      MOVE 'XXXX' TO L_TAB_FIELDS-TABLENAME.
      READ TABLE SELECT_FIELDS WITH KEY L_TAB_FIELDS-TABLENAME
                               INTO L_TAB_FIELDS.
      SELECT (L_TAB_FIELDS-FIELDS)
                 INTO CORRESPONDING FIELDS OF XXXX
                 FROM XXXX
             WHERE field1 IN ...
             AND   field2 ....
          PUT XXXX.
      ENDSELECT.
    ENDFORM.
    Notes
    If table L_TAB_FIELDS is empty (in other words, the report for table XXXX does not require any field selection), SELECT (L_TAB_FIELDS) ... behaves like SELECT * ..., that is, all fields of table XXXX are filled.
    The internal table SELECT_FIELDS is filled when the INIT routine runs in the database program or when the INITIALIZATION runs in the report. The program can access it if the logical database requires extra fields.

  • Displaying image in ABAP report "Urgent"

    Hi Everyone
    My requirement is as follows...
    On Material Master there is an image stored in document management system.
    In a report we need to display the material details plus the image from DMS system.
    I heard that there is some function module in this area.
    Can anyone pls help how can i achieve this....
    Kindly help as soon as possible.
    Thanks
    Regards
    Naveen

    Hi Naveen,
    Hope the report is ALV..
    Re: How do I insert a logo in ALV using Function Modules?
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid.htm
    Steps for uploading Logo :-:
    1. Goto the transaction OAER
    2. Enter the class name as 'PICTURES'
    3. Enter the class type as 'OT'
    4. Enter the object key as the name of the logo you wish to give
    5. Execute
    6. Then in the new screen select Standard doc. types in bottom window
    Click on the Screen icon
    Now, it will ask for the file path where you have to upload the logo
    7. Now you can use this logo in REUSE_ALV_COMMENTARY_WRITE
    Here you go !!
    *& Form TOP_OF_PAGE
    text
    FORM F_TOP_OF_PAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = IT_LISTHEADER
    i_logo = Logo name
    I_END_OF_LIST_GRID =.
    ENDFORM. "TOP_OF_PAGE
    <b>Reward points if this helps.
    Manish</b>

  • GR/IRN REPORT urgent

    Hi guru's this is very urgent issue...
    i need GR/IR accounts for one particular vendor
    for this i use  Tcode fbl3n... i gave GR/IR no. i was dowloading this file
    sort it vendor wise.
    here WE , RE  two document type  is there
    which one i have to take report???? just tell me
    ( i have submit report document type WE but it snot correct ithink thats why iam asking you)  pleas help me out.

    Hi
    Document type WE is created when goods are received... ie. in MIGO
    Entry           Dr Inventory a/c   ;     Cr GR/IR a/c
    Document type RE is created at the time of Invoice i.e. in MIRO
    Entry           Dr GR/IR a/c   ;    Cr Vendor  a/c
    So take RE to see the GR/IR accoutns for one particular vendor.
    Radha

  • Material stock report urgent

    Hi ABAP Guru's
    I got a requirement to develop an report which lists the stock(Opening Stock and Closing stock) for each material of a plant in given date range.whose Values to be matched with either MB5B or MC.9 Tcodes.I have found few tables for Stock like MBEW,MARD but those values are not matching with the Transactions.Can u tell me exactly how can i develop this report.? I'll be very thankful if u do the same.
    DESCRIPTION TABLENAME FIELD NAME
    Plant :
    Material :
    Material group :
    From date :
    to date :
    opening stock :
    total receipt qty :
    total issue qty :
    closing stock :
    unit :
    please provide me table-field name
    its urgent
    regards
    rakesh

    Hi
    is you problem is solved if solved please sene me your code ,i do have same kind of requirment...

  • : HIDING SUMMARY COLUMNS IN MATRIX REPORT , URGENT

    Hi,
    Can any one please tell me how to hide a column in oralce matrix report. Its a summary column for the matrix report which appears next to the cell values. For example
    Manufacturer
    Brand
    SubBrand1 SubBrand2 Brand Total Manufacturer Total
    Week $ Sales $ Sales Total $ Sales Total $ Sales
    This is a case where,the cell value is the $ sales for the SubBrand for the week. And it gets total at each brand level and each Manufacturer level. The requrement is if there is only one SubBrand for a Brand then the Brand total should not appear on the report. Similarly if there is one Brand for a Manufacturer, then the total at Manufacturer level should not appear . The point is not only it should dissapear but the frame should srink to make it fell that there is no totaling going on at those two levels. If the fileds just remains blank then the report looks odd. So the gap should be srinked as well. How to do it . This is very urgent . Please help me out.
    Thanks
    Feroz

    use a formst trigeer on the field that returns false when you don't want to display the field.

  • Regarding report(urgent)

    Hi experts,
    i need to add some fields to output of the report.
    here i am giving the fields required to add and giving the code below please build the code
    , we need to add the following data in the report output.
        > GR Document (RSEG-LFBNR)
        > GR date (MKPF-BLDAT)
        > Quantity (MSEG-ERFMG)
        > Amount in LC(MSEG-DMBTR)
        > GL Account (MSEG-SAKTO)
    Logic in getting the record:
        > for each invoice no(RESG-BELNR) of a PO Line(EKKO-EBELN,EKPO-EBELP), get GR no (RSEG-LFBNR) and doc. year(RSEG-LFGJA),  
        > select the matching record in MSEG using the GR no and year  (RSEG-LFBNR = MKPF-MBLNR & RSEG-LFGJA=MKPF-MJAHR,                                                                               
    EKKO-EBELN=RSEG- EBELN,EKPO-EBELP=RSEG-EBELP)
        > select the matching record in MKPF using the GR no and year (RSEG-LFBNR = MKPF-MBLNR & RSEG-LFGJA=MKPF-MJAHR)
    here iam giving my code  we have to add thos fields into this code:
    TABLES: ekko,   "Purchasing Document Header
            ekpo,   "Purchasing Document Item
            rbkp.   "Document Header: Invoice Receipt
    Type-Pools
    TYPE-POOLS : slis.   " Has to be declared to use ALVs
    To hold ALV field catgory data
    DATA : it_fieldcat TYPE slis_t_fieldcat_alv,
           wa_fieldcat LIKE LINE OF it_fieldcat.
    Internal tables declarations
    Internal table to hold Report data
    DATA: BEGIN OF it_output OCCURS 0,
           dir_indir(9),
           bukrs LIKE ekko-bukrs,    "company code
           ebeln LIKE ekko-ebeln,    "Purchasing Document Number
           ebelp LIKE ekpo-ebelp,    "Item
           aedat LIKE ekko-aedat,    "Date on which the record was created
           belnr LIKE rseg-belnr,    "Accounting document number
           bldat LIKE rbkp-bldat,    "Document date in document
           budat LIKE rbkp-budat,    "Posting date in the document
           wrbtr LIKE rseg-wrbtr,    "Amount in document currency
           curr  LIKE t880-curr,     "Price unit (Local Curr)
           bednr LIKE ekpo-bednr,    "Requirement tracking number
           lifnr LIKE ekko-lifnr,    "Vendor's account number
           name1 LIKE lfa1-name1,                               "name1
           name2(30),                "preparer name
           name3(30),                "requester name
           gjahr LIKE rseg-gjahr,    "Fiscal year
           ernam LIKE ekko-ernam,    "Name of Person who Created the Object
           kursf LIKE rbkp-kursf,    "Exchange rate
           shkzg LIKE rseg-shkzg,    "Debit/credit indicator
           banfn LIKE ekpo-banfn,    "Purchase requisition number
            bnfpo like eban-bnfpo,
           knttp LIKE ekpo-knttp,    "account assignment category
          END OF it_output.
    Selection Screen
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_bukrs LIKE ekko-bukrs OBLIGATORY.
    Parameters: P_knttp like ekpo-knttp as checkbox default 'X'.
    SELECT-OPTIONS: s_invdat FOR rbkp-bldat,    "Document date in document
                    s_vendor FOR ekko-lifnr,    "Vendor's account number
                    s_purcdo FOR ekko-ebeln,    "Purchasing Document no
                    s_credat FOR ekko-aedat OBLIGATORY,"create date
                    s_plant  FOR ekpo-werks,    "Plant
                    s_doctyp FOR ekko-bsart,    "Purchasing document type
                    s_purorg FOR ekko-ekorg,    "Purchasing organization
                    s_trcnum FOR ekpo-bednr,    "Requirement tracking number
                    s_knttp  FOR ekpo-knttp.    "account assignment category
    SELECTION-SCREEN: END OF BLOCK b1.
    DATA: count TYPE i VALUE 0.            " Used to count records
              INITIALIZATION                                             *
    INITIALIZATION.
    At Selection Screen
    AT SELECTION-SCREEN.
    Checking for the input values of selection screen fields.
      PERFORM validate_params.
    Start Of Selection
    START-OF-SELECTION.
    if p_knttp = 'X'.
    PERFORM get_data.
    else.
    skip.
    *message e021 with 'no output'.
    endif.
      PERFORM get_data.
    End Of Selection
    END-OF-SELECTION.
    SUBROUTINE TO CALL THE FUNCTION MERGE TO ENSURE PROPER DISPLAY.
      PERFORM merge_fieldcatalog.
      PERFORM modify_fieldcat.
      PERFORM alv_report.
          FORM validate_params                                          *
    FORM validate_params.
    Validate company code
      SELECT SINGLE COUNT(*) FROM t001 WHERE bukrs = p_bukrs.
      IF sy-subrc <> 0.
        MESSAGE e021 WITH 'Please enter a valid Company code'.
      ENDIF.
    *Validate Vendor.
      SELECT SINGLE COUNT(*) FROM lfa1 WHERE lifnr IN s_vendor.
      CASE sy-subrc.
        WHEN 0.
        WHEN OTHERS.
          MESSAGE e021 WITH 'Please enter a valid Vendor'.
      ENDCASE.
    *Validate PO doc type
      SELECT SINGLE COUNT(*) FROM t161 WHERE bsart IN s_doctyp.
      CASE sy-subrc.
        WHEN 0.
        WHEN OTHERS.
          MESSAGE e021 WITH 'Please enter a valid PO Doc. Type'.
      ENDCASE.
    *Validate plant
      SELECT SINGLE COUNT(*) FROM t001w WHERE werks IN s_plant.
      CASE sy-subrc.
        WHEN 0.
        WHEN OTHERS.
          MESSAGE e021 WITH 'Please enter a valid Plant. Type'.
      ENDCASE.
    *Validate Purch. Org
      SELECT SINGLE COUNT(*) FROM t024e WHERE ekorg IN s_purorg.
      CASE sy-subrc.
        WHEN 0.
        WHEN OTHERS.
          MESSAGE e021 WITH 'Please enter a valid Purch. Org.'.
      ENDCASE.
    ENDFORM.                               " PERFORM VALIDATE_PARAMS.
          FORM get_data                                                 *
    FORM get_data.
      DATA: l_persnumber LIKE usr21-persnumber.
    Get PO data
      SELECT a~bukrs a~ebeln b~ebelp a~aedat a~lifnr a~ernam
             b~knttp b~bednr b~banfn
             c~belnr c~wrbtr c~gjahr c~shkzg
             d~bldat d~budat d~kursf
             e~dir_indir
      INTO CORRESPONDING FIELDS OF TABLE it_output
      FROM ekko AS a
      JOIN ekpo AS b ON b~ebeln = a~ebeln
      JOIN rseg AS c ON c~ebeln = b~ebeln
                    AND c~ebelp = b~ebelp
                    AND c~bukrs = a~bukrs
      JOIN rbkp AS d ON d~belnr = c~belnr
                    AND d~gjahr = c~gjahr
      LEFT JOIN zpo_dirindir AS e ON e~knttp = b~knttp
      WHERE a~bukrs = p_bukrs
        AND a~lifnr IN s_vendor
        AND a~ebeln IN s_purcdo
        AND a~bsart IN s_doctyp
        AND a~ekorg IN s_purorg
        AND a~aedat IN s_credat
        AND b~knttp IN s_knttp
        AND b~werks IN s_plant
        AND b~bednr IN s_trcnum.
      LOOP AT it_output.
      Get posting date, Doc. date & Curr. Key
        IF it_output-kursf > 0.
          it_output-wrbtr = it_output-wrbtr * it_output-kursf.
          else.
          if it_output-kursf < 0.
         it_output-wrbtr =   it_output-Wrbtr * ( 1 / it_output-kursf ).
           it_output-wrbtr = abs( it_output-wrbtr ).
          endif.
        ENDIF.
      get local currency
        SELECT SINGLE waers INTO it_output-curr FROM t001
                 WHERE bukrs = it_output-bukrs.
      Get vendor name.
        SELECT SINGLE name1 FROM lfa1 INTO it_output-name1
        WHERE lifnr = it_output-lifnr.
      Get PO created person name
        SELECT SINGLE persnumber INTO l_persnumber FROM usr21
         WHERE bname = it_output-ernam.
        IF sy-subrc = 0.
          SELECT SINGLE name_text FROM adrp INTO it_output-name2
           WHERE persnumber = l_persnumber.
       ELSE.
          it_output-name2 = it_output-ernam.
        ENDIF.
      Get get requested by from Unloading point in PO
      else PR created by (If PR exists)
        CASE it_output-dir_indir.
          WHEN 'I'.
          Take requested by from Unloading point.
            SELECT SINGLE ablad INTO it_output-name3 FROM ekkn
             WHERE ebeln = it_output-ebeln
               AND ebelp = it_output-ebelp .
          WHEN 'D'.
           SELECT SINGLE ernam INTO it_output-name3 FROM eban
            WHERE banfn = it_output-banfn
                     AND ebelp = it_output-ebelp.
           IF sy-subrc <> 0.
             MOVE it_output-ernam TO it_output-name3.
           ENDIF.
           SELECT SINGLE persnumber INTO l_persnumber FROM usr21
               WHERE bname = it_output-name3.
           IF sy-subrc = 0.
             SELECT SINGLE name_text FROM adrp INTO it_output-name3
              WHERE persnumber = l_persnumber.
           ENDIF.
    select single ernam into  it_output-name3 from eban where
         banfn = it_output-banfn and bnfpo = it_output-bnfpo.
                 move it_output-name3 to it_output-name3.
                if sy-subrc = 0.
            SELECT SINGLE PERSNUMBER INTO L_PERSNUMBER FROM USR21
                WHERE BNAME = it_output-name3.
            IF SY-SUBRC = 0.
              SELECT SINGLE NAME_TEXT FROM ADRP INTO it_output-name3
               WHERE PERSNUMBER = L_PERSNUMBER.
            ELSE.          it_output-name3 = it_output-name3.
            endif.
          else.
            SELECT SINGLE PERSNUMBER INTO L_PERSNUMBER FROM USR21
                    WHERE BNAME = it_output-ernam.
            IF SY-SUBRC = 0.
              SELECT SINGLE NAME_TEXT FROM ADRP INTO it_output-name3
               WHERE PERSNUMBER = L_PERSNUMBER.
            ELSE.
              it_output-name3 = it_output-ernam.
            endif.
          endif.
        ENDCASE.
      translate direction indicator to Indirect or Direct
        CASE it_output-dir_indir.
          WHEN 'I'. it_output-dir_indir = 'Indirect'.
          WHEN 'D'. it_output-dir_indir = 'Direct'.
        ENDCASE.
        MODIFY it_output.
      ENDLOOP.
    ENDFORM.
    FORM MERGE_FIELDCATALOG                                             *
    FORM merge_fieldcatalog.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                i_program_name         = sy-cprog
                i_internal_tabname     = 'IT_OUTPUT'
                i_inclname             = sy-cprog
           CHANGING
                ct_fieldcat            = it_fieldcat[]
           EXCEPTIONS
                inconsistent_interface = 1
                program_error          = 2
                OTHERS                 = 3.
    ENDFORM. " MERGE_FIELDCATALOG
          FORM modify_fieldcat                                          *
    FORM modify_fieldcat.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      LOOP AT it_fieldcat INTO wa_fieldcat.
        CASE wa_fieldcat-fieldname.
          WHEN 'DIR_INDIR'.
            wa_fieldcat-seltext_m = 'Direct/Indirect'.
          WHEN 'NAME2'.
            wa_fieldcat-seltext_m = 'PREPARER NAME'.
          WHEN 'NAME3'.
            wa_fieldcat-seltext_m = 'REQUESTER NAME'.
          WHEN 'BEDNR'.
            wa_fieldcat-seltext_m = 'SSP PO'.
          WHEN 'AEDAT'.
            wa_fieldcat-seltext_m = 'PO DOCUMENT DATE'.
          WHEN 'BLDAT'.
            wa_fieldcat-seltext_m = 'INVOICE DOCU DATE'.
          WHEN 'BUDAT'.
            wa_fieldcat-seltext_m = 'POSTAGE DATE'.
          WHEN 'WRBTR'.
            wa_fieldcat-seltext_m = 'LOCAL AMOUNT'.
            wa_fieldcat-cfieldname = 'CURR'.
            wa_fieldcat-ctabname   =  wa_fieldcat-tabname.
          WHEN 'CURR'.
            wa_fieldcat-seltext_m = 'LOCAL CURR'.
          WHEN 'NAME1'.
            wa_fieldcat-seltext_m = 'VENDOR NAME'.
        ENDCASE.
        MODIFY it_fieldcat FROM wa_fieldcat.
      ENDLOOP.
    ENDFORM.
          FORM ALV_REPORT                                               *
    FORM alv_report.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program = sy-cprog
                it_fieldcat        = it_fieldcat[]
           TABLES
                t_outtab           = it_output[].
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

    Very sorry to say this Venu ...
    This is a forum to ask doubts .. "Not get your work done for Free"
    Kindly try to do it yourself first & then if you are stuck somewhere fell free to shout for help
    Best regards,
    Gaurav

  • Date problem for a report (urgent)

    hi all ,
    i am developing a report for asset aquisition of fi module.
    in this my client has requirement like this-
    1. if i enter date in selection screen ie 31.03 2006 or less than that
         then i should get all the records from 01.04.2005 to the date which i have
        entered in selction screen ie might be 31.03.2006 or less than that.
      2. but if i enter date in selection screen any date more  than 31.03.2006
         then i should get all the records from 01.04.2006 to the date which i have
        entered in selction screen .
    ex- if i have entered 22.12.2006 then i should get record from
          01.04.2006 to 22.12.2006.
    bcoz indian fiscal year starts from 1st april and ends at 31st march.
    so plz give the solution.
    Thanks & Regards
    Sanjeev

    hi mr reddy,
    thanks for the reply.
    here i am sending my code just make the modification in it wherever
    it is required, bcoz i m also using some date logic for it.
    so i request u to modify my code and check it that wethere its working
    correctly after applying ur logic.
    bcoz right now if i am entering any date  suppose 22.12.2006
    then i am getting all the record from 01.04.2005 to 22.12.2006.
    but it should display only from 01.04.2006 to 22.12.2006.
    but ya one more thing i want to make it in ur notice that
    if i have entered 31.03.2006 then it should show
    records from 01.04.2005 to 31.03.2006.
    so both of my above requirement should fulfill out of which one i am alraedy getting.
    check my code and do the modification as per ur logic.
    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,
           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,
            XBLNR LIKE ANEK-XBLNR,
            SGTXT LIKE ANEK-SGTXT,
            ANSWL LIKE ANLC-ANSWL,
            NAFAP LIKE ANLC-NAFAP,
            AAFAP LIKE ANLC-AAFAP,
            ANLKL LIKE ANLA-ANLKL,
            GJAHR LIKE ANEK-GJAHR,
            END OF IT_FINAL.
    *added for date logic by sanjeev
    DATA:V_LOW LIKE SY-DATUM,
        V_HIGH LIKE SY-DATUM,
        V_YEAR(04) TYPE N.
    *end of date logic
    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.
    SELECTION-SCREEN : END OF BLOCK B_FA.
    SET PF-STATUS '100'.
    added for date logic by Sanjeev
    IF S_BUDAT-HIGH IS INITIAL.
    V_YEAR = S_BUDAT-LOW+0(4).
    V_YEAR = V_YEAR - 1.
    CONCATENATE V_YEAR '0401' INTO V_LOW.
    V_HIGH = S_BUDAT-LOW.
    ELSE.
    V_LOW = S_BUDAT-LOW.
    V_HIGH = S_BUDAT-HIGH.
    ENDIF.
    end of logic
    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
           AND   ZUGDT >= V_LOW  " added to get the date logic work
           AND   ZUGDT <= V_HIGH. " added to get the date logic work
    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    " added to get the date logic work
           AND   BUDAT <= V_HIGH.  " added to get the date logic work
    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'.
    SORT T_ANLC BY BUKRS ANLN1 ANLN2.
    SORT T_ANLZ BY BUKRS ANLN1 ANLN2.
    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.
    added to get the date logic work
    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.
        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.

  • Time out error in report - Urgent

    Hi Gurus,
       Am developing the report for GL Account summary from tables bkpf, bseg. Due to lot of records in production server it is coming time out error. Please help me regarding this here am attaching my code.
    REPORT ZFBLREPORT.
    *TABLES : zgltax.
    TYPE-POOLS : SLIS.
    TYPES : BEGIN OF TY_ZGLTAX,
            ZGL TYPE BSEG-HKONT,
            ZTAX1 TYPE P DECIMALS 2,
            ZTAX2 TYPE P DECIMALS 2,
            CAMOUNT TYPE RF42B-SALDO,
            PAMOUNT TYPE RF42B-SALDO,
            TCAMOUNT TYPE RF42B-SALDO,
            TPAMOUNT TYPE RF42B-SALDO,
            END OF TY_ZGLTAX.
    TYPES : BEGIN OF TY_BKPF,
            BELNR TYPE BKPF-BELNR,
            BUDAT TYPE BKPF-BUDAT,
            END OF TY_BKPF.
    TYPES : BEGIN OF TY_BSEG,
            BELNR TYPE BSIS-BELNR,
            DMBTR TYPE BSIS-DMBTR,
            SHKZG TYPE BSIS-SHKZG,
            HKONT TYPE BSIS-HKONT,
            BUDAT TYPE BSIS-BUDAT,
            BUZEI TYPE BSIS-BUZEI,
            END OF TY_BSEG.
    DATA : IT_FINAL TYPE STANDARD TABLE OF TY_ZGLTAX,
           WA_FINAL TYPE TY_ZGLTAX.
    DATA : IT_BKPF TYPE STANDARD TABLE OF TY_BKPF,
           WA_BKPF TYPE TY_BKPF.
    DATA : IT_BSEG TYPE STANDARD TABLE OF TY_BSEG,
           WA_BSEG TYPE TY_BSEG.
    DATA: CAMOUNT TYPE RF42B-SALDO,
          PAMOUNT TYPE RF42B-SALDO.
    DATA : INDEX TYPE SY-INDEX.
    DATA : ID TYPE SY-TABIX.
    DATA : START_DATE TYPE SY-DATUM.
    DATA : END_DATE TYPE SY-DATUM.
    DATA : START_QUATER TYPE SY-DATUM.
    DATA : YEAR1(4) TYPE C.
    DATA       : T_FIELDALV     TYPE SLIS_T_FIELDCAT_ALV.
    DATA       : IMPORT_VARIANT LIKE DISVARIANT.
    DATA       : XREPID         LIKE SY-REPID.
    DATA       : LAYOUT         TYPE SLIS_LAYOUT_ALV.
    SELECTION-SCREEN BEGIN OF BLOCK BK1 WITH FRAME TITLE TEXT-001.
    PARAMETER : P_PERIOD(1) TYPE C OBLIGATORY,
                P_YEAR(4) TYPE C OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK BK1.
    AT SELECTION-SCREEN ON P_PERIOD.
      IF P_PERIOD > '4' OR P_PERIOD < '1'.
        P_PERIOD = ''.
        MESSAGE 'Enter Correct Quater Period' TYPE 'E'.
      ENDIF.
    START-OF-SELECTION.
      PERFORM CALC_DATE.
      PERFORM BUILD_LOGIC.
      PERFORM INITIAL_ALV_FIELDCAT CHANGING T_FIELDALV[].
      PERFORM LAYOUT.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM     = SY-REPID
          I_GRID_TITLE           = 'FBT Report'
         i_callback_top_of_page = 'FORM_TOP_PAGE'
         it_sort                = p_sort
          IS_LAYOUT              = LAYOUT
          IT_FIELDCAT            = T_FIELDALV[]
          I_SAVE                 = 'A'
        TABLES
          T_OUTTAB               = IT_FINAL.
    *&      Form  calc_date
          text
    -->  p1        text
    <--  p2        text
    FORM CALC_DATE .
      IF P_PERIOD = '1'.
        CONCATENATE P_YEAR '04' '01' INTO START_DATE.
        CONCATENATE P_YEAR '04' '01' INTO START_QUATER.
        CONCATENATE P_YEAR '06' '30' INTO END_DATE.
      ELSEIF P_PERIOD = '2'.
        CONCATENATE P_YEAR '04' '01' INTO START_DATE.
        CONCATENATE P_YEAR '07' '01' INTO START_QUATER.
        CONCATENATE P_YEAR '09' '30' INTO END_DATE.
      ELSEIF P_PERIOD = '3'.
        CONCATENATE P_YEAR '04' '01' INTO START_DATE.
        CONCATENATE P_YEAR '10' '01' INTO START_QUATER.
        CONCATENATE P_YEAR '12' '31' INTO END_DATE.
      ELSEIF P_PERIOD = '4'.
        CONCATENATE P_YEAR '04' '01' INTO START_DATE.
        YEAR1 = P_YEAR + 1.
        CONCATENATE YEAR1 '01' '01' INTO START_QUATER.
        CONCATENATE YEAR1 '03' '31' INTO END_DATE.
      ENDIF.
    ENDFORM.                    " calc_date
    *&      Form  build_logic
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_LOGIC .
      SELECT * FROM ZGLTAX INTO CORRESPONDING FIELDS OF TABLE IT_FINAL.
      IF IT_FINAL[] IS NOT INITIAL.
        LOOP AT IT_FINAL INTO WA_FINAL.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
            EXPORTING
              INPUT  = WA_FINAL-ZGL
            IMPORTING
              OUTPUT = WA_FINAL-ZGL.
          INDEX = SY-TABIX.
           SELECT belnr dmbtr shkzg hkont budat buzei
          SELECT *
          FROM BSIS
          INTO CORRESPONDING FIELDS OF TABLE IT_BSEG
          WHERE
          BUKRS = '3599' AND
             HKONT = WA_FINAL-ZGL
            AND GJAHR = P_YEAR.
    Uses primary index (4.7)
          SELECT *
          FROM BSAS
          APPENDING CORRESPONDING FIELDS OF TABLE IT_BSEG
          WHERE
          BUKRS = '3599' AND
            HKONT = WA_FINAL-ZGL
            AND GJAHR = P_YEAR.
          LOOP AT IT_BSEG INTO WA_BSEG .
            IF WA_BSEG-BUDAT >= START_DATE AND WA_BSEG-BUDAT <= END_DATE.
              IF WA_BSEG-SHKZG = 'S'.
                CAMOUNT = CAMOUNT - WA_BSEG-DMBTR.
              ELSEIF WA_BSEG-SHKZG = 'H'.
                CAMOUNT = CAMOUNT + WA_BSEG-DMBTR.
              ENDIF.
            ENDIF.
            IF WA_BSEG-BUDAT >= START_QUATER AND WA_BSEG-BUDAT <= END_DATE.
              IF WA_BSEG-SHKZG = 'S'.
                PAMOUNT = PAMOUNT - WA_BSEG-DMBTR.
              ELSEIF WA_BSEG-SHKZG = 'H'.
                PAMOUNT = PAMOUNT + WA_BSEG-DMBTR.
              ENDIF.
            ENDIF.
          ENDLOOP.
          WA_FINAL-CAMOUNT = CAMOUNT.
          WA_FINAL-PAMOUNT = PAMOUNT.
          WA_FINAL-TCAMOUNT = CAMOUNT * WA_FINAL-ZTAX1 * WA_FINAL-ZTAX2 / (
    100 * 100 ).
          WA_FINAL-TPAMOUNT = PAMOUNT * WA_FINAL-ZTAX1 * WA_FINAL-ZTAX2 / (
    100 * 100 ).
          MODIFY IT_FINAL FROM WA_FINAL INDEX INDEX.
          REFRESH IT_BSEG.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " build_logic
    *&      Form  layout
          text
    FORM LAYOUT .
      LAYOUT-NO_SUBTOTALS = ' '.
    ENDFORM.                    " LAYOUT
    *&      Form  initial_alv_fieldcat
          text
         -->FIELDCAT   text
    FORM INITIAL_ALV_FIELDCAT  CHANGING FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
      DATA  : LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
      DATA  : CNTR TYPE I VALUE 1.
      CLEAR LS_FIELDCAT.
      CNTR = CNTR + 1.
      LS_FIELDCAT-COL_POS = CNTR.
      LS_FIELDCAT-FIELDNAME = 'ZGL'.
      LS_FIELDCAT-SELTEXT_L = 'GL A/C NO'.
      LS_FIELDCAT-OUTPUTLEN = 15.
      APPEND LS_FIELDCAT TO FIELDCAT.
      CLEAR LS_FIELDCAT.
      CNTR = CNTR + 1.
      LS_FIELDCAT-COL_POS = CNTR.
      LS_FIELDCAT-FIELDNAME = 'ZTAX1'.
      LS_FIELDCAT-SELTEXT_L = 'BASE TAX  PERCENTAGE'.
      LS_FIELDCAT-OUTPUTLEN = 15.
      APPEND LS_FIELDCAT TO FIELDCAT.
      CLEAR LS_FIELDCAT.
      CNTR = CNTR + 1.
      LS_FIELDCAT-COL_POS = CNTR.
      LS_FIELDCAT-FIELDNAME = 'ZTAX2'.
      LS_FIELDCAT-SELTEXT_L = 'TAX PERCENTAGE'.
      LS_FIELDCAT-OUTPUTLEN = 15.
      APPEND LS_FIELDCAT TO FIELDCAT.
      CLEAR LS_FIELDCAT.
      CNTR = CNTR + 1.
      LS_FIELDCAT-COL_POS = CNTR.
      LS_FIELDCAT-FIELDNAME = 'CAMOUNT'.
      LS_FIELDCAT-SELTEXT_L = 'CUMULATIVE AMOUNT'.
      LS_FIELDCAT-OUTPUTLEN = 20.
      APPEND LS_FIELDCAT TO FIELDCAT.
      CLEAR LS_FIELDCAT.
      CNTR = CNTR + 1.
      LS_FIELDCAT-COL_POS = CNTR.
      LS_FIELDCAT-FIELDNAME = 'TCAMOUNT'.
      LS_FIELDCAT-SELTEXT_L = 'Cumulative Tax % Amount'.
      LS_FIELDCAT-OUTPUTLEN = 20.
      APPEND LS_FIELDCAT TO FIELDCAT.
      CLEAR LS_FIELDCAT.
      CNTR = CNTR + 1.
      LS_FIELDCAT-COL_POS = CNTR.
      LS_FIELDCAT-FIELDNAME = 'PAMOUNT'.
      LS_FIELDCAT-SELTEXT_L = 'AMOUNT FOR PERIOD'.
      LS_FIELDCAT-OUTPUTLEN = 20.
      APPEND LS_FIELDCAT TO FIELDCAT.
      CLEAR LS_FIELDCAT.
      CNTR = CNTR + 1.
      LS_FIELDCAT-COL_POS = CNTR.
      LS_FIELDCAT-FIELDNAME = 'TPAMOUNT'.
      LS_FIELDCAT-SELTEXT_L = 'Tax AMOUNT FOR PERIOD'.
      LS_FIELDCAT-OUTPUTLEN = 20.
      APPEND LS_FIELDCAT TO FIELDCAT.
    ENDFORM.                    "initial_alv_fieldcat
    Points will be awarded
    Regards
    Ravi

    Hi Ravi kanth,
    You are using select * statement which is very time consuming and low performance. Dont use select * instead use select field1 field2.... into table itab  where field1 = s_field.  Use corresponding field names in the select statement.
    Follow the below rules.
    1) Dont use nested select statements
    2) If possible use for all entries in addition
    3) In the where addition make sure you give all the primary key
    4) Use Index for the selection criteria.
    5) You can also use inner joins
    6) You can try to put the data from the first select statement into an Itab and then in order to select the data from the second table use for all entries in.
    7) Use the runtime analysis SE30 and SQL Trace (ST05) to identify the performance and also to identify where the load is heavy, so that you can change the code accordingly
    <b>reward if useful</b>.
    Regards,
    sunil kairam.

  • Problem with printing report (URGENT)

    hi every body, (urgent)
    When I print a report the margin of report not as i am like, i change the setting of printer to be suitable with what i want but nothong change,so the output of report not good.
    can any body tell me if can change margin of the printer from inside the report (at run time) or any solution.
    thanks
    null

    its the simple student management system where the teacher will input the marks of the students in particular subjects and store it in the database. now i have to print that on the report card. printing report as per student might be troublesome so i want to implement the " print all" button where the report card of all the students in that class will be printed in the report cards. its: printer printing the report of a student in the paper (A4 size) and then printer takes another paper sheet and then print the report of another student of same class until finish. how to accomplish this task?

  • Assets reports (URGENT)

    Hi all guru's
    we need Assets report with invoice date
    is it possible...
    its very urgent....'
    i can get addtion of the assets, with doucment number, date...
    but we need assets with invoice date.
    regards
    ss

    there's only abap RAZUGA_ALV01: field asset value date (bzdat)
    for analysing bldat you must create a query (sq01/2) with logical database ADA and table ANEK
    A.
    Message was edited by:
            Andreas Mann

Maybe you are looking for

  • Purch. & installed upgrade from iLife 2 to iLife 08, but I have questions..

    Hi ~ _Purchased & installed upgrade from iLife 2 to iLife 08, but I have questions..._ First I made sure I backed up my 5,500 photos in iPhoto to an external hard drive. (The only downfall to this backing-up process is that I haven't found an easy wa

  • Cache Content is Obsolete in PI 7.31 SP11

    Hello Guys, Recently we upgraded SP level from PI 7.31 SP06 to SP11 and found one error in (t.code SXI_CACHE--Delta Monitoring) when executed Error: Cache Content is Obsolete I checked the t.code SXMB_ADM_BPE and all are green. I didn't found any SAP

  • Maximum SGA size in 32-bit OS

    Hi All I want to deploy Oracle Linux 5 to set up for DBA and the server and OS is 32-bit. My questions are what is the maximum limit of SHMMAX value i can set? and for this what is the maximum size of oracle SGA? looking for your early response. Jees

  • SAP terms English and French ?

    Hello, We're now working on a system which use French , We met some difficulties in getting familiar with the terms in french .. because we've worked mostly in english, so is there any way or programme that will download the terms in french and its c

  • HT201303 How do I change the bank account details as I have changed banks

    How do I change the bank account details for my iPad as I have changed banks?