Finding MIRO Accounting Document No.

Hi ,
I want to get Accounting document for a MIRO document. while debugging MIRO to find accounting document it is showing in BKPF table the field AWKEY with MIRO number + its Financial Year.
But is there any table that gives directly the Accounting document for a MIRO number
-Rajiv

Hi,
try FM:   FI_READ_DOCUMENT_WITH_REF.
Regards, Dieter

Similar Messages

  • From miro accounting document to PO

    Hi All,
    I need to extract PO header EKKO data from bsik and bsak miro accounting document. May I know what table to use to do the linkage?
    thanks
    rgds

    hi
    If you maintain the PO no in the accounting doc. then you can retrieve PO data from Acc. Doc
    In BSAK & BSIK --> take AUGBL field
    Goto  BSEG
        Put BSAK-AUGBL field in to -
    > BSEG-BELNR
    Get the results and you can view PO no in BSEG-EBELN
    Goto EKKO table
        Put BSEG-EBELN into EKKO-EBELN field
    And then you can get the PO header details.
    Thanks & BR
    sandun

  • How to find the accounting document

    Dear all,
    Can somebody tell me how to find the accounting document from the MIGO transaction. I entered a goods delivery into the system. An accounting document should already be created.
    Best Regards
    Jerome

    Hi Jerome
    Go to that that material document (which was created through migo transcation)and click on Doc info header. There you can find FI documents. It will give the accounting documents (if any that has been created).
    Hope this helps.
    regards
    Anand.c

  • MIRO accounting document GR/IR not updated

    Hi,
    User posted Invoice verification ( MIRO) and in accounting document i have seen that
    1)vendor account - Credited
    2) But there is no GR/IR account updated instead of that purchase order G/L Account updated as Debit
    Ideally GR/IR account should create and debited (Correct me if i am wrong)
    and user again posted the credit memo against this invoice document and the accounting document created as below
    1)Vendor account debited
    2)GR/IR account Credited ( Partial amount)
    3) Purchase order G/L Account created ( With remaining partial amount)
    Ideally it should post whole amount to only one account
    Don't know how this happened, is this because of some setting or something else
    Please suggest
    Thanks,
    Jairaj

    Hi Parvin/Antony,
    Thanks for the suggestion!
    Below are the details of GR and IR data with posting key, still not getting how it is happened and also not able to create scenario
    50030: PO G/L Account
    82241: GR/IR Account
    111264: vendor account
    GR
    Itm PK Account    Account short text   Tx Cost Ctr   Order                  Amount
                                                                                    1 81 50030      PO GL account    CS0408                         5.000,00
      2 96 82241      Gds Rec/Invoice Rec                                    5.000,00-
    GR Accounting documents are OK
    First Invoice:
    Itm PK Account    Account short text   Tx Cost Ctr   Order                  Amount Text                                                                               
    1 31 111264     VENDOR ACCOUNT       VT                                5.750,00-
      2 81 50030      PO GL account VT CS0408                         5.000,00
      3 40 79144      Input VAT St R (15%) VT                                  750,00
    Why GR/IR account not hit here
    Credit memo:
    Itm PK Account    Account short text   Tx Cost Ctr   Order                  Amount Text                                                                               
    1 21 111264     VENDOR ACCOUNT       VT                                5.750,00   MR8M 
      2 96 82241      Gds Rec/Invoice Rec  VT CS0408                         4.700,00- 
      3 91 50030      PO GL account VT CS0408                           300,00-
      4 50 79144      Input VAT St R (15%) VT                                  750,00-  
    Both GR/IR and PO GL accounts updated, price is distrubuted with 4700 and 300 not sure how
    One more Invoice:
    Itm PK Account    Account short text   Tx Cost Ctr   Order                  Amount Text                                                                               
    1 31 111264     VENDOR ACCOUNT       VT                                5.750,00-    
      2 86 82241      Gds Rec/Invoice Rec  VT CS0408                         5.000,00 
      3 40 79144      Input VAT St R (15%) VT                                  750,00  
    This is OK
    Please suggest how to tangle this issue
    Thx,
    Jairaj

  • 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

  • MIRO (accounting document not showing)

    Dear Guru's
    When ever we save the miro transaction one miro document will generate and inside accounting document, profit center and controling document will generate.   my problem is when we save the miro document bottom of that screen miro document will show.  In my client place when we save miro document that time miro document no. and accounting document also showing within brackets like this - Invoice doucment 5170123 saved (accounting document 441234). but my issue is only a few login id's it is showing like this.
    one login id it is not showing which is said above that login id it is showing only miro document (5170124).
    pls suggest me how to over come this problem.
    Thanks & Regards
    chandra sekhar reddy

    The parameter ID IVFIDISPLAY need to be added in the User Master Parameters tab using SU01 for other user or for slef user use SU3.
    after maintaining the parameter, maintain the Parameter value as X
    Run this parameter...its not provided in the scrap system...we need to run it...try to do this...
    Even if it doen't works then check with the basis consultant...
    Hope it helps..
    Regards
    Priyanka.P

  • Report which give PO no from the MIRO accounting document.

    Dear Expertise,
    Can any body so kind to help me to find out the following report.
    Is there any standard report in SAP:
    Input parameter : Accounting doucument of MIRO or invoice no
    Output Purchse order No against which the MIRO is entered.
    Thanks in advance.
    Regards,
    sp sahu

    Hello Sahu,
    Addition to Manish's response, you can use MRI5 or table BSEG to write a small query.
    Regards
    Arif Mansuri

  • Link to find Accounting document number from Material document number / PO

    Hi
    We are working on a custom report, in which we need to print purchasing details (from EKPO, EKKO & EKBE) as well as accounting details (from BSEG & BKPF). We need to hit BKPF/BSEG with the accounting document number, since it is the only key field (though PO number is there in BKPF, we can not use this because it is not a key field)
    My question from which table we get the accounting document number ? We need to provide a link between purchasing & accounting through accounting document number, but how to find the accounting document number. ?
    Thanks
    Venkat.

    Venkat,
      I guess you are trying to fetch Accouting Documents for goods receipt against PO.
      To do this, you need to look at the PO History table (EKBE) and find out the Corresponding material document (VGABE = 1 for good receipt).
      Get the value of BELNR and GJAHR.
      Concatenate BELNR and GJAHR into your refernce key (like BKPF-AWKEY).
      Then use this key to read table BKPF with the following key
       AWTYP = 'MKPF' for Material document
       AWKEY = reference key generated above.
       AWSYS = the value of the logical system (if used) or blanks
    This will get you quicker access as compared to what you've described below. In this case, the system uses a standard SAP Index "Index by application type and key" to fetch the relevant records.
    Hope this helps.

  • Accounting document during MIGO or MIRO

    hi
    all an accounting document is generated ,when it is generated during MIRO or MIGO ?
    can we able to view these in MB51 ?
    Regards
    Leo Thilak.MS

    Hi,
    While posting stock posting movement in MIGO - accounting document has generated .
    You can view the material document in t.code MB51 - Material document for a material
    MR51- Accounting document for a material
    MBAL -Archieved material document
    MBSM-Cancelled Material document
    MB03- Material document list
    MIRO- accounting document posting
    All the stock update in your plant accounting document has generated except 101K, 541, etc
    FB03 - There choose List option, you can view the accounting document for the MIRO posting by select document type RE-Invoice
    Fiscal year, Material etc
    Thanks,
    Thiru
    Edited by: thiru on Jan 18, 2011 11:33 AM

  • Find accounting document for deleted incoming invoice document

    Hi all,
    I have few ncoming invoice documents which were deleted. those documents i can see in RBKP table.
    I want to trace the accounting documents for those deleted documents.
    Can any one help me to find the accounting documents for deleted documents.
    thanks in advance.

    Hi,
    this might give you an idea:
    data: l_belnr like bkpf-belnr, l_gjahr like bkpf-gjahr.
    clear: l_belnr, l_gjahr.
    data: l_string(20) type c.
    clear l_string.
    data: l_belnr_2 like bkpf-belnr, l_gjahr_2 like bkpf-gjahr.
    clear: l_belnr_2, l_gjahr_2.
    select belnr gjahr from rbkp into (l_belnr, l_gjahr)
    where rbstat = '2'. "Status = deleted
    concatenate l_belnr l_gjahr into l_string.
    select single belnr gjahr from bkpf into (l_belnr_2, l_gjahr_2)
    where awkey = l_string.
    write: /'FI', l_belnr_2, l_gjahr_2, 'MM', l_belnr, l_gjahr.
    endselect.
    Note that the key here is AWKEY.
    Best regards.
    Edited by: Pablo Casamayor on Apr 13, 2009 3:03 PM

  • Document Tracking PO -MIGO - GR Accounting document - MIRO- A/C doucment

    Hi,
    I want to create a Report wherein I need to print
    PO | Line item | Vendor | MIGO Number | MIGO Accounting DOC | MIRO number | MIRO accounting document
    I am thinking of using
    EKBE to get MIGO and MIRO
    and BKPF for accounting document ( joining with REFERENCE field)
    and EKKO to get vendor of PO
    Wondering if BKPF is the right table to extract information of accounting document or we have some other table from which we can extract this information ??
    Regards
    Shrey

    Hello,
    Once if you have the MIRO number(s), you can use Table BKPF with selection field as AWKEY with will be having MIRO number+do year. There you will get BELNR the accounting doc number. No need to go to BSEG table.
    By the way, what are the input(s) for your reports?
    Regards

  • Accounting document generation

    Dear Gurus
    When I am practicing on FI u2013 MM integration every thing is ok, means opening stock upload (mb1c), purchase order (me21n), goods receipt (migo) and invoice (Miro) are posted then material document also generated but I couldnu2019t get accounting document.
    Account determination (obyc) has no problems I think.
    Please assist me what are the reasons for not to getting the accounting document.
    Thanks in advance
    Regards,
    Prabhakar

    Hi,
    i have issue, how we can resolve
    Material document 5000000000 does not include an accounting document
    Message no. M7082
    Diagnosis
    The system cannot find an accounting document for the material document 5000000000.
    Possible reasons for this are:
    The goods movement has no relevance to accounting. Therefore, the system did not generate an accounting document for the material document.
    The material document is a document that was posted before Release 2.1. Such documents must be converted so that the system can find the relevant accounting document.
    The procedure for the subsequent calculation of value is not active in your system. For further information, refer to the documentation on the program for valuating goods movements: RM07MWBU.
    Procedure
    Choose Continue and then choose another function.
    Find out when the material document was created. If the document was created prior to the Release changeover, ask your system administrator to carry out the conversion of the documents. The individual steps required for document conversion are described in the Release Notes for Release 2.1B.
    the system generate Material document and Account document not generated.

  • RSEG Accounting document no

    Hi
    I  want to get the purchase order wise payment  (check no),I have already get the miro document no in rseg,pls tell me how to get the miro accounting document no

    try to make use of this FM
    AC_DOCUMENT_RECORD.
    or
      call function 'FI_DOCUMENT_RECORD'
        exporting
          i_awtyp            =  'RMRP'
          i_awref            =  w_awref1 --->IR numner of PO
          i_aworg            =  w_gjahr1----.year
        I_AWSYS            = ' '
        I_AWTYP_INCL       = ' '
        I_AWTYP_EXCL       = ' '
        I_BUKRS            = ' '
        tables
          t_documents        = t_doc.
    <b>MIRO numner is Nothing but IR numner ? just pass this along with year .</b>
    Regards
    Prabhu
    Message was edited by: Prabhu Peram

  • Accounting Document not generated after Post goods issue in delivery order.

    Dear Experts
    Greeting of the daays,
    Need your help on below issue.
    After making the post goods issue ,the system is not making the accounting document.
    The error given by the system is as follows:
    Material document 12365 does not include an accounting document
    Diagnosis
    The system cannot find an accounting document for the material document 12365.
    Possible reasons for this are:
    The goods movement has no relevance to accounting. Therefore, the system did not generate an accounting document for the material document.
    The material document is a document that was posted before Release 2.1. Such documents must be converted so that the system can find the relevant accounting document.
    The procedure for the subsequent calculation of value is not active in your system. For further information, refer to the documentation on the program for valuating goods movements: RM07MWBU.
    __Solution what I tried to solve this issue ,but not successful.__
    __Solution 1- maintain OMS2__
    __Solution 2 - maintain OMJJ- movement type 601 - PRCTR is required entry.__
    __Solution 3 - price maintain is material master.__
    __Solution 4 - OBYC - BSX - 7920 - GLA/c  and GBB- VAX and VAY - 7920 GLA/c.__
    __Pls let me know if there is any confirgation is missing.__

    Hi
    Do this checks:
    In tcode OBYC check if you have the proper entries.
    Go to tcode OKB9 and do the settings for the G/L acc. that you have in OBYC.
    To populate PRCTR you can use OKB9 and you can check if you have values in MARC-PRCTR.
    I hope this helps you
    Regards
    Eduardo

  • FI/accounting document tab not working in migo or mb03

    Dear Experts,
    In our test server the accounting entries are not showing when we are trying to check those through MIGO(display) or mb03 by clicking FI document tab.
    Although all are valuated entries, what could be the reason, message is coming "No subsequent document found in Accounting"
    Message no. RW011
    Diagnosis
    All documents generated in Financial Accounting for object type 'MKPF',
    reference document number '5000341600' and organizational unit '2010' should be displayed.
    System Response
    No accompanying documents were found in Financial Accounting
    through mb03 it is showing
    Material document 5000341600 does not include an accounting document
    Message no. M7082
    Diagnosis
    The system cannot find an accounting document for the material document 5000341600.
    Possible reasons for this are:
    The goods movement has no relevance to accounting. Therefore, the system did not generate an accounting document for the material document.
    The material document is a document that was posted before Release 2.1. Such documents must be converted so that the system can find the relevant accounting document.
    The procedure for the subsequent calculation of value is not active in your system. For further information, refer to the documentation on the program for valuating goods movements: RM07MWBU.
    Procedure
    Choose Continue and then choose another function.
    Find out when the material document was created. If the document was created prior to the Release changeover, ask your system administrator to carry out the conversion of the documents. The individual steps required for document conversion are described in the Release Notes for Release 2.1B.
    Regards,
    Alokesh

    Hello,
    Check Account assignment category  Goods recipt check box is flaged or not,
    SPRO---PurchasingAccount assignment category- check the falg mark for related account assignment.
    Check Material type of material is that material is valued or not in OMS2.
    Regards
    Mahesh Naik.

Maybe you are looking for

  • Flash player 10.1 still not working (more information).

    A few months back, I made a thread concerning my situation of specific flash content not being played. I have returned, with hopes that my trials and tribulations may provide more insight into my problem. Basics Windows XP 32bit (v2002) - Media Cente

  • After upgrade of Yosemite folders not visible in finder

    I can no longer see any of my folders - apart from the items on the desktop - but I can not view any contents of folders in finder! Help can not access work! 2 week old MacBook Pro (13-inch, Mid 2012)

  • Kodak Ultima photo  paper...HELP !!!

    Hi, I m looking to solve this issue;I m trying to find a perfect setting to print photos using "Iphoto 6" with a "Canon i860" and this new Kodak paper "UPP-4-A" or "Kodak Ultima photo paper"...All im getting for now are green pictures. Thanks in adva

  • R12 GL Standard Reports

    We were trying to find equivalent reports for the following R11i reports in R12; these reports were available in R11i and are not available in R12. These reports were used in the R11i by the client. Please highlight if there are equivalent reports in

  • Max users

    Hi all. I would like to know what is the maximum number of concurrent users/sessions in oracle. Can i have 100 000 concurrent connections to my database and each one doing very low activity ( 1 small query each minute)?