Decimal place in accounting document

Hi,
For my client for all the accounting document decimal place is set to 2.
Can any one tell me where is the configuration for setting this decimal place. I guess this is not in general settings for currency. How this decimal place for accounting documents in a company code is set ?
Please give some idea.
Regards
Roomi

hi
GOTO T CODE SU01 and then enter user name and go for change and then goto DEFAULT tab and GOTO decimal notation.....
ifuseful assign points....
regards,
santoshkumar

Similar Messages

  • Decimal Places in Purchasing (multiple currencies)

    Is it possible to change the price field to accept more than 2 decimal places in purchasing documents (contracts/PO) in a live production system for multiple currencies ?

    Hi Raja,
    No, if the said currencies already have transactions since, in SAP  the values are stored without decimals. This the warning of SAP
    <b></b>In a productive system, you must not delete the currencies in use or change the decimal places. This could make amounts in documents already posted incorrect or invalid.<b></b>.
    But you can denote in another way viz.
    1 Kg of material X = 0.012 / Kg
    can be denoted as 100 kgs = 1.2
    Prasanna

  • Decimal Places in purchasing

    Is it possible to maintain price with more than 2 decimal places in purchasing documents (contarcts/PO)?
    Thanks!
    Alok

    If you want to maintain 4 decimal places in price field
    of Po then you can define decimal places at currency key level.For example for curreny USD if you want to maintain the 4 decimal places then kindly maintain the decimal value as 4 in table TCURX for currecy key USD.the field is CURRDEC.You can also maintain this table via customizing SPRO->General Settings->Currencies->Set decimal places for currencies.
    This should helps you.
    Regards,
    Sunitha.

  • Decimal places for JPY currency in change documents

    Hi Gurus,
    For opportunities in SAP GUI the change documents for JPY show incorrect numbers.
    The number is divided by 100 (two decimal places added).
    Checked the CDPOS table and found the values already divided (two decimal places added).
    SPRO->General Settings->Currencies->Set decimal places for currencies is set for 0 decimals for JPY.
    Is there any way I can get correct values in the change documents?
    Please advice. Any hint is useful.
    Thx,
    Martin Kuma

    Hi Naren,
    Thank you for the tip, however the TCURX table is changed via customizing and should be changed only during the system initialization.
    What I would like to do, is to assure that the system displays the values in change documents correctly. It should apply the currency conversion for the data displayed the same way it does for all the tables.
    Do you have any idea, how should I do this?
    Regards,
    Martin Kuma

  • Decimal places lost after Account metadata load via ERP Integrator

    Hi!
    Does anybody faced something like this?
    I'm losing my HFM app decimal places after loading Metadata from EPRi > Metadata.
    EPM System 11.1.2.0
    Oracle EBS 12
    Thanks!
    -Cheers!

    The issue is that you are mapping "Data Value" to amount in the Target Application import format:
    SELECT SCENARIO "Scenario" 
      ,YEAR "Year"
      ,PERIOD "Period"
      ,DATAVIEW "View"
      ,DATAVALUE "Value"
      ,ACCOUNT "Account"
      ,ENTITY "Entity"
      ,ICP "ICP"
        ,UD2 "Area"
        ,UD1 "Tail"
        ,UD3 "Special"
        ,UD4 "Facility"
      ,AMOUNT "DataValue"
      FROM AIF_HS_BALANCES
      WHERE LOADID = 300
    You need to map AMOUNT to "AMOUNT" in the HFM Application.  Check that the dimension mapping is correct for the class in the target application and that your import format is going to the proper target dimension(Amount).    

  • Decimal Place settings for  'Total' field in Marketing documents.

    Dear sir,
    I'm Using SAP B1 2005B Patch Level 5
    I want to know which Decimal places setting i have to set for'Total'
    Field in all Marketing documents.I want to know whether it come's under
    Prices settings or Amounts setting.

    Jambulingam,
    The no. of decimals is set  in the Administration  -System Initialisation -  General settings - Display tab . There on the left hand side you can see the settings for decimals.
    Since it is a total you wil have to set it for Amounts.
    Nagesh

  • Higher decimal places in SD pricing

    Hi All.
    I would like the system to accept up to 3 decimal places when creating quotation, sales order and invoice in SD. I created a new currency under t-code OY03 and customized it under t-code OY04. It works fine for newly entered values. The problem is that for values which already existed in the system i am getting rounding-off errors. All the figures in the old invoices and accounting reports have been changed e.g. $13.20 becomes $1.320 across the the whole system.
    How do create an alternative formula and assign it to my pricing condition type ZR00 in the pricing procedure so as to remove the rounding-off error?
    Regards,
    Joseph

    Hi Joseph,
    This is not good practice to change the decimals places for the currency to which documents are already posted. you also would have got warning message when you changed the decimal places.. It would affect all the posted documents in the system.. It would be a hectic job to bring back to normal.
    I had similar experience but in my case, there was NO Payment taken place.So, deleted all the MIRO and reversed MIGO and manually changed the PO value and posted it with correct value.
    you had better to create new currency with required decimal places ( for eg: USD - 2 decimals and make USDN - 3 decimals as such) and use it whenever required.
    With Regards
    S.Siva

  • Error in Updating Business Place in MM documents

    Dear Experts,
    I have 2 Questions..
    Q1. I have created a subsitution rule for updating business place and section code in documents and it's working fine for FI documents but business place and section is not updating in MM documents (MIRO) . Please suggest
    Q 2. When I am trying to update business place in MM invoices with t. code J1INPP it's giving me below message.
    Please suggest how to resolve this and is there any negative impact of updating business place in MM documents ?
    Thanks in advance
    No Financial Accounting document found
    Message no. F5863
    Diagnosis
    No financial accounting document was found under application type '', application key '' and '' and logical system ''.
    System Response
    Note from financial accounting
    Procedure
    Inform your SAP consultant or get in touch with SAP directly

    Hi Ansh,
    You are facing this issue because of Business place already exist in BSEG table. It is update through substitution rule.
    Just create new program by copy the program "J_1IEWT_UPDATE_FI_FOR_BUPLA"
    Mention here your own logic that System check Business place and delete BP from documents and after that update new business place.
    Regards
    Raheem

  • Decimal Places in Item Cost must be 6 characters while in Journal Entry 2.

    I have the following problem:
    Accounting needs to see and work with 2 decimal places, but the item cost is needed in 6 decimals.
    If I register a A/P Invoice and i go to the Journal Remark, the Journal Entry should be in 2 decimals. If i look for the Item Cost on the Wharehouse this cost should be in 6 decimals.
    Is there a way to handle Accounting in 2 units and Cost in 6 Units
    Thank You very much

    Hi Saul,
    The request appears illogical, how can the accountant work with 2 decimal places & the item valuation is held with 6? The stock account with 2 decimals will never match the stock audit report with 6 decimals.
    I'm afraid the SAP Business One core functionality does not cater for this need. There are no 'behind the scenes' journal entries. A JE is legally binding so you need to decide whether you wish to work with the most accurate calculations regarding item cost as possible (6 decimals) or accommodate the accountants & work with 2 decimals in the journals.
    You might want to take the nature of the stock into consideration, if there are huge quantities at small individual prices 6 decimals might be better, if you use mainly standard cost &/or have no major cost fluctuations when using MAP/FIFO, 2 decimals might be sufficient.
    All the best,
    Kerstin

  • PO print preview displays incorrect setting in decimal places

    Dear Experts
    Please help me on the following condition.
    I have a problem in print preview of a PO. It displays the incorrect setting for decimal place in currency.
    It shows USD 1.404,00 whereby the amount should be USD 1,404.00
    This only happens to a certain vendor that is doing PO for the first time from that country
    Example:
    I'm creating a PO for vendor 123. Vendor 123 is located in country A. No PO has been created for any
    vendor in country A before. When I saved my PO, in print preview, the decimal setting is not correct.
    But when I'm creating another PO, for vendor 234. Vendor 234 is located in country B. There have been
    several POs created for vendors in country B before. When I saved my PO, in print preview, the decimal
    setting is correct.
    Both vendor 123 and vendor 234 is using currency of USD.
    Is there any other setting with the vendor master in regard with the currency decimal setting for each
    country for the vendor? Or something that I've missed out?
    Diagnosis:
    I've checked with the user profiles->default-> decimal notation. It displays 1,234,567.89 correctly
    I've also run OY04, but the decimal setting is correct.
    Thank you
    Regards
    Syukri

    this has nothing to do with print preview, it is just basic country setting (OY01) how a quantity and value is written on a PO to a vendor is country xyz.
    German uses to comma to seperate decimals, while USA uses the point to seperate decimals
    this would be the German version 1.404,00, and this the US version:: 1,404.00
    so if an American sends a PO to a German vendor, then the document will show 1.404,00 so that the German can understand that he wants 1404. (and not 1000 times less)

  • Link between Accounting Document and Sales Order

    Dear SD Gurus,
    How to find the Sales Order number and Sales Order Item from the accounting document- like document types DZ, DG, ID etc.
    Kindly specify the table links and fields to fetch the above details
    Regards
    Vimal

    Link Between SAP SD, MM & FI
    The link between SD and MM :-
    1. When you create sales order in SD, all the details of the items are copied from Material master of MM.
    2. MRP and availibility check related data is also taken from MM although you control this data in SD also.
    3. While you create inbound/outbound delivery with reference to a sales order,the shipping point determination takes place with the help of the loading group, plant data, shipping conditions etc. This also refers to Material Master.
    4. The material which you are entering in a sales order must be extended to the sales area of your sales order/customer otherwise you cannot transact with this material.
    There are many such links between SD and MM.
    Now the link between SD and FI :-
    1. Whenever you create a delivery with reference to a sales order, goods movement takes place in the bacgground. eg. In case of standard sales order, you create an outbound goods delivery to the customer.
    Here movement 601 takes place. This movement is configured in MM. Also, this movement hits some G/L account in FI. Every such movement of good s hits some G/L account.
    2. The accounts posting in FI is done with reference to the billing documents (invoice, debit note, credit note etc) created in SD. Thus this is a link between SD and FI
    3. Tax determination: In case of a tax determination also, there is a direct link between SD and MM
    SD Integration points with other modules
    SD module is highly integrated with the other modules in SAP.
    Sales Order –
    Integration Points                      Module
    •Availability Check             -       MM
    •Credit Check                   -       FI
    •Costing                        -       CO/ MM
    •Tax Determination              -       FI
    •Transfer of Requirements       -       PP/ MM
    Delivery & Goods Issue –
    Integration Points                      Module
    •Availability Check             -       MM
    •Credit Check                   -       FI
    •Reduces stock                  -       MM
    •Reduces Inventory $            -       FI/ CO
    •Requirement Eliminated         -       PP/ MM
    Billing -
    Integration Points                      Module
    •Debit A/R                      -       FI/ CO
    •Credit Revenue                 -       FI/ CO
    •Updates G/ L                   -       FI/ CO
      (Tax, discounts, surcharges, etc.)
    •Milestone Billing              -       PS
    Return Delivery & Credit Memo -
    Integration Points                      Module
    •Increases Inventory            -       MM
    •Updates G/ L                   -       FI
    •Credit Memo                    -       FI
    •Adjustment to A/R              -       FI
    •Reduces Revenue                -       FI
    SD Transaction Code Flow: 
    Inquiry / Document type IN
    Tcode for creation VA11,VA12,VA13. tables VBAK,VBAP
    Quotation / QT
    Tcode for creation VA21,VA22,VA23. tables VBAK,VBAP
    Purchase Order PO
    Tcode for creation ME21,ME22,ME23. tables EKKO,EKPO.
    Sales Order OR
    Tcode for creation VA01,VA02,VA03. tables VBAK,VBAP
    Delivery LF
    Tcode for creation VL01,VL02,VL03. tables LIKP,LIPS
    Billing F2
    Tcode for creation VF01,VF02,VF03. tables VBRK,VBRP
    <b>The SD & FI link is established through mapping of appropriate G/L accounts through T.Code: VKOA</b>
    Regards,
    Rajesh Banka
    Reward suitable points.
    How to give points: Mark your thread as a question while creating it. In the answers you get, you can assign the points by clicking on the stars to the left. You also get a point yourself for rewarding (one per thread).

  • Cannot Update Decimal Places in General Settings

    When I try to update the decimal points in the Administration > System Initialization > General Settings > Display path, SAP B1 gives me the following error:
    "Cannot update while another user is connected to the company."
    I am the only one on the system as "manager" with "Super User" and "Full Authorization"...
    The SAP B1 Guide titled "How to Make Initial Setting in Business One - US" says "you can change these settings at any time".
    QUESTION:  What might be stopping this change, and more importantly, how do I get around this error to be able to change the decimal points?
    Thanks all - Zal

    Hi Zal,
    I agree with you about the strange messaging used by SAP.
    But blocking the possibility to decrease the decimal places is extremely important.
    Suppose you have inserted a sales document with two items in this way:
    Item 1 ___Qty 1,234  ___Unit price 1,22  ___Line total  1,51
    Item 2 ___Qty  5,756 ___Unit price 3,15  ___Line total 18,13
    ____Document total 19,64
    Then, someone wants to change the number of decimal places of the quantity from 3 to 2.
    What happens would be:
    Item 1 ___Qty 1,23  ___Unit price 1,22  ___Line total  1,51
    Item 2 ___Qty  5,75 ___Unit price 3,15  ___Line total 18,13
    ____Document total 19,64
    If you try to do the calculations manually you will see that the results are not correct. In fact all the document would have to change in:
    Item 1 ___Qty 1,23  ___Unit price 1,22  ___Line total  1,50
    Item 2 ___Qty  5,75 ___Unit price 3,15  ___Line total 18,11
    ____Document total 19,61
    Also if the document total will show correct (in the case of rounding the second decimal position of item 2), the totals of any line is wrong. In fact there is no recalculation at all in SAP (and must not be done).
    Imagine such a modification over thousand of documents and all of the descendants (mainly if the have lead to printouts - as say confirmations - sent to customers or vendors).
    None of the economic figures will match.
    BR
    Antonio

  • Decimal places

    Decimal places are defined in the general settings.
    They are currently set to 2 decimal places.
    We have the required for 5 customers to be priced and invoiced at 3 decimal places.
    Is this possible?

    Hi Lisa,
    Please also notice the following information
    When you tick the option: Rounding By: Currency from the Administration-System Initialisation-Document Setting window.
    You could assign different rounding /decimal place per different currency
    ( Administration-Definition-Financial-Define Currencies)
    Hope this can be helpful.
    Best Regards
    Helen Sun

  • Tax code Blank on Inter-company Accounting Document

    The Tax code field in Intercompany Accounting Document is Blank though MWST has A0 ( Zero Tax) as tax code but PR00 & PI01 have no tax codes . The Accounting document of Commercial Invoice has tax code  A2 which has MWST & PR00 with tax code A2 ( Full tax) & PI01 as Blank, even at the time of condition record creation for PR00 & PI01 there is no place to enter tax code as these I believe come from customer master record - tax classification. the customer record for Sales Org Ireland has been maintained as Tax exempt.
    Sales Flow-
    Irish Customer orders to Sales Org Ireland
    Sales Org Ireland  - has Plant UK as delivery plant- delivers goods to customer
    Sales Org Ireland Invoices - Irish customer with correct tax code
    Sales Org UK creates Intercompany Invoice to Sales org Ireland with blank tax code in accounting doc
    IV Invoice creates RD04 with fullprocessed IDoc in Ireland which does correct Invoice verificiation posting in Ireland.
    the only problem is when UK creates IV invoice the a/c document generates has tax code as blank where it should with A0 ( tax exempt) code.
    Kindly help

    Use SAP Note 10560 & 112609

  • Migo & Miro Accounting Documents Report

    Hello Abapers,
    I have made the new ALV report as shown below :-
    Report zaccounting no standard page heading line-size 300 line-count 40.
    tables : mkpf, "Header: Material Document
             mseg, "Document Segment: Material
             bkpf, "Accounting Document Header
             ekbe. "PO History Table
    type-pools slis.
    *DATA DECLARATION
    data : pos type i,
           l_layout type slis_layout_alv.
    data  gt_fieldcat type slis_t_fieldcat_alv.
    data  gt_sort type slis_t_sortinfo_alv.
    data  ls_fieldcat type slis_fieldcat_alv.
    data  is_print type slis_print_alv.
    data  it_events type slis_alv_event occurs 5.
    data  gs_variant type disvariant.
    data  t_list_top_of_page type slis_t_listheader.
    data  title like sy-title.
    data : l_title(105) type c,
           l_list(105)  type c,         "Store the Top-of-page headings
           l_date(10)   type c,         "Store date in top-of-page
           l_time(8)    type c,         "Store time in top-of-page
           title1 like sy-title,
           title2 like sy-title,
           title3 like sy-title.
    *-- Data Declaration
    data : repid  like sy-repid.
    constants: x  type c value 'X'.
    data zawkey like bkpf-awkey.
    types : begin of x_mkpf,
    mblnr like mkpf-mblnr,
    mjahr like mkpf-mjahr,
    budat like mkpf-budat,
    ebeln like mseg-ebeln,
    ebelp like mseg-ebelp,
    bwart like mseg-bwart,
    matnr like mseg-matnr,
    gsber like mseg-gsber,
    werks like mseg-werks,
    bukrs like bkpf-bukrs,
    belnr like bkpf-belnr,
    gjahr like bkpf-gjahr,
    bukrs1 like bkpf-bukrs,
    belnr1 like bkpf-belnr,
    gjahr1 like bkpf-gjahr,
    belnr2 like bkpf-belnr,
    gjahr2 like bkpf-gjahr,
    end of x_mkpf.
    data : t_mkpf type standard table of x_mkpf with header line.
    S E L E C T I O N - S C R E E N *
    selection-screen begin of block b1 with frame title text-009.
    select-options:  s_budat for mkpf-budat obligatory.
    select-options:  s_bwart for mseg-bwart.
    select-options:  s_matnr for mseg-matnr.
    select-options:  s_gsber for mseg-gsber.
    select-options:  s_werks for mseg-werks.
    selection-screen end of block b1.
    start-of-selection.
    break abapdev1.
    select msegmblnr msegmjahr mkpf~budat
    msegebeln msegebelp msegbwart msegmatnr mseggsber msegwerks
    into table t_mkpf
    from mkpf inner join mseg
    on mkpfmblnr = msegmblnr
    where budat in s_budat
    and bwart in s_bwart
    and matnr in s_matnr
    and gsber in s_gsber
    and werks in s_werks.
    loop at t_mkpf.
    select single belnr gjahr into (t_mkpf-belnr, t_mkpf-gjahr) from ekbe where ebeln = t_mkpf-ebeln
                                  and ebelp = t_mkpf-ebelp
                                  and lfbnr = t_mkpf-mblnr
                                  and lfgja = t_mkpf-mjahr
                                  and bewtp = 'Q'.
    modify t_mkpf transporting belnr gjahr.
    endloop.
    loop at t_mkpf.
    clear : zawkey.
    concatenate t_mkpf-mblnr t_mkpf-mjahr into zawkey.
    select single belnr gjahr into (t_mkpf-belnr1,t_mkpf-gjahr1) from bkpf
                       where awtyp = 'MKPF'
                       and awkey = zawkey.
    break abapdev1.
    clear : zawkey.
    concatenate t_mkpf-belnr t_mkpf-gjahr into zawkey.
    select single belnr gjahr into (t_mkpf-belnr2,t_mkpf-gjahr2) from bkpf
                       where awtyp = 'RMRP'
                       and awkey = zawkey.
    modify t_mkpf transporting belnr1 gjahr1 belnr2 gjahr2.
    endloop.
    ls_fieldcat-col_pos       =  '1'.
      ls_fieldcat-fieldname     = 'BUDAT'.
      ls_fieldcat-tabname       = 'T_MSEG'.
      ls_fieldcat-ref_fieldname = 'BUDAT'.
      ls_fieldcat-ref_tabname   = 'MKPF'.
      ls_fieldcat-seltext_l     = 'PSG DATE'.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-col_pos       =  '2'.
      ls_fieldcat-fieldname     = 'MBLNR'.
      ls_fieldcat-tabname       = 'X_MSEG'.
      ls_fieldcat-ref_fieldname = 'MBLNR'.
      ls_fieldcat-ref_tabname   = 'MSEG'.
      ls_fieldcat-seltext_l     = 'MIGO MAT DOCNO.'.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
    ls_fieldcat-col_pos       =  '3'.
      ls_fieldcat-fieldname     = 'BELNR1'.
      ls_fieldcat-tabname       = 'T_MSEG'.
      ls_fieldcat-ref_fieldname = 'BELNR1'.
      ls_fieldcat-ref_tabname   = 'MSEG'.
      ls_fieldcat-seltext_l     = 'FI DocNo.'.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
    ls_fieldcat-col_pos       =  '4'.
      ls_fieldcat-fieldname     = 'GJAHR1'.
      ls_fieldcat-tabname       = 'T_MSEG'.
      ls_fieldcat-ref_fieldname = 'GJAHR1'.
      ls_fieldcat-ref_tabname   = 'MSEG'.
      ls_fieldcat-seltext_l     = 'FI FiscalYr'.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
    ls_fieldcat-col_pos       =  '2'.
    ls_fieldcat-fieldname     = 'MJAHR'.
    ls_fieldcat-tabname       = 'X_MKPF'.
    ls_fieldcat-ref_fieldname = 'MJAHR'.
    ls_fieldcat-ref_tabname   = 'MSEG'.
    ls_fieldcat-seltext_l     = 'MIGO MATERIAL DOC. YEAR'.
    append ls_fieldcat to gt_fieldcat.
    clear ls_fieldcat.
    ls_fieldcat-col_pos       =  '5'.
      ls_fieldcat-fieldname     = 'EBELN'.
      ls_fieldcat-tabname       = 'T_MSEG'.
      ls_fieldcat-ref_fieldname = 'EBELN'.
      ls_fieldcat-ref_tabname   = 'MSEG'.
      ls_fieldcat-seltext_l     = 'PO No.'.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
    ls_fieldcat-col_pos       =  '6'.
      ls_fieldcat-fieldname     = 'EBELP'.
      ls_fieldcat-tabname       = 'T_MSEG'.
      ls_fieldcat-ref_fieldname = 'EBELP'.
      ls_fieldcat-ref_tabname   = 'MSEG'.
      ls_fieldcat-seltext_l     = 'PO ItemNo.'.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
    ls_fieldcat-col_pos       =  '7'.
      ls_fieldcat-fieldname     = 'BWART'.
      ls_fieldcat-tabname       = 'T_MSEG'.
      ls_fieldcat-ref_fieldname = 'BWART'.
      ls_fieldcat-ref_tabname   = 'MSEG'.
      ls_fieldcat-seltext_l     = 'Mvt.Type'.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
    ls_fieldcat-col_pos       =  '8'.
      ls_fieldcat-fieldname     = 'BELNR'.
      ls_fieldcat-tabname       = 'T_MSEG'.
      ls_fieldcat-ref_fieldname = 'BELNR'.
      ls_fieldcat-ref_tabname   = 'MSEG'.
      ls_fieldcat-seltext_l     = 'MIRO DocNo.'.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
    ls_fieldcat-col_pos       =  '9'.
      ls_fieldcat-fieldname     = 'GJAHR'.
      ls_fieldcat-tabname       = 'T_MSEG'.
      ls_fieldcat-ref_fieldname = 'GJAHR'.
      ls_fieldcat-ref_tabname   = 'MSEG'.
      ls_fieldcat-seltext_l     = 'MIRO FiscalYr'.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
    ls_fieldcat-col_pos       =  '10'.
      ls_fieldcat-fieldname     = 'GSBER'.
      ls_fieldcat-tabname       = 'T_MSEG'.
      ls_fieldcat-ref_fieldname = 'GSBER'.
      ls_fieldcat-ref_tabname   = 'MSEG'.
      ls_fieldcat-seltext_l     = 'BUS.AREA'.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
    ls_fieldcat-col_pos       =  '11'.
      ls_fieldcat-fieldname     = 'WERKS'.
      ls_fieldcat-tabname       = 'T_MSEG'.
      ls_fieldcat-ref_fieldname = 'WERKS'.
      ls_fieldcat-ref_tabname   = 'MSEG'.
      ls_fieldcat-seltext_l     = 'PLANT'.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
    ls_fieldcat-col_pos       =  '12'.
      ls_fieldcat-fieldname     = 'MATNR'.
      ls_fieldcat-tabname       = 'T_MSEG'.
      ls_fieldcat-ref_fieldname = 'MATNR'.
      ls_fieldcat-ref_tabname   = 'MSEG'.
      ls_fieldcat-seltext_l     = 'MAT.NO'.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
    ls_fieldcat-col_pos       =  '13'.
      ls_fieldcat-fieldname     = 'BELNR2'.
      ls_fieldcat-tabname       = 'T_MSEG'.
      ls_fieldcat-ref_fieldname = 'BELNR2'.
      ls_fieldcat-ref_tabname   = 'MSEG'.
      ls_fieldcat-seltext_l     = 'MIRO FI Doc.No'.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
    ls_fieldcat-col_pos       =  '14'.
      ls_fieldcat-fieldname     = 'GJAHR2'.
      ls_fieldcat-tabname       = 'T_MSEG'.
      ls_fieldcat-ref_fieldname = 'GJAHR2'.
      ls_fieldcat-ref_tabname   = 'MSEG'.
      ls_fieldcat-seltext_l     = 'MIRO FI FiscalYr'.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
    *&      Form  ALV_GRID_DISPLAY
    form alv_grid_display .
    call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
          i_callback_program                =  sy-repid   " 'ZRD_DD'
          it_fieldcat                       =  gt_fieldcat  "catalogue field
          i_callback_top_of_page            =  'TOP_PAGE'
          is_layout                         =  l_layout
         it_sort                           =  gt_sort
          i_default                         = 'X'
         i_save                            = 'A'
         is_variant                        = gs_variant
         it_events                         = it_events
         is_print                          = is_print
        tables
          t_outtab                          = t_mkpf
        exceptions
         program_error                      = 1
         others                             = 2
      if sy-subrc <> 0.
        message id sy-msgid type 'I' number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    " ALV_GRID_DISPLAY
    **&      Form  ALV_LAYOUT
    *FORM alv_layout USING   ps_layout TYPE slis_layout_alv.
    ps_layout-get_selinfos      = x.
    ps_layout-colwidth_optimize = x.
    ps_layout-detail_popup      = x.
    ps_layout-no_keyfix         = x.
    ps_layout-coltab_fieldname    = 'CLR'.
    ps_layout-key_hotspot       = x.
    ps_layout-group_change_edit = x.
    ps_layout-zebra  = 'X'.
    *ENDFORM.                    " ALV_LAYOUT
    **&      Form  ALV_PRINT
    *FORM alv_print .
    is_print-no_print_selinfos = x. " display no selection infos
    is_print-no_coverpage = x.
    is_print-no_new_page  = x.
    is_print-no_print_listinfos = x. " display no listinfos
    *ENDFORM.                    " ALV_PRINT
    **&      Form  TOP_OF_PAGE
    form top_page.
      data: ls_line type slis_listheader,
            i_top_of_page type slis_t_listheader.
      title = sy-title.
      ls_line-typ  = 'H'.
      ls_line-info = title.
      append ls_line to i_top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        exporting
          it_list_commentary = i_top_of_page.
    endform.                    "TOP_OF_PAGE
    In this report , i have faced some problems :-
    1. In MIGO numbers some cases MIRO doc. numbers are not shown against some migo doc. numbers whereas actually MIRO is already done.
    2. The Problem in downloading the report, its not accurate download & the MIGO Document Number not shown when we download the report.
    Thanks,
    Sumit.

    Hi Sumit,
    Im not sure if it will completely support ur needs but check it out
    This is for MIRO.Note here business area is hardcoded.
    REPORT  zmm_miro_track.
    TABLES : rseg, bkpf, bseg, lfa1, ekbe, skat, bsis .
    AlV related data declarations
    Type Pools
    TYPE-POOLS: slis.
    CONSTANTS:
    gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
          Data Declaration file                                         *
    DATA  : BEGIN OF it_rseg OCCURS 0,
             belnr TYPE rseg-belnr,
             gjahr TYPE rseg-gjahr,
             ebeln TYPE rseg-ebeln,
             ebelp TYPE rseg-ebelp,
             bukrs TYPE rseg-bukrs,
             awkey TYPE bkpf-awkey,
             END OF it_rseg.
    DATA :  BEGIN OF it_bkpf OCCURS 0,
             belnr TYPE bkpf-belnr,
             gjahr TYPE bkpf-gjahr,
             xblnr TYPE bkpf-xblnr,
             budat TYPE bkpf-budat,
             awkey TYPE bkpf-awkey,
             bukrs TYPE bkpf-bukrs,
             belnr1 TYPE bkpf-belnr,
             blart TYPE bkpf-blart,
            END OF it_bkpf.
    DATA :  BEGIN OF it_bseg OCCURS 0,
             belnr TYPE bseg-belnr,
             gjahr TYPE bseg-gjahr,
             bupla TYPE bseg-bupla,
             lifnr TYPE bseg-lifnr,
             hkont TYPE bseg-hkont,
             koart TYPE bseg-koart,
             mwskz TYPE bseg-mwskz,
             pswbt TYPE bseg-pswbt,
             ebeln TYPE bseg-ebeln,
             ebelp TYPE bseg-ebelp,
             xref3 TYPE bseg-xref3,
             bschl TYPE bseg-bschl,
             shkzg TYPE bseg-shkzg,
             miro_accnt TYPE bseg-hkont,
             xblnr TYPE bkpf-xblnr,
             budat TYPE bkpf-budat,
             belnr1 TYPE bseg-belnr,
             acdes(50),
             belnr2 TYPE bseg-belnr,
             belnr3 TYPE bseg-belnr,
             gjahr1 TYPE bseg-gjahr,
             hkont1 TYPE bseg-hkont,
             pswbt1 TYPE bseg-pswbt,
             budat1 TYPE ekbe-budat,
             acdes1(50),
            END OF it_bseg.
    DATA :  it_bseg1 LIKE it_bseg OCCURS 0 WITH HEADER LINE.
    DATA :  BEGIN OF it_bsis OCCURS 0,
             belnr TYPE bsis-belnr,
             gjahr TYPE bsis-gjahr,
             bschl TYPE bsis-bschl,
             xref3 TYPE bsis-xref3,
            END OF it_bsis.
    DATA :  BEGIN OF it_lfa1 OCCURS 0,
             lifnr TYPE lfa1-lifnr,
             name1 TYPE lfa1-name1,
             spras TYPE lfa1-spras,
            END OF it_lfa1.
    DATA :  BEGIN OF it_skat OCCURS 0,
             saknr TYPE skat-saknr,
             txt20 TYPE skat-txt20,
             txt50 TYPE skat-txt50,
             spras TYPE skat-spras,
             ktopl TYPE skat-ktopl,
            END OF it_skat.
    DATA :  BEGIN OF it_ekbe OCCURS 0,
             ebeln TYPE ekbe-ebeln,
             ebelp TYPE ekbe-ebelp,
             budat TYPE ekbe-budat,
             bewtp TYPE ekbe-bewtp,
            END OF it_ekbe.
    DATA : fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
           gd_repid LIKE sy-repid.
    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv,
          gs_layout   TYPE slis_layout_alv ,
          gs_print    TYPE slis_print_alv,
          gt_sort     TYPE slis_t_sortinfo_alv ,
          gt_filter   TYPE slis_t_filter_alv,
          gt_sp_group TYPE slis_t_sp_group_alv,
          gt_alv_graphics TYPE dtc_t_tc,
          gt_excluding  TYPE slis_t_extab ,
          gt_events   TYPE slis_t_event .
    DATA: g_repid LIKE sy-repid.
    DATA: gt_list_top_of_page TYPE slis_t_listheader.
    DATA:       g_boxnam TYPE slis_fieldname VALUE  'BOX',
                p_f2code LIKE sy-ucomm       VALUE  '&ETA',
                p_lignam TYPE slis_fieldname VALUE  'LIGHTS',
                g_save(1) TYPE c,
                g_default(1) TYPE c,
                g_exit(1) TYPE c,
                gx_variant LIKE disvariant,
                g_variant LIKE disvariant.
          USER ENTRY PARAMETERS                                         *
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_belnr FOR rseg-belnr OBLIGATORY,
                     s_gjahr FOR rseg-gjahr OBLIGATORY,
                     s_budat FOR bkpf-budat.
    SELECTION-SCREEN END OF BLOCK blk1.
          START-OF-SELECTION                                            *
    START-OF-SELECTION.
      PERFORM data_retrive.
      PERFORM data_call_alv.
      PERFORM build_layout.
    END-OF-SELECTION.
    *&      Form  DATA_CALL_ALV
          text
    -->  p1        text
    <--  p2        text
    FORM data_call_alv .
      g_repid = sy-repid.
      PERFORM e01_fieldcat_init USING gt_fieldcat[].
      PERFORM eventtab_build CHANGING gt_events.
      PERFORM e04_comment_build USING gt_list_top_of_page[].
      PERFORM display_report.
    ENDFORM.                    " DATA_CALL_ALV
    *&      Form  E01_FIELDCAT_INIT
          text
         -->P_GT_FIELDCAT[]  text
    FORM e01_fieldcat_init  USING    e01_lt_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
      DATA: gs_sort TYPE slis_sortinfo_alv.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'BELNR'.
      ls_fieldcat-key = 'X'. "SUBTOTAL KEY
      ls_fieldcat-col_pos      = '1'.
      ls_fieldcat-seltext_l    = 'Accounting Doc'.
      ls_fieldcat-outputlen    = 15.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'BELNR1'.
      ls_fieldcat-col_pos      = '2'.
      ls_fieldcat-seltext_l    = 'IR Doc'.
      ls_fieldcat-outputlen    = 10.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'XBLNR'.
      ls_fieldcat-col_pos      = '3'.
      ls_fieldcat-seltext_l    = 'IR Reference'.
      ls_fieldcat-outputlen    = 15.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'BUDAT'.
      ls_fieldcat-col_pos      = '4'.
      ls_fieldcat-seltext_l    = 'IR Posting Date'.
      ls_fieldcat-outputlen    = 10.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'BUPLA'.
      ls_fieldcat-col_pos      = '5'.
      ls_fieldcat-seltext_l    = 'Business Place'.
      ls_fieldcat-outputlen    = 10.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'HKONT'.
      ls_fieldcat-col_pos      = '6'.
      ls_fieldcat-seltext_l    = 'G/L accounts Posted'.
      ls_fieldcat-outputlen    = 15.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'ACDES'.
      ls_fieldcat-col_pos      = '7'.
      ls_fieldcat-seltext_l    = 'G/L description'.
      ls_fieldcat-outputlen    = 20.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'MWSKZ'.
      ls_fieldcat-col_pos      = '8'.
      ls_fieldcat-seltext_l    = 'Tax Code'.
      ls_fieldcat-outputlen    = 8.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'PSWBT'.
      ls_fieldcat-col_pos      = '9'.
      ls_fieldcat-seltext_l    = 'G/L Amount'.
      ls_fieldcat-outputlen    = 20.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'EBELN'.
      ls_fieldcat-col_pos      = '10'.
      ls_fieldcat-seltext_l    = 'Purchase Order'.
      ls_fieldcat-outputlen    = 15.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'EBELP'.
      ls_fieldcat-col_pos      = '11'.
      ls_fieldcat-seltext_l    = 'P.O.Line Item'.
      ls_fieldcat-outputlen    = 10.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'BELNR2'.
      ls_fieldcat-col_pos      = '12'.
      ls_fieldcat-seltext_l    = 'GRN Doc '.
      ls_fieldcat-outputlen    = 10.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'BELNR3'.
      ls_fieldcat-col_pos      = '13'.
      ls_fieldcat-seltext_l    = 'GRN FI Doc No.'.
      ls_fieldcat-outputlen    = 15.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'BUDAT1'.
      ls_fieldcat-col_pos      = '14'.
      ls_fieldcat-seltext_l    = 'GR Posting Date '.
      ls_fieldcat-outputlen    = 10.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
    ENDFORM.                    "e01_fieldcat_init
    *&      Form  EVENTTAB_BUILD
          text
         <--P_GT_EVENTS  text
    FORM eventtab_build  CHANGING lt_events TYPE slis_t_event.
      CONSTANTS:
      gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = lt_events.
      READ TABLE lt_events WITH KEY name = slis_ev_top_of_page
      INTO ls_event.
      IF sy-subrc = 0.
        MOVE gc_formname_top_of_page TO ls_event-form.
        APPEND ls_event TO lt_events.
      ENDIF.
    ENDFORM.                    " EVENTTAB_BUILD
    *&      Form  E04_COMMENT_BUILD
          text
         -->P_GT_LIST_TOP_OF_PAGE[]  text
    FORM e04_comment_build  USING e04_lt_top_of_page TYPE slis_t_listheader.
      DATA : v_time(5) TYPE c.
      DATA:  ls_line TYPE slis_listheader.
      DATA:  ls_colr TYPE slis_specialcol_alv.
      DATA : v_text(90) TYPE c.
      CONCATENATE ' Report for MIRO track ':' ' INTO v_text SEPARATED BY space.
      CLEAR ls_line.
      ls_line-typ  = 'H'.
      ls_line-info = v_text.
      APPEND ls_line TO e04_lt_top_of_page.
    ENDFORM.                    " E04_COMMENT_BUILD
          FORM TOP_OF_PAGE                                              *
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = gt_list_top_of_page.
    ENDFORM.                    "TOP_OF_PAGE
    **&      Form  DATA_RETRIVE
          text
    FORM data_retrive.
    fetching Accounting Document Number and Fiscal year from Incoming Invoice table
      SELECT  belnr gjahr ebeln ebelp bukrs
         INTO CORRESPONDING FIELDS OF TABLE it_rseg
           FROM rseg
           WHERE belnr IN s_belnr
            AND  gjahr IN s_gjahr
            AND  bukrs = '1000'.
      LOOP AT it_rseg.
        CONCATENATE it_rseg-belnr it_rseg-gjahr INTO it_rseg-awkey.
        MODIFY it_rseg.
        CLEAR it_rseg.
      ENDLOOP.
      IF it_rseg[] IS NOT INITIAL.
        SELECT belnr gjahr xblnr budat awkey
          INTO CORRESPONDING FIELDS OF TABLE it_bkpf
            FROM bkpf
            FOR ALL ENTRIES IN it_rseg
            WHERE awkey = it_rseg-awkey
              AND budat IN s_budat
              AND bukrs = '1000'
              AND blart <> 'ML'.
      ENDIF.
      IF it_bkpf[] IS NOT INITIAL.
        SELECT belnr gjahr bupla lifnr hkont koart mwskz pswbt ebeln ebelp xref3 bschl shkzg
           INTO CORRESPONDING FIELDS OF TABLE it_bseg
           FROM bseg
           FOR ALL ENTRIES IN it_bkpf
           WHERE belnr = it_bkpf-belnr
             AND gjahr = it_bkpf-gjahr.
      ENDIF.
    fetching G/L account description
      IF it_bseg[] IS NOT INITIAL.
        SELECT lifnr name1
        INTO CORRESPONDING FIELDS OF TABLE it_lfa1
        FROM lfa1
        FOR ALL ENTRIES IN it_bseg
        WHERE lifnr = it_bseg-lifnr
          AND spras = 'EN'.
        SELECT saknr txt20 txt50
        INTO CORRESPONDING FIELDS OF TABLE it_skat
        FROM skat
        FOR ALL ENTRIES IN it_bseg
        WHERE saknr = it_bseg-hkont
          AND spras = 'EN'
          AND ktopl = 'HRJL'.
        SELECT ebeln ebelp budat
        INTO CORRESPONDING FIELDS OF TABLE it_ekbe
        FROM ekbe
        FOR ALL ENTRIES IN it_bseg
        WHERE ebeln = it_bseg-ebeln
          AND ebelp = it_bseg-ebelp
          AND bewtp = 'E'.
      ENDIF.
      LOOP AT it_bseg.
        IF it_bseg-koart = 'K'.
          it_bseg-miro_accnt = it_bseg-lifnr.
        ELSE.
          it_bseg-miro_accnt = it_bseg-hkont.
        ENDIF.
        IF it_bseg-shkzg = 'H'.
          it_bseg-pswbt = it_bseg-pswbt * -1.
        ENDIF.
        it_bseg-belnr2 = it_bseg-xref3+4(10).
        MODIFY it_bseg.
        READ TABLE it_ekbe WITH KEY ebeln = it_bseg-ebeln
                                    ebelp = it_bseg-ebelp.
        IF sy-subrc = 0.
          it_bseg-budat1 = it_ekbe-budat.
        ENDIF.
        READ TABLE it_bkpf WITH KEY belnr = it_bseg-belnr
                                    gjahr = it_bseg-gjahr.
        IF sy-subrc = 0.
          it_bseg-belnr = it_bkpf-belnr.
          it_bseg-gjahr = it_bkpf-gjahr.
          it_bseg-xblnr = it_bkpf-xblnr.
          it_bseg-budat = it_bkpf-budat.
          it_bseg-belnr1 = it_bkpf-awkey+0(10).
        ENDIF.
        IF it_bseg-koart = 'K'.
          READ TABLE it_lfa1 WITH KEY lifnr = it_bseg-miro_accnt.
          IF sy-subrc = 0.
            it_bseg-acdes = it_lfa1-name1.
          ENDIF.
        ELSE.
          READ TABLE it_skat WITH KEY saknr = it_bseg-miro_accnt.
          IF sy-subrc = 0.
            IF it_skat-txt20 IS NOT INITIAL.
              it_bseg-acdes = it_skat-txt20.
            ELSE.
              it_bseg-acdes = it_skat-txt50.
            ENDIF.
          ENDIF.
        ENDIF.
        MODIFY it_bseg.
        CLEAR it_bseg.
      ENDLOOP.
      it_bseg1[] = it_bseg[].
      LOOP AT it_bseg1.
        IF it_bseg1-xref3 = ''.
          DELETE it_bseg1.
          CLEAR it_bseg1.
        ENDIF.
      ENDLOOP.
      IF it_bseg1[] IS NOT INITIAL.
        SELECT belnr gjahr bschl xref3
        FROM bsis
        INTO CORRESPONDING FIELDS OF TABLE it_bsis
        FOR ALL ENTRIES IN it_bseg1
        WHERE xref3 = it_bseg1-xref3
          AND gjahr = it_bseg1-gjahr
          AND bschl = '96'.
      ENDIF.
      LOOP AT it_bseg.
        READ TABLE it_bsis WITH KEY xref3 = it_bseg-xref3.
        IF sy-subrc = 0.
          it_bseg-belnr3 = it_bsis-belnr.
          it_bseg-gjahr1 = it_bsis-gjahr.
        ENDIF.
        MODIFY it_bseg.
        CLEAR it_bseg.
      ENDLOOP.
    ENDFORM.                    "data_retrive
    *&      Form  DISPLAY_REPORT
          text
    -->  p1        text
    <--  p2        text
    FORM display_report .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_background_id         = ''
          i_callback_program      = g_repid
         i_callback_user_command = 'USER_COMMAND'
          is_layout               = gs_layout
          it_fieldcat             = gt_fieldcat[]
          it_special_groups       = gt_sp_group[]
          it_sort                 = gt_sort[]
          it_filter               = gt_filter[]
          i_save                  = g_save
          is_variant              = g_variant
          it_events               = gt_events[]
          is_print                = gs_print
          it_alv_graphics         = gt_alv_graphics[]
          it_excluding            = gt_excluding
        TABLES
          t_outtab                = it_bseg.
    ENDFORM.                    " DISPLAY_REPORT
    *&      Form  build_layout
          text
    -->  p1        text
    <--  p2        text
    FORM build_layout.
      gs_layout-no_input          = 'X'.
      gs_layout-colwidth_optimize = 'X'.
      gs_layout-totals_text       = 'Totals'(201).
      gs_layout-info_fieldname =      'LINE_COLOR'.
    ENDFORM.                    " BUILD_LAYOUT
    This is for MIGO.
    REPORT  zmm_migo_track.
    TABLES : bseg, ekbe, skat, bsis.
    AlV related data declarations
    Type Pools
    TYPE-POOLS: slis.
    CONSTANTS:
    gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
          Data Declaration file                                         *
    DATA :  BEGIN OF it_bseg OCCURS 0,
             belnr TYPE bseg-belnr,
             gjahr TYPE bseg-gjahr,
             bukrs TYPE bseg-bukrs,
             hkont TYPE bseg-hkont,
             pswbt TYPE bseg-pswbt,
             ebeln TYPE bseg-ebeln,
             ebelp TYPE bseg-ebelp,
             xref3 TYPE bseg-xref3,
             shkzg TYPE bseg-shkzg,
             budat TYPE ekbe-budat,
             acdes(50),
             belnr1 TYPE bseg-belnr,
            END OF it_bseg.
    DATA :  it_bseg1 LIKE it_bseg OCCURS 0 WITH HEADER LINE.
    DATA :  BEGIN OF it_bsis OCCURS 0,
             belnr TYPE bsis-belnr,
             gjahr TYPE bsis-gjahr,
             bschl TYPE bsis-bschl,
             xref3 TYPE bsis-xref3,
            END OF it_bsis.
    DATA :  BEGIN OF it_skat OCCURS 0,
             saknr TYPE skat-saknr,
             txt20 TYPE skat-txt20,
             txt50 TYPE skat-txt50,
             spras TYPE skat-spras,
             ktopl TYPE skat-ktopl,
            END OF it_skat.
    DATA :  BEGIN OF it_ekbe OCCURS 0,
             ebeln TYPE ekbe-ebeln,
             ebelp TYPE ekbe-ebelp,
             budat TYPE ekbe-budat,
             bewtp TYPE ekbe-bewtp,
            END OF it_ekbe.
    DATA :  fiscal_year_low(4),
            fiscal_year_high(4).
    DATA : fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
           gd_repid LIKE sy-repid.
    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv,
          gs_layout   TYPE slis_layout_alv ,
          gs_print    TYPE slis_print_alv,
          gt_sort     TYPE slis_t_sortinfo_alv ,
          gt_filter   TYPE slis_t_filter_alv,
          gt_sp_group TYPE slis_t_sp_group_alv,
          gt_alv_graphics TYPE dtc_t_tc,
          gt_excluding  TYPE slis_t_extab ,
          gt_events   TYPE slis_t_event .
    DATA: g_repid LIKE sy-repid.
    DATA: gt_list_top_of_page TYPE slis_t_listheader.
    DATA:       g_boxnam TYPE slis_fieldname VALUE  'BOX',
                p_f2code LIKE sy-ucomm       VALUE  '&ETA',
                p_lignam TYPE slis_fieldname VALUE  'LIGHTS',
                g_save(1) TYPE c,
                g_default(1) TYPE c,
                g_exit(1) TYPE c,
                gx_variant LIKE disvariant,
                g_variant LIKE disvariant.
          USER ENTRY PARAMETERS                                         *
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_belnr FOR bseg-belnr OBLIGATORY,
                     s_budat FOR ekbe-budat OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk1.
    AT SELECTION-SCREEN.
      IF s_budat-low IS NOT INITIAL.
        CALL FUNCTION 'GM_GET_FISCAL_YEAR'
          EXPORTING
            i_date                           = s_budat-low
            i_fyv                            = 'V3'
         IMPORTING
            e_fy                             = fiscal_year_low
    EXCEPTIONS
      FISCAL_YEAR_DOES_NOT_EXIST       = 1
      NOT_DEFINED_FOR_DATE             = 2
      OTHERS                           = 3
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
      IF s_budat-high IS NOT INITIAL.
        CALL FUNCTION 'GM_GET_FISCAL_YEAR'
          EXPORTING
            i_date                           = s_budat-high
            i_fyv                            = 'V3'
         IMPORTING
            e_fy                             = fiscal_year_high
    EXCEPTIONS
      FISCAL_YEAR_DOES_NOT_EXIST       = 1
      NOT_DEFINED_FOR_DATE             = 2
      OTHERS                           = 3
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
          START-OF-SELECTION                                            *
    START-OF-SELECTION.
      PERFORM data_retrive.
      PERFORM data_call_alv.
      PERFORM build_layout.
    END-OF-SELECTION.
    *&      Form  DATA_CALL_ALV
          text
    -->  p1        text
    <--  p2        text
    FORM data_call_alv .
      g_repid = sy-repid.
      PERFORM e01_fieldcat_init USING gt_fieldcat[].
      PERFORM eventtab_build CHANGING gt_events.
      PERFORM e04_comment_build USING gt_list_top_of_page[].
      PERFORM display_report.
    ENDFORM.                    " DATA_CALL_ALV
    *&      Form  E01_FIELDCAT_INIT
          text
         -->P_GT_FIELDCAT[]  text
    FORM e01_fieldcat_init  USING    e01_lt_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
      DATA: gs_sort TYPE slis_sortinfo_alv.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'BELNR1'.
      ls_fieldcat-col_pos      = '1'.
      ls_fieldcat-seltext_l    = 'GRN Doc '.
      ls_fieldcat-outputlen    = 10.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'BELNR'.
      ls_fieldcat-col_pos      = '2'.
      ls_fieldcat-seltext_l    = 'GRN FI Doc No.'.
      ls_fieldcat-outputlen    = 15.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'BUDAT'.
      ls_fieldcat-col_pos      = '3'.
      ls_fieldcat-seltext_l    = 'GR Posting Date '.
      ls_fieldcat-outputlen    = 10.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'HKONT'.
      ls_fieldcat-col_pos      = '4'.
      ls_fieldcat-seltext_l    = 'Account Assignment'.
      ls_fieldcat-outputlen    = 15.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'ACDES'.
      ls_fieldcat-col_pos      = '5'.
      ls_fieldcat-seltext_l    = 'Description'.
      ls_fieldcat-outputlen    = 20.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'PSWBT'.
      ls_fieldcat-col_pos      = '6'.
      ls_fieldcat-seltext_l    = 'G/L Amount'.
      ls_fieldcat-outputlen    = 15.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
    ENDFORM.                    "e01_fieldcat_init
    *&      Form  EVENTTAB_BUILD
          text
         <--P_GT_EVENTS  text
    FORM eventtab_build  CHANGING lt_events TYPE slis_t_event.
      CONSTANTS:
      gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = lt_events.
      READ TABLE lt_events WITH KEY name = slis_ev_top_of_page
      INTO ls_event.
      IF sy-subrc = 0.
        MOVE gc_formname_top_of_page TO ls_event-form.
        APPEND ls_event TO lt_events.
      ENDIF.
    ENDFORM.                    " EVENTTAB_BUILD
    *&      Form  E04_COMMENT_BUILD
          text
         -->P_GT_LIST_TOP_OF_PAGE[]  text
    FORM e04_comment_build  USING e04_lt_top_of_page TYPE slis_t_listheader.
      DATA : v_time(5) TYPE c.
      DATA:  ls_line TYPE slis_listheader.
      DATA:  ls_colr TYPE slis_specialcol_alv.
      DATA : v_text(90) TYPE c.
      CONCATENATE ' Report for MIGO track ':' ' INTO v_text SEPARATED BY space.
      CLEAR ls_line.
      ls_line-typ  = 'H'.
      ls_line-info = v_text.
      APPEND ls_line TO e04_lt_top_of_page.
    ENDFORM.                    " E04_COMMENT_BUILD
          FORM TOP_OF_PAGE                                              *
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = gt_list_top_of_page.
    ENDFORM.                    "TOP_OF_PAGE
    **&      Form  DATA_RETRIVE
          text
    FORM data_retrive.
    fetching migo G/L account
      IF fiscal_year_high IS NOT INITIAL.
        SELECT belnr gjahr hkont pswbt ebeln ebelp xref3 shkzg
           FROM bseg
           INTO CORRESPONDING FIELDS OF TABLE it_bseg
           WHERE belnr IN s_belnr
             AND gjahr BETWEEN fiscal_year_low AND fiscal_year_high
             AND bukrs = '1000'.
      ELSE.
        SELECT belnr gjahr hkont pswbt ebeln ebelp xref3 shkzg
           FROM bseg
           INTO CORRESPONDING FIELDS OF TABLE it_bseg
           WHERE belnr IN s_belnr
             AND gjahr = fiscal_year_low
             AND bukrs = '1000'.
      ENDIF.
    fetching G/L account description
      IF it_bseg[] IS NOT INITIAL.
        SELECT saknr txt20 txt50
        INTO CORRESPONDING FIELDS OF TABLE it_skat
        FROM skat
        FOR ALL ENTRIES IN it_bseg
        WHERE saknr = it_bseg-hkont
          AND spras = 'EN'
          AND ktopl = 'HRJL'.
        SELECT ebeln ebelp budat
        INTO CORRESPONDING FIELDS OF TABLE it_ekbe
        FROM ekbe
        FOR ALL ENTRIES IN it_bseg
        WHERE ebeln = it_bseg-ebeln
          AND ebelp = it_bseg-ebelp
          AND bewtp = 'E'.
      ENDIF.
      LOOP AT it_bseg.
        IF it_bseg-shkzg = 'H'.
          it_bseg-pswbt = it_bseg-pswbt * -1.
        ENDIF.
        MODIFY it_bseg.
        READ TABLE it_ekbe WITH KEY ebeln = it_bseg-ebeln
                                    ebelp = it_bseg-ebelp.
        IF sy-subrc = 0.
          it_bseg-budat = it_ekbe-budat.
        ENDIF.
        READ TABLE it_skat WITH KEY saknr = it_bseg-hkont.
        IF sy-subrc = 0.
          IF it_skat-txt20 IS NOT INITIAL.
            it_bseg-acdes = it_skat-txt20.
          ELSE.
            it_bseg-acdes = it_skat-txt50.
          ENDIF.
        ENDIF.
        MODIFY it_bseg.
        CLEAR it_bseg.
      ENDLOOP.
      it_bseg1[] = it_bseg[].
      LOOP AT it_bseg1.
        IF it_bseg1-xref3 = ''.
          DELETE it_bseg1.
          CLEAR it_bseg1.
        ENDIF.
      ENDLOOP.
      LOOP AT it_bseg.
        READ TABLE it_bseg1 WITH KEY belnr = it_bseg-belnr.
        IF sy-subrc = 0.
          it_bseg-belnr1 = it_bseg1-xref3+4(10).
          it_bseg-xref3 = it_bseg1-xref3.
        ENDIF.
        MODIFY it_bseg.
        CLEAR it_bseg.
      ENDLOOP.
    ENDFORM.                    "data_retrive
    *&      Form  DISPLAY_REPORT
          text
    -->  p1        text
    <--  p2        text
    FORM display_report .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_background_id         = ''
          i_callback_program      = g_repid
         i_callback_user_command = 'USER_COMMAND'
          is_layout               = gs_layout
          it_fieldcat             = gt_fieldcat[]
          it_special_groups       = gt_sp_group[]
          it_sort                 = gt_sort[]
          it_filter               = gt_filter[]
          i_save                  = g_save
          is_variant              = g_variant
          it_events               = gt_events[]
          is_print                = gs_print
          it_alv_graphics         = gt_alv_graphics[]
          it_excluding            = gt_excluding
        TABLES
          t_outtab                = it_bseg.
    ENDFORM.                    " DISPLAY_REPORT
    *&      Form  build_layout
          text
    -->  p1        text
    <--  p2        text
    FORM build_layout.
      gs_layout-no_input          = 'X'.
      gs_layout-colwidth_optimize = 'X'.
      gs_layout-totals_text       = 'Totals'(201).
      gs_layout-info_fieldname =      'LINE_COLOR'.
    ENDFORM.                    " BUILD_LAYOUT

Maybe you are looking for

  • Same apple id on home iphone and business iphone

    My work is making me get a second phone. I will be getting an iphone, but want to somehow consolidate the mess. I will have two phone numbers, but one apple id (same person, so same contacts, etc). By using the same apple id am i able to consolidate

  • ITunes Stops Working when I Sync- Help!

    I've posted this on the iPhone forum also, but I thought someone here might could help. iTunes the last couple of days stops working when I try to sync my iPhone. It give me a message to update to the lastest version of iTunes,,, I have the lastest v

  • Frame issue in Workspace with IE8/XP/Reader 9.4

    When a user opens a form from a "to do" in Workspace, the form opens in a frame outside of and superimposed over the normal Workspace interface.  This obscures the user action buttons, which stops the process at that user (since they can perform no a

  • How effective is Bootcamp for games? MW3?Any help much appreciated

    Hi all, I am going to purchase an iMac over Christmas but there's just one final niggle I need to get out of my brain.. Just how effective is Bootcamp for running windows games on an iMac? Will it work cohesively with the latest games such as MW3? Ar

  • Error – SAML Single Logout request does not correspond to the logged-in session participant

    We are relatively new to ADFS, having set up working rp-trusts with three partners in the last few months.  Our 4th partner is proving problematic.  Single sign in works, but the ADFS responds the single logout request from the RP with a status of Re