Report for material prices

Hi,
Please help me out in generation of below report, if it not possible give the table names and field names.
Report to display all material rates by using material number, sales organization and distribution channel and condition type.
Please send your views to '[email protected]'
Thanks & Regards,
Muraly G

Hi
use the following tables to prepare the report
MARA--Material Master-General (MATNR,MTART,MATKL)
MARC--Material Master-Plant data(MATNR,WERKS,EKGRP)
MARD--Material Master- St.Location Data(MATNR,WERKS,LGORT,LABST)
MAKT--Material Descriptions(MATNR,MATKL,MAKTX)
<b>MBEW--</b>Material Valuation Data(MATNR,BWTAR)
<b>MVKE</b>—-Material Master: Sales related Data(MATNR,VKORG,VTWEG)
<b>Reward points for useful Answers</b>
Regards
Anji

Similar Messages

  • Standard report for material price change documents

    Hi Friends,
    Is there a standard report which lists all the material price change document?
    To view the document individually t-code CKMPCD can be used, but I need a report which lists all the documents for a specified period of time.
    Thanks a lot for all the efforts.
    Regards,
    Shilpi

    Hi,
    I do not know a standard report but an infoset+query created based on logical database BRM and BKPF-AWTYP = PRCHG (price change), BKPF-BUDAT (posting date),... and some BSEG-fields will give you the posted amounts. The original document (=corresponding price change document) number can be seen in BKPF-AWKEY.
    best regards, Christian

  • Report for Purchase Price Variance

    Hi,
    Is there any standard report for finding Purchase Price Variance between Purchase Order and Material master
    regards,
    Mallik

    Hi Mallik,
    There is no std report for Purchase price variance .
    But you can check KSB1 , where you can find the Price difference which is going to your PRD account .
    You can find out your PRD G/L account .
    Now go to KSB1 . In the cost element field give the PRD G/L account .
    After executing change the layout as per your requirement .
    Now you can see the Pur Price variance for the particulat material for the PO .
    Otherwise you need to develop a customised report .
    Hope this helps .
    regards

  • Report for material with sloc,qty available, and production order

    hi friends, i need advice on getting this report for material with qty and specific sloc with the corresponding Prodn order numbers. in mb51 i could get all these details except the prodn order no. could you advice me please?

    to make sure you know how to do this.
    In the material document list, hit "Ctrl+F8" on your keyboard.
    A window will pop up. Click on the button position and look for "order" in the list of available fields. That should do it.
    Rgds.

  • Report for material  which not consumed during C015

    HI ALL,
    "I required a report for material which material are not
    consumed at C015 production confirmation time against actual consumation (order wise , part no wise & date wise )"
    its v urgent
    good suggesstion reward with valuable points.

    Amit,
    I think your problem is that you want to monitor when users are deleting the goods issue while confirmation. So you would have to know if for a confirmation qty of 100, the planned consumption should have been 100 but the actual consuption is 50.
    So you would want to relate the confirmation qty with the planned and actual consumption.
    In COOIS Remt, qty and Withdrawal qty will show the total reqmt and actual withdrwal. Hope this will not be helpful if I understand correctly.
    You have to create a simple query joining tables AFVV with RESB. Calculate the planned consuption for the confirmation qty. This along with the actual consuption will help to give what you are looking for.
    I am right ?
    Ram

  • Report for material gr/ir clearing account display differences

    report for material gr/ir clearing account display differences

    hi salsa,
    There is no such report for the datails of material gr/ir ......
    but T code J1ILN and select
    Indirect taxes -
    > Register -
    > Excise tax -
    > In J1IN Update Excise register RG23a -
    > then Extract rg23a----- > PRint utility program Rg23a
    here u can extract all the invoices gr/ir
    Through
    T code J1I5
    J2I5
    J2I6
    if useful assign points...
    regards,
    santoshkumar

  • Table entry for Valuation variant for material prices

    We want to define a valuation variant for costing run.  In that we need to select the material price based on the plan price.  We have provision of entering three plan prices in the Costing tab-2 in the material master.  But we want to enter plan  prices for more than three dates. For this, we propose to enter the dates and prices in a separate table and that table needs to be accessed in the valuation variant for material prices closest to the date of valuation.  How we can go about this ?

    Hi
    When you create Valuation Variant, choose Strategy U i.e. Price from userexit
    Then code the exit COPCP0005 with the help of ABAP consultant
    The logic should be:
    a. Refer the "costing date from" entered in Ck11N
    b. refer the Z table... and pick the price relevant on that date
    br, Ajay M

  • Why can't I create a report for standard price by material

    Any ideas? All reporting I have tried in SQO1 and even in SE16 returns 0 value for standard prices?
    Firstly why is this? and secondly is there another way I can pull a report by material showing standard price?
    Points awarded, many thanks

    hi,
    In MM60, u can get report for  materials having standard & moving average price based on ur input in selection screen like material,plant,material type,material group & created by only. As of my knowledge,
    there is no option to get list of materials with standard price in std.SAP.
    There are two options to generate report for materials with standard price.
    1. It is better go for customization . selection screen must contains price control field. if u enter price control like 'S' or 'V' in intial screen , report is generated.
    2. create a ABAP query for this.
    I hope this info is helpful to u.

  • Problem while creating a ABAP Quarry report for material master

    Hi Friend,
    While I am trying to create a Quarry, certain warning message is coming and while I am executing single material is coming too many times in report with all currencies.
    Picking the data from Table: MARA, MARC, MARD, MAKT, MBEW, QMAT, AND T001 (FOR Currencies only).
    I need your help to clarify 2 point:
    Where I should assign the table with whom as I have simply selected the table one by one assigned button clicked.
    2nd How and from which Table currencies could picked as here said warning is coming and a single material is coming multiple times with all currencies in report.
    I have used as SQ03 then SQ02 and finally SQ01u2026..else I have checked the same in SQVI, but still I didnu2019t get any such fruitful.
    Filed Description          List Display            Screen Display                  Table u2013 Field
    Plant               X          X          MARC                         Material Code          X          X          MARA          
    Storage Location          X          X          MARD                       Storage Condition          X          X          MARA     - RAUBE     
    Material Type                    X          MARA          
    Old Material No          X                    MARA     - BISMT               Material Description          X                                    MAKT                                       Base Unit of Measurement          X                    MARA     - MEINS     
    Material Price (Moving)          X                    MBEW                                   Material Price (Standard)          X                    MBEW     
    Valuation Class          X                    MBEW     -BKLAS
    Inspection Type          X                    QMAT     - ART                  Currency Key          X                    T001              -WARES
    Rest of the field I have not written as you are aware about that .
    Pl suggest or help me to prepare the doc in screen shot, will have a great help from you end.
    Regards,
    Pinku

    Dear Vijay,
    I have done the same as per your earlier, but for picking th ecurrency in display, I have given Table T001, whether it is o.k. or else what? Wheneven I am trying by th esam eway, system is poping a warning message and then it's executing , but displaying all the materials with all currecies means a single material is coming too amny times with all currecy, so I need to pick extact one and for that if you could do andcan send me a screen shot more helpful to me.
    Thanks.
    jbs.sap.mm                at the rate of hotmail.com
    Pinku

  • Standard report for material document with excise

    Dear Gurus,
        Is there any standard report for which i can trace for all the incoming material grn whether excise is captured or not.
        i.e) a report with excise no, quantity and material document   
        thanks in advance
    Vasanth

    Hi,
    J1i7 is the standard report which shows wether the part1 or part2 is posted or no posting is done, you can select the layout as per your choice by change layout.
    Thanks,
    Vinay

  • Report for PO price more than standard cost

    We are currently without MM support at our plant, so I hope some one of you can help me.
    The new supply chain director want a report of POs that are placed where the PO price is not equal to the standard and will thus generate a price variance upon receipt.
    Query would be tough due to Unit of purchase vs MatMstr unit of measure.  I'm hoping for a standard report?
    The buyer does get a warning that the two are not equal, but they enter through them.  Is there a report of warnings issues??
    Any help would be great
    Thanks
    Althea

    There is not such stadard report for this but you can check the PO price in ME80FN.
    But for comparison and the diff report you have to have right the Query using
    EKKO, EKPO and MBEW table
    and the UOM you need to select the Order unit of the PO.

  • Report for material list

    hi,
    i want a material list for which if i specify a period i will get materials with
    a)No goods reciept
    b)No stock or material movement(issue/transfer posting etc).
    c)no sales or shipping.
    should have happened for the materials for that period.
    if no standard report exists can you tell me the algoritthm.
    urgent: satisfying answers will be awarded full points

    Rajkiran,
    am sure you will never setisfy even we send you number of report because you have to chenge according to your requirement.dont expect spoon feeding.
    *& Object Id               :                                                  &*
    *& Object Name             : ZMM_STO_REGISTER                                 &*
    *& Function Module Name    : MM                                               &*
    *& Transaction Code        : ZMMSTO                                           &*
    *& Author                  : Amit&*
    *& Module Name             : MATERIAL MANAGEMENT                              &*
    *& Sub-Module              :                                                  &*
    *& Program Type            : Report                                           &*
    *& Create Date             : 28.03.2007                                       &*
    *& Completion Date         : 30.03.2007                                       &*
    *& SAP Release             :                                                  &*
    *& Description             : STO REGISTER                                     &*
    *& MODIFICATION LOG        : MODIFIED AT 30.04.2007 adding new field          &*
    *&                          chapter-id by chakrapani mishra                   &*
    REPORT  zmm_sto_register.
    *                             TABLES USED                                     *
    TABLES :vbrk,                                   "Billing Document: Header Data
            vbrp,                                   "Billing Document: Item Data
            mara,                                   "General Material Data
            konv,                                   "Conditions (Transaction Data)
            t023t,                                  "Material Group Descriptions
            ekko,                                   "Purchasing Document Header
            likp,                                   "SD Document: Delivery Header Data
            mvke,                                   "Sales Data for Material
            t001w,                                  "Plants/Branches
            marm,                                   "Units of Measure for Material
            j_1imtchid,                             "Combination of Material Number and Chapter ID
            mseg,
            mkpf,
            j_1iexchdr.
    TYPE-POOLS : slis.                              "TYPE POOL SLIS
    *                      INTERNAL TABLES                                      *
    DATA: BEGIN OF t_vbrp OCCURS 0,                "INTERNAL TABLE FOR VBRP
            vbeln LIKE vbrp-vbeln,                 "Billing Document
            vstel LIKE vbrp-vstel,                 "Shipping Point/Receiving Point
           vgbel LIKE vbrp-vgbel,                 "Document number of the reference document
            aubel LIKE vbrp-aubel,                 "Sales Document
            matnr LIKE vbrp-matnr,                 "Material Number
            arktx LIKE vbrp-arktx,                 "Short text for sales order item
            matkl LIKE vbrp-matkl,                 "Material Group
            fkimg LIKE vbrp-fkimg,                 "Actual Invoiced Quantity
            werks LIKE vbrp-werks,                 "Plant
            posnr LIKE vbrp-posnr,                 " Billing item
            vrkme LIKE vbrp-vrkme,                 " Sales unit
            vgbel1 LIKE mkpf-xblnr,
    END OF t_vbrp.
    DATA: BEGIN OF t_vbrk OCCURS 0,                 "INTERNAL TABLE FOR VBRK
            kunag LIKE vbrk-kunag,                  "Sold-to party
            vbeln LIKE vbrk-vbeln,                  "Billing Document
            fkdat LIKE vbrk-fkdat,                  "Billing date for billing index and printout
            knumv LIKE vbrk-knumv,                  "Number of the document condition
            fkart LIKE vbrk-fkart,                  "Billing Type
            vtweg LIKE vbrk-vtweg,                  "Distribution Channel
            vkorg LIKE vbrk-vkorg,                  "Sales Organization
            erzet LIKE vbrk-erzet,
            w_flag TYPE c,
            l_tabix TYPE sy-tabix,
    END OF t_vbrk.
    DATA: BEGIN OF t_temp1 OCCURS 0,                 "INTERNAL TABLE FOR VBRK
           vbeln LIKE vbrp-vbeln,                 "Billing Document
           fkart LIKE vbrk-fkart,
          fkdat LIKE vbrk-fkdat,
           vgbel LIKE vbrp-vgbel,                 "Document number of the reference document
           werks LIKE vbrp-werks,
           w_flag TYPE c,
    END OF t_temp1.
    DATA: BEGIN OF t_mara OCCURS 0,                 "INTERNAL TABLE FOR MARA
            matnr LIKE mara-matnr,                  "Material Number
            mtart LIKE mara-mtart,                  "Material Type
            wrkst LIKE mara-wrkst,                  "Finish
            extwg LIKE mara-extwg,                  "Design
            labor LIKE mara-labor,                  "Grade/Category No.
            normt LIKE mara-normt,                  "Thickness in mm
            bismt LIKE mara-bismt,                  "Size (L*B) in mm
            matkl LIKE mara-matkl,
            spart LIKE mara-spart,
            meins LIKE mara-meins,
    END OF t_mara.
    DATA : BEGIN OF t_konv OCCURS 0,                "INTERNAL TABLE FOR KONV
            knumv LIKE konv-knumv,                  "Number of the document condition
            kposn LIKE konv-kposn,                  "Condition item number
            kschl LIKE konv-kschl,                  "Condition type
            kwert LIKE konv-kwert,                  "Condition value
            kbetr LIKE konv-kbetr,                  "Condition rate
            END OF t_konv.
    DATA : BEGIN OF t_likp OCCURS 0,               "INTERNAL TABLE FOR LIKP
            vbeln LIKE likp-vbeln,                 "Delivery
            lfdat LIKE likp-lfdat,                 "Delivery Date
            kunnr LIKE likp-kunnr,
            bldat LIKE likp-bldat,                " document date
            vbeln_kp LIKE mkpf-xblnr, " likp-vbeln,
            END OF t_likp.
    DATA : BEGIN OF t_t023t OCCURS 0,              "INTERNAL TABLE FOR T023T
            matkl LIKE t023t-matkl,               "Material Group
            wgbez LIKE t023t-wgbez,                "Material Group Description
            spras LIKE t023t-spras,                "Language Key
            END OF t_t023t.
    DATA : BEGIN OF t_ekko OCCURS 0,               "INTERNAL TABLE FOR EKKO
            ebeln LIKE ekko-ebeln,                 "Purchasing Document Number
            bsart LIKE ekko-bsart,                 "Purchasing Document Type
            aedat LIKE ekko-aedat,                 "Date on Which Record Was Created
            knumv LIKE ekko-knumv,                 "Number of the document condition
            END OF t_ekko.
    DATA : BEGIN OF t_ekpo OCCURS 0,               "INTERNAL TABLE FOR EKKO
            ebeln LIKE ekko-ebeln,                 "Purchasing Document Number
            loekz LIKE ekko-loekz,                 "Purchasing Document Type
            END OF t_ekpo.
    DATA : BEGIN OF t_mvke OCCURS 0,
            matnr LIKE mvke-matnr,
            mvgr1 LIKE mvke-mvgr1,
            END OF t_mvke.
    DATA : BEGIN OF t_t001w OCCURS 0,                "INTERNAL TABLE FOR KONV
            werks LIKE t001w-werks,                  "Number of the document condition
            name1 LIKE t001w-name1,                  "Condition type
            kunnr LIKE t001w-kunnr,                  "Condition value
            name2 LIKE t001w-name2,                  "Condition item number
           END OF t_t001w.
    DATA : BEGIN OF t_t001w2 OCCURS 0,                "INTERNAL TABLE FOR KONV
            werks LIKE t001w-werks,                  "Number of the document condition
            name1 LIKE t001w-name1,                  "Condition type
            kunnr LIKE t001w-kunnr,                  "Condition value
            name2 LIKE t001w-name2,                  "Condition item number
           END OF t_t001w2.
    DATA : BEGIN OF t_marm OCCURS 0,
            matnr LIKE marm-matnr,
            meinh LIKE marm-meinh,
            umrez LIKE marm-umrez,
            umren LIKE marm-umren,
            END OF t_marm.
    DATA : BEGIN OF t_tvm1t OCCURS 0,
            mvgr1 LIKE tvm1t-mvgr1,
            bezie LIKE tvm1t-bezei,
            END OF t_tvm1t.
    **********************modification additioon of chapter ID  30.04.2007
    DATA : BEGIN OF t_j_1imtchid OCCURS 0,              "INTERNAL TABLE FOR j_1imtchid
            matnr LIKE j_1imtchid-matnr,                "Material Number
           j_1ichid LIKE j_1imtchid-j_1ichid,           "Chapter ID
            END OF t_j_1imtchid.
    DATA : BEGIN OF t_j_1iexchdr OCCURS 0,              "INTERNAL TABLE FOR j_1imtchid
            exnum LIKE j_1iexchdr-exnum,                "Material Number
            exdat LIKE j_1iexchdr-exdat,                "Chapter ID
            rdoc LIKE j_1iexchdr-rdoc,
            werks LIKE j_1iexchdr-werks,
            status LIKE j_1iexchdr-status,
            trntyp LIKE j_1iexchdr-trntyp,
            END OF t_j_1iexchdr.
    **********************modification additioon of chapter ID  30.04.2007
    DATA: BEGIN OF t_final OCCURS 0,                  "INTERNAL TABLE T_FINAL
              fkart LIKE vbrk-fkart,
              kunag LIKE vbrk-kunag,
              vbeln_k LIKE vbrk-vbeln,
              fkdat LIKE vbrk-fkdat,
              knumv LIKE vbrk-knumv,
              fkart1 LIKE vbrk-fkart,
              vtweg LIKE vbrk-vtweg,
              vkorg LIKE vbrk-vkorg,
              vbeln LIKE likp-vbeln,                 "Delivery
              vbeln_p LIKE vbrp-vbeln,
              vstel LIKE vbrp-vstel,
              "vgbel like mkpf-xblnr,
              vgbel LIKE vbrp-vgbel,
              aubel LIKE vbrp-aubel,
              matnr LIKE vbrp-matnr,
              arktx LIKE vbrp-arktx,
              matkl LIKE vbrp-matkl,
              fkimg LIKE vbrp-fkimg,
              posnr LIKE vbrp-posnr,
              vrkme LIKE vbrp-vrkme,
              matnr_m LIKE mara-matnr,
              mtart LIKE mara-mtart,
              wrkst LIKE mara-wrkst,
              extwg LIKE mara-extwg,
              labor LIKE mara-labor,
              normt LIKE mara-normt,
              bismt LIKE mara-bismt,
              spart LIKE mara-spart,
              meins LIKE mara-meins,
              kposn LIKE konv-kposn,
              kschl LIKE konv-kschl,
              kwert LIKE konv-kwert,
              kwert1 LIKE konv-kwert,
              kwert2 LIKE konv-kwert,
              kwert3 LIKE konv-kwert,
              kwert4 LIKE konv-kwert,
              kwert5 LIKE konv-kwert,
              kbetr LIKE konv-kbetr,
              vbeln_kp LIKE mkpf-xblnr, " likp-vbeln,
              lfdat LIKE likp-lfdat,
              wgbez LIKE t023t-wgbez,
              spras LIKE t023t-spras,
              bsart LIKE ekko-bsart,
              aedat LIKE ekko-aedat,
    **********************modification additioon of chapter ID  30.04.2007
           j_1ichid LIKE j_1imtchid-j_1ichid ,
    **********************modification additioon of chapter ID  30.04.2007
              total TYPE  p  DECIMALS 2,
              mvgr1 LIKE mvke-mvgr1,
              werks LIKE t001w-werks,                  "Number of the document condition
              kunnr LIKE t001w-kunnr,                  "Condition value
              name1 LIKE t001w-name1,                  "Condition type
              name2 LIKE t001w-name2,                  "Condition item number
              werks1 LIKE t001w-werks,                  "Number of the document condition
              kunnr1 LIKE t001w-kunnr,                  "Condition value
              name11 LIKE t001w-name1,                  "Condition type
              name21 LIKE t001w-name2,
              exnum LIKE j_1iexchdr-exnum,                "Material Number
              exdat LIKE j_1iexchdr-exdat,           "Chapter ID
              rdoc LIKE j_1iexchdr-rdoc,
              bom TYPE p DECIMALS 4,
              mult TYPE p DECIMALS 4,
              bezie LIKE tvm1t-bezei,
              length(5) TYPE n,
              breath(5) TYPE n,
               bldat LIKE likp-bldat,                " document date
              size(15) TYPE p DECIMALS 2,
              area(15) TYPE  p DECIMALS 2,
               mblnr TYPE mseg-mblnr,     "Number of Material Document
               mjahr TYPE mseg-mjahr,     "Material Document Year
               budat TYPE mkpf-budat,     "Posting period
               w_flag TYPE c,
                flag TYPE c,
        END OF t_final.
    DATA : BEGIN OF t_temp OCCURS 0,
           kunag LIKE vbrk-kunag,
              vbeln_k LIKE vbrk-vbeln,
              fkdat LIKE vbrk-fkdat,
              knumv LIKE vbrk-knumv,
              fkart LIKE vbrk-fkart,
              vtweg LIKE vbrk-vtweg,
              vkorg LIKE vbrk-vkorg,
              vbeln LIKE likp-vbeln,                 "Delivery
              vbeln_p LIKE vbrp-vbeln,
              vstel LIKE vbrp-vstel,
              "vgbel like mkpf-xblnr,
              vgbel LIKE vbrp-vgbel,
              aubel LIKE vbrp-aubel,
              matnr LIKE vbrp-matnr,
              arktx LIKE vbrp-arktx,
              matkl LIKE vbrp-matkl,
              fkimg LIKE vbrp-fkimg,
              posnr LIKE vbrp-posnr,
              vrkme LIKE vbrp-vrkme,
              matnr_m LIKE mara-matnr,
              mtart LIKE mara-mtart,
              wrkst LIKE mara-wrkst,
              extwg LIKE mara-extwg,
              labor LIKE mara-labor,
              normt LIKE mara-normt,
              bismt LIKE mara-bismt,
              spart LIKE mara-spart,
              meins LIKE mara-meins,
              kposn LIKE konv-kposn,
              kschl LIKE konv-kschl,
              kwert LIKE konv-kwert,
              kwert1 LIKE konv-kwert,
              kwert2 LIKE konv-kwert,
              kwert3 LIKE konv-kwert,
              kwert4 LIKE konv-kwert,
              kwert5 LIKE konv-kwert,
              kbetr LIKE konv-kbetr,
              vbeln_kp LIKE mkpf-xblnr, " likp-vbeln,
              lfdat LIKE likp-lfdat,
              wgbez LIKE t023t-wgbez,
              spras LIKE t023t-spras,
              bsart LIKE ekko-bsart,
              aedat LIKE ekko-aedat,
    **********************modification additioon of chapter ID  30.04.2007
           j_1ichid LIKE j_1imtchid-j_1ichid ,
    **********************modification additioon of chapter ID  30.04.2007
              total TYPE  p  DECIMALS 2,
              mvgr1 LIKE mvke-mvgr1,
              werks LIKE t001w-werks,                  "Number of the document condition
              kunnr LIKE t001w-kunnr,                  "Condition value
              name1 LIKE t001w-name1,                  "Condition type
              name2 LIKE t001w-name2,                  "Condition item number
              werks1 LIKE t001w-werks,                  "Number of the document condition
              kunnr1 LIKE t001w-kunnr,                  "Condition value
              name11 LIKE t001w-name1,                  "Condition type
              name21 LIKE t001w-name2,
              exnum LIKE j_1iexchdr-exnum,                "Material Number
              exdat LIKE j_1iexchdr-exdat,           "Chapter ID
              rdoc LIKE j_1iexchdr-rdoc,
              bom TYPE p DECIMALS 4,
              mult TYPE p DECIMALS 4,
              bezie LIKE tvm1t-bezei,
              length(5) TYPE n,
              breath(5) TYPE n,
              size(15) TYPE p DECIMALS 2,
              area(15) TYPE  p DECIMALS 2,
               mblnr TYPE mseg-mblnr,     "Number of Material Document
               mjahr TYPE mseg-mjahr,     "Material Document Year
               budat TYPE mkpf-budat,     "Posting period
            END OF t_temp.
    DATA : BEGIN OF it_mseg OCCURS 0,
             werks LIKE mseg-werks,
             matnr LIKE mseg-matnr,
             ebeln LIKE mseg-ebeln,
             mblnr TYPE mseg-mblnr,    "Number of Material Document
             mjahr TYPE mseg-mjahr,     "Material Document Year
           END OF it_mseg.
    DATA : BEGIN OF it_mkpf OCCURS 0,
              budat TYPE mkpf-budat,
              mblnr TYPE mkpf-mblnr,
             tcode2 LIKE mkpf-tcode2,
            "  xblnr(10) TYPE C,
             xblnr LIKE likp-vbeln,                 "Delivery
           END OF it_mkpf.
    DATA : BEGIN OF it_vbuk OCCURS 0,
            vbeln LIKE vbuk-vbeln,
            wbstk LIKE vbuk-wbstk,
            END OF it_vbuk.
    DATA : it_vbrk LIKE t_vbrk OCCURS 0 WITH HEADER LINE.
    DATA : it_vbrp LIKE t_vbrp OCCURS 0 WITH HEADER LINE.
    DATA : it_mara LIKE t_mara OCCURS 0 WITH HEADER LINE.
    TYPES : w_str TYPE  string,
            str  TYPE  string.
    *                      WORK AREAS                                         *
    DATA:  wa_vbrk    LIKE  t_vbrk.                     "WORK AREA FOR VBRK
    DATA:  wa_vbrp    LIKE  t_vbrp.                     "WORK AREA FOR VBRP
    DATA:  wa_mara    LIKE  t_mara.                     "WORK AREA FOR MARA
    DATA:  wa_sfinal  LIKE  t_temp.                    "WORK AREA FOR T_FINAL
    DATA:  wa_sfinal1  LIKE  t_final.                    "WORK AREA FOR T_FINAL
    DATA:  wa_mseg    LIKE  it_mseg.                     "Workarea for  internal table mseg
    DATA :  wa_vbeln LIKE t_vbrk-vbeln.
    DATA:  wa_mkpf    LIKE  it_mkpf.                     "Workarea for  internal table mkpf
    *                          ALV                                           *
    DATA: it_fieldcat     TYPE    slis_t_fieldcat_alv,
          wa_fieldcat     LIKE    LINE OF it_fieldcat,
          it_top_of_page  TYPE    slis_t_listheader,
          ls_layout       TYPE    slis_layout_alv,
          gt_events       TYPE    slis_t_event.
    *                     SELECTION-SCREEN                                    *
    SELECTION-SCREEN BEGIN OF BLOCK detail WITH FRAME TITLE text-000.
    SELECT-OPTIONS: supp_pnt FOR vbrp-vstel OBLIGATORY.              "SUPPLYING PLANT
    SELECT-OPTIONS: recv_pnt FOR vbrk-kunag OBLIGATORY.              "RECEIVING PLANT
    SELECT-OPTIONS: period   FOR vbrk-fkdat OBLIGATORY.              "PERIOD
    SELECT-OPTIONS: budat    FOR mkpf-budat.                        " MIGO DATE
    SELECTION-SCREEN  END OF BLOCK detail.
    *                   START-OF-SELECTION                                 *
    ***********************************POPULATING DATA
    PERFORM populating_data.
    **********************************MOVE DATA
    PERFORM move_data.
    *********************************DATA- FETCHING
    PERFORM data_fetching.
    *********************************GET ALV  DATA
    PERFORM alv_get_data.
    *********************************ALV GRID DATA
    PERFORM alv_grid.
    *********************************TOP OF PAGE
    PERFORM top_of_page.
    *                    VALIDATION  OF SELECTION SCREEN                     *
    AT SELECTION-SCREEN ON period.
      IF period-high IS INITIAL.
        MESSAGE e001(zamit).
      ENDIF.
    *                      SELECTION OF DATA                        *
    FORM populating_data.
    *************POPULATING DATA FROM VBRK
      CLEAR   t_vbrk.
      REFRESH t_vbrk.
      SELECT  kunag
              vbeln
              fkdat
              knumv
              fkart
              vtweg
              vkorg
              erzet
      FROM vbrk INTO TABLE t_vbrk
      WHERE kunag IN recv_pnt AND
            fkdat IN period   AND
                fkart = 'JEX' OR
                fkart = 'F8'  AND
                vtweg = '10'  AND
                vkorg = '1000'.
      DELETE t_vbrk[]   WHERE fkdat = '' .
      DELETE t_vbrk[]   WHERE fkdat NOT IN period.
      DELETE t_vbrk[]   WHERE kunag NOT IN recv_pnt.
      IF t_vbrk[] IS INITIAL.
        MESSAGE i002(zamit).
        LEAVE LIST-PROCESSING.
      ENDIF.
      DELETE t_vbrk WHERE fkdat NOT IN period.
    *DATA: l_tabix TYPE sy-tabix.           " declare the sy-tabix as local variable
    *DATA: l_lines TYPE sy-tabix.
    *DATA: l_index TYPE sy-tabix.
    *"SORT T_VBRK DESCENDING BY vbeln.
    *SORT T_VBRK ASCENDING BY vbeln fkart .
    *DESCRIBE TABLE t_vbrk LINES  l_lines .       "The current number of table rows of the internal table itab is determined and is assigned to the data object lin
    *CHECK l_lines > 1.                               " check lines are greater than 1
    *LOOP AT t_vbrk.
    *  l_tabix = sy-tabix.                              " assine Index of Internal Tables into local var l_tabix
    *  l_index = l_tabix + 1.
    *  IF t_vbrk-fkart = 'F8'.                          " loop on the temp table
    *READ TABLE t_vbrk INTO wa_vbrk INDEX l_index.  " read the temp table with index l_index
    *IF sy-subrc = 0.
    *CHECK t_vbrk-vbeln < wa_vbrk-vbeln .
    *  if sy-subrc =  0.
    *  t_vbrk-W_FLAG = 'X'.
    *  MODIFY t_vbrk TRANSPORTING W_FLAG.
    *endif.
    * endif.
    *else.
    *  exit.
    *endif.
    *endloop.
    *LOOP at t_vbrk.
    *DELETE t_vbrk WHERE w_flag = 'X' .
    *endloop.
    *" change  by kalika dated 28.06.2007
    **" change  by kalika dated 28.06.2007
    *************POPULATING DATA FROM VBRP
      IF t_vbrk[] IS NOT INITIAL.
        CLEAR   t_vbrp.
        REFRESH t_vbrp.
        SELECT  vbeln
                vstel
                vgbel
                aubel
                matnr
                arktx
                matkl
                fkimg
                werks
                posnr
                vrkme
         FROM vbrp INTO TABLE t_vbrp
         FOR ALL ENTRIES IN t_vbrk
         WHERE vbeln = t_vbrk-vbeln
         AND vstel IN supp_pnt  .
      ENDIF.
      IF sy-subrc <> 0.
        MESSAGE i000(zamit).
        LEAVE LIST-PROCESSING.
      ENDIF.
      IF t_vbrp[] IS NOT INITIAL.
        SELECT vbeln wbstk FROM vbuk
          INTO TABLE it_vbuk FOR ALL ENTRIES IN
          t_vbrp WHERE vbeln = t_vbrp-vgbel.
      ENDIF.
      "DELETE t_vbrp[] WHERE vstel NOT in supp_pnt.  " by kalika
    *************POPULATING DATA FROM MARA
      it_vbrp[] = t_vbrp[].
      " it_vbrp-vgbel1 = t_vbrp-vgbel.
      "SORT it_vbrp BY matnr.
      SORT t_vbrp BY vbeln.
      "  DELETE ADJACENT DUPLICATES FROM it_vbrp COMPARING matnr . by kalika
    *  IF t_vbrp IS NOT INITIAL.
      CLEAR   t_mara.
      REFRESH t_mara.
      SELECT  matnr
              mtart
              wrkst
              extwg
              labor
              normt
              bismt
              matkl
              spart
              meins
         FROM mara INTO TABLE t_mara
              FOR ALL ENTRIES IN it_vbrp WHERE
              matnr = it_vbrp-matnr .
    *  ENDIF.
    *************POPULATING DATA FROM KONV
      it_vbrk[] = t_vbrk[].
      SORT it_vbrk BY knumv .
      DELETE ADJACENT DUPLICATES FROM it_vbrk COMPARING knumv .
      CLEAR   t_konv.
      REFRESH t_konv.
      SELECT  knumv
              kposn
              kschl
              kwert
              kbetr
         FROM konv INTO TABLE t_konv
         FOR ALL ENTRIES IN it_vbrk
           WHERE knumv = it_vbrk-knumv.
      DELETE t_konv WHERE
                             kschl <> 'ZR02'
                             AND  kschl <> 'JEXP'
                             AND  kschl <> 'JECS'
                             AND  kschl <> 'DIFF'.
    *************POPULATING DATA FROM LIKP
      it_vbrp[] = t_vbrp[].
      SORT it_vbrp BY vgbel.
      " DELETE ADJACENT DUPLICATES FROM it_vbrp COMPARING vgbel . by kalika
      CLEAR   t_likp.
      REFRESH t_likp.
      SELECT  vbeln
              lfdat
              bldat  " NEW CHANGE
         FROM likp INTO CORRESPONDING FIELDS OF TABLE t_likp
         FOR ALL ENTRIES IN it_vbrp
         WHERE vbeln = it_vbrp-vgbel.
    *************POPULATING DATA FROM T023T
      it_mara[] = t_mara[].
      SORT it_mara BY matkl .
      DELETE ADJACENT DUPLICATES FROM it_mara COMPARING matkl.
      CLEAR   t_t023t.
      REFRESH t_t023t.
      IF t_mara[] IS NOT INITIAL.
        SELECT  matkl
                wgbez
                spras
           FROM t023t INTO TABLE t_t023t
           FOR ALL ENTRIES IN it_mara
           WHERE matkl = it_mara-matkl  AND
                 spras = sy-langu.
      ENDIF.
    *************POPULATING DATA FROM EKKO
      it_vbrp[] = t_vbrp[].
      SORT it_vbrp BY aubel.
      " DELETE ADJACENT DUPLICATES FROM it_vbrp COMPARING aubel. by kalika
      CLEAR t_ekko.
      REFRESH t_ekko.
      SELECT ebeln
             bsart
             aedat
             knumv
        FROM ekko
        INTO TABLE t_ekko
        FOR ALL ENTRIES IN it_vbrp
       WHERE ebeln = it_vbrp-aubel
              AND bsart LIKE 'U%'.
    ************************delete invoice where it is being deleted from the system
    *SELECT  ebeln  loekz
    *  FROM ekpo
    *  INTO CORRESPONDING FIELDS OF TABLE t_ekpo
    *  FOR ALL ENTRIES IN t_ekko
    *  WHERE ebeln = t_ekko-ebeln.
    *DELETE t_ekpo WHERE loekz = 'L'.
    *************POPULATING DATA FROM t001w
      it_vbrp[] = t_vbrp[].
      SORT it_vbrp BY werks.
      "  DELETE ADJACENT DUPLICATES FROM it_vbrp COMPARING werks . by kalika
      CLEAR   t_t001w.
      REFRESH t_t001w.
      SELECT  werks
              name1
              kunnr
              name2
         FROM t001w INTO TABLE t_t001w
         FOR ALL ENTRIES IN it_vbrp
         WHERE werks = it_vbrp-werks .
      it_vbrk[] = t_vbrk[].
      SORT it_vbrk BY kunag.
      DELETE ADJACENT DUPLICATES FROM it_vbrk COMPARING kunag .
      CLEAR   t_t001w2.
      REFRESH t_t001w2.
      SELECT  werks
              name1
              kunnr
              name2
         FROM t001w INTO TABLE t_t001w2
         FOR ALL ENTRIES IN it_vbrk
         WHERE kunnr = it_vbrk-kunag .
    *--------POPULATING DATA FROM MARM
      SELECT matnr
              meinh
              umrez
              umren FROM marm INTO TABLE t_marm
              FOR ALL ENTRIES IN t_mara
              WHERE matnr = t_mara-matnr.
    *********************POPULATING DATA FROM MVKE
      CLEAR   t_mvke.
      REFRESH t_mvke.
      SELECT  matnr
              mvgr1
         FROM mvke INTO TABLE t_mvke
         FOR ALL ENTRIES IN t_vbrp
           WHERE matnr = t_vbrp-matnr .
    *-----------------POPULATING DATA FROM TVM1T.
      SELECT
              mvgr1 bezei FROM tvm1t
              INTO TABLE t_tvm1t FOR ALL ENTRIES IN t_mvke
              WHERE mvgr1 = t_mvke-mvgr1.
    **********************modification additioon of chapter ID  30.04.2007
    *-----------------POPULATING DATA FROM j_1imtchid.
      CLEAR   t_j_1imtchid.
      REFRESH t_j_1imtchid.
      SELECT  matnr
              j_1ichid
         FROM j_1imtchid INTO TABLE t_j_1imtchid
         FOR ALL ENTRIES IN t_vbrp
           WHERE matnr = t_vbrp-matnr .
    *-----------------POPULATING DATA FROM j_1iexchdr.
      CLEAR   t_j_1iexchdr.
      REFRESH t_j_1iexchdr.
      SELECT  exnum
              exdat
              rdoc
              werks
              trntyp
              status
         FROM j_1iexchdr INTO TABLE t_j_1iexchdr
         FOR ALL ENTRIES IN t_vbrp
         WHERE rdoc = t_vbrp-vbeln
         AND werks = t_vbrp-werks
         AND trntyp = 'DLFC'   .      " by kalika
      DELETE t_j_1iexchdr WHERE status = 'R' .   " by kalika
      DELETE t_j_1iexchdr WHERE status = 'B' .   " by kalika
      SORT t_j_1iexchdr BY rdoc.
    ***************end of modification additioon of chapter ID  30.04.2007
    ******* start of modification kalika dated 19.06.2007
      LOOP AT t_likp.
        t_likp-vbeln_kp = t_likp-vbeln.
        MODIFY  t_likp.
      ENDLOOP.
    *  SELECT budat mblnr xblnr tcode2
    *    FROM mkpf
    *    INTO CORRESPONDING FIELDS OF TABLE it_mkpf
    *    FOR ALL ENTRIES IN t_likp
    *    WHERE xblnr = t_likp-vbeln_kp
    *    AND tcode2 LIKE 'MIGO_GR'
    *    AND budat IN budat. "26.07.2007
      SELECT ebeln mblnr FROM mseg
        INTO CORRESPONDING FIELDS OF TABLE it_mseg
        FOR ALL ENTRIES IN t_vbrp
        WHERE ebeln = t_vbrp-aubel AND mblnr LIKE '5%'.
      SELECT budat mblnr tcode2
          FROM mkpf
          INTO CORRESPONDING FIELDS OF TABLE it_mkpf
          FOR ALL ENTRIES IN it_mseg
          WHERE mblnr = it_mseg-mblnr
          AND tcode2 LIKE 'MIGO_GR'
          AND budat IN budat.                                   "26.07.2007
    *loop at it_mkpf.
    *DELETE it_mkpf WHERE mblnr = '4'.
    *MODIFY it_mkpf.
    *ENDLOOP.
    ENDFORM.                    "populating_data
    *                    FORM MOVE_DATA.                             *
    FORM move_data.
      CLEAR   t_final.
      REFRESH t_final.
      SORT : t_vbrp  BY vbeln,
             t_vbrk  BY vbeln,
             t_mara  BY matnr,
             t_likp  BY vbeln,
             t_ekko  BY ebeln,
             t_t023t BY matkl,
             t_konv BY knumv,
             t_mvke BY matnr,
             t_t001w BY werks,
             t_t001w2 BY kunnr,
             t_tvm1t BY mvgr1,
             t_j_1iexchdr BY rdoc,
             t_j_1imtchid  BY matnr,
              t_j_1iexchdr BY rdoc werks,
           "   it_mkpf by mblnr,
              it_mseg BY mblnr,
              it_mkpf BY mblnr,
              it_vbuk BY vbeln.
      CLEAR   t_vbrp.
      LOOP AT t_vbrp.
        t_final-vstel = t_vbrp-vstel.
        t_final-vgbel = t_vbrp-vgbel.
        t_final-aubel = t_vbrp-aubel.
        t_final-matnr = t_vbrp-matnr.
        t_final-arktx = t_vbrp-arktx.
        t_final-matkl = t_vbrp-matkl.
        t_final-fkimg = t_vbrp-fkimg.
        t_final-posnr = t_vbrp-posnr.
        t_final-vrkme = t_vbrp-vrkme.
        " t_vbrp-vgbel1 = t_vbrp-vgbel.
        READ TABLE it_vbuk WITH KEY vbeln = t_vbrp-vgbel BINARY SEARCH.
        IF sy-subrc = 0.
          t_final-flag = it_vbuk-wbstk.
        ENDIF.
        CLEAR t_vbrk.
        READ TABLE t_vbrk WITH KEY vbeln = t_vbrp-vbeln
                                   BINARY SEARCH.
        IF sy-subrc = 0.
          t_final-kunag   = t_vbrk-kunag.
          t_final-vbeln_k = t_vbrk-vbeln.
          t_final-fkdat   = t_vbrk-fkdat.
          t_final-fkart  = t_vbrk-fkart.
          t_final-knumv =   t_vbrk-knumv.
        ENDIF.
        CLEAR t_mara.
        READ TABLE t_mara WITH KEY matnr = t_vbrp-matnr BINARY SEARCH.
        IF sy-subrc = 0.
          t_final-mtart = t_mara-mtart.
          t_final-wrkst = t_mara-wrkst.
          t_final-extwg = t_mara-extwg.
          t_final-labor = t_mara-labor.
          t_final-normt = t_mara-normt.
          t_final-bismt = t_mara-bismt.
          t_final-spart = t_mara-spart.
          t_final-meins = t_mara-meins.
          SPLIT t_final-bismt AT '*' INTO t_final-length t_final-breath.
          IF t_final-bismt = ''.
            t_final-size = ''.
          ELSE.
            t_final-size = t_vbrp-fkimg *  ( t_final-length * t_final-breath ) / 1000000.
          ENDIF.
        ENDIF.
        CLEAR t_konv.
        READ TABLE t_konv WITH KEY knumv = t_vbrk-knumv BINARY SEARCH.
        IF sy-subrc = 0.
          t_final-kschl = t_konv-kschl.
        ENDIF.
        CLEAR t_likp.
        READ TABLE t_likp WITH KEY vbeln = t_vbrp-vgbel BINARY SEARCH.
        IF sy-subrc = 0.
          t_final-lfdat = t_likp-lfdat.
          t_final-bldat = t_likp-bldat. " NEW CHANGE
          t_final-vbeln_kp = t_likp-vbeln.
        ENDIF.
        CLEAR t_ekko.
        READ TABLE t_ekko WITH KEY ebeln = t_vbrp-aubel BINARY SEARCH.
        IF sy-subrc = 0.
          t_final-aedat = t_ekko-aedat.
        ENDIF.
        CLEAR t_t023t.
        READ TABLE t_t023t WITH KEY matkl = t_vbrp-matkl BINARY SEARCH.
        IF sy-subrc = 0.
          t_final-wgbez = t_t023t-wgbez.
        ENDIF.
        CLEAR t_t001w.
        READ TABLE t_t001w WITH KEY werks = t_vbrp-werks BINARY SEARCH.
        IF sy-subrc = 0.
          t_final-name1 = t_t001w-name1.
        ENDIF.
        CLEAR t_t001w2.
        READ TABLE t_t001w2 WITH KEY kunnr = t_vbrk-kunag BINARY SEARCH.
        IF sy-subrc = 0.
          t_final-name21 = t_t001w2-name2.
        ENDIF.
        READ TABLE t_mvke WITH KEY matnr = t_vbrp-matnr BINARY SEARCH.
        IF sy-subrc = 0.
          t_final-mvgr1 = t_mvke-mvgr1.
        ENDIF.
        READ TABLE t_tvm1t WITH KEY mvgr1 = t_mvke-mvgr1 BINARY SEARCH.
        IF sy-subrc = 0.
          t_final-bezie = t_tvm1t-bezie.
        ENDIF.
    **********************modification additioon of chapter ID  30.04.2007
        READ TABLE t_j_1imtchid WITH KEY matnr = t_vbrp-matnr BINARY SEARCH.
        IF sy-subrc = 0.
          t_final-j_1ichid = t_j_1imtchid-j_1ichid.
        ENDIF.
        READ TABLE t_j_1iexchdr WITH KEY rdoc = t_vbrp-vbeln
                                         werks = t_vbrp-werks
                                         BINARY SEARCH.
        IF sy-subrc = 0.
          t_final-exnum = t_j_1iexchdr-exnum.
          t_final-exdat = t_j_1iexchdr-exdat.
          t_final-rdoc  = t_j_1iexchdr-rdoc.
          t_final-werks = t_j_1iexchdr-werks.
        ENDIF.
    **************end of modification additioon of chapter ID  30.04.2007
        "******** START OF MODIFICATION KALIKA 26.07.2007.
        READ TABLE it_mseg INTO wa_mseg WITH KEY ebeln  = t_vbrp-aubel.
        IF sy-subrc = 0.
          t_final-mblnr = wa_mseg-mblnr.
        ENDIF.
        "INTO wa_mkpf
        READ TABLE it_mkpf WITH KEY mblnr  = t_final-mblnr
                                    tcode2 = 'MIGO_GR'.
        IF sy-subrc = 0.
          t_final-budat = it_mkpf-budat.
        ENDIF.
        APPEND t_final.
        CLEAR t_final.
      ENDLOOP.
      DELETE t_final[]   WHERE flag = 'A' OR flag = ''. "change by amit for reverse deliveries as rkp.
      DELETE t_final     WHERE fkdat = ' ' .
      DELETE t_final[]   WHERE kunag NOT IN recv_pnt.
      DELETE t_final[]   WHERE vstel NOT IN supp_pnt.
      DELETE t_final[]   WHERE fkart = 'JEX' AND exnum = ' '. " CHANGE BY KALIKA
      " FOR INVOICE WHOSE EXCISE NOT MAINTAINED
      IF t_final[] IS INITIAL.
        MESSAGE i002(zamit).
        LEAVE LIST-PROCESSING.
      ENDIF.
    *---------------MARM CALCULATION
      SORT t_marm BY matnr meinh.
      DELETE t_marm WHERE meinh = 'M2'.
      SORT t_marm BY matnr.
      LOOP AT t_final.
        READ TABLE t_marm WITH KEY matnr = t_final-matnr." T_MARM-MEINH <> 'M2'.
        t_final-bom = ( t_marm-umrez / t_marm-umren ).
        MODIFY t_final TRANSPORTING bom.
        t_final-mult = t_final-bom * t_final-fkimg.
        MODIFY t_final TRANSPORTING mult.
        CLEAR t_final.
      ENDLOOP.
    *--------------------delivery no.
    *-------------------beginning of adding na*******
      LOOP AT t_final.
        " *** change by kalika
        IF t_final-matkl EQ  'BWGRBBD'
      OR t_final-matkl = 'BWGRBPD'
      OR t_final-matkl = 'BWGRCLB'
      OR t_final-matkl = 'BWGRCMD'
      OR t_final-matkl = 'BWGRGFB'
      OR t_final-matkl = 'BWGRGFC'
      OR t_final-matkl = 'BWGRGFO'
      OR t_final-matkl = 'GRNLAM'
      OR t_final-matkl = 'DVNRTKBB'
      OR t_final-matkl = 'MRETBBD'
      OR t_final-matkl = 'MRGRBBD'
      OR t_final-matkl = 'MRGRCMD'
      OR t_final-matkl = 'MRRBBD'
      OR t_final-matkl = 'PLAMGBSD'
      OR t_final-matkl = 'BWETBBD'
      OR t_final-matkl = 'PLAMGOSD'.
    *  "LOOP AT t_final WHERE matkl = 'BWGRBBD'
    *OR matkl = 'BWGRBPD'
    *OR matkl = 'BWGRCLB'
    *OR matkl = 'BWGRCMD'
    *OR matkl = 'BWGRGFB'
    *OR matkl = 'BWGRGFC'
    *OR matkl = 'BWGRGFO'
    *OR matkl = 'GRNLAM'
    *OR matkl = 'DVNRTKBB'
    *OR matkl = 'MRETBBD'
    *OR matkl = 'MRGRBBD'
    *OR matkl = 'MRGRCMD'
    *OR matkl = 'MRRBBD'
    *OR matkl = 'PLAMGBSD'
    *OR matkl = 'BWETBBD'
    *OR matkl = 'PLAMGOSD'.
    *** change by kalika
          t_final-area =  ( t_final-size *  15 ) / 10 .
          MODIFY t_final TRANSPORTING area.
        ELSE.
          t_final-area = ( t_final-normt * t_final-size ) / 4.   "t_final-bom
          MODIFY t_final TRANSPORTING area.
        ENDIF.
      ENDLOOP.
      "*** change by kalika
      " ** start Division Specific FA & NA to be displayed by kalika
      LOOP AT t_final.
        IF t_final-spart = 'LM' .
          t_final-area = space.
        ENDIF.
        IF t_final-spart  = 'DD'.
          t_final-area = space.
        ENDIF.
        MODIFY t_final.
      ENDLOOP.
    * " ** end Division Specific FA & NA to be displayed by kalika
    *  LOOP AT t_final WHERE matkl = 'BWETPLY'
    *  OR matkl = 'BWGRCHQ'
    * OR matkl = 'BWGRCLP'
    * OR matkl = 'BWGRCMG'
    * OR matkl = 'BWGRFLX'
    * OR matkl = 'BWGRFRP'
    * OR matkl = 'BWGRGCP'
    * OR matkl = 'BWGRPCT'
    * OR matkl = 'BWGRPLY'
    * OR matkl = 'BWGRSHT'
    * OR matkl = 'MRGRPLY'
    * OR matkl = 'MRTPLY'.
    *    t_final-area = ( t_final-normt * t_final-bom ) / 4.
    *    MODIFY t_final.
    *  ENDLOOP.
    *-------------------ending of adding na**********
    ENDFORM.                                            " move_data.
    *                    data_fetching                            *
    FORM data_fetching.
    *------ASSESSIBLE VALUE
      SORT t_final BY knumv.
      SORT t_konv BY knumv kposn.
      CLEAR t_final.
      CLEAR t_konv.
      LOOP AT t_konv.
        IF t_konv-kschl = 'ZR02'.
          READ TABLE t_final WITH KEY knumv = t_konv-knumv posnr = t_konv-kposn.
          t_final-kwert1 = t_konv-kwert.
          t_final-kbetr = t_konv-kbetr.
          IF sy-tabix <> 0.
            MODIFY t_final  INDEX sy-tabix TRANSPORTING kwert1 kbetr.
            CLEAR t_final.
            CLEAR t_konv.
          ENDIF.
        ENDIF.
    *-----EXICESE
        IF t_konv-kschl = 'JEXP'.
          READ TABLE t_final WITH KEY knumv = t_konv-knumv posnr = t_konv-kposn.
          t_final-kwert2 = t_konv-kwert.
          IF sy-tabix <> 0.
            MODIFY t_final  INDEX sy-tabix TRANSPORTING kwert2.
            CLEAR t_final.
            CLEAR t_konv.
          ENDIF.
        ENDIF.
    *-------CESS
        IF t_konv-kschl = 'JECS'.
          READ TABLE t_final WITH KEY knumv = t_konv-knumv posnr = t_konv-kposn.
          t_final-kwert3 = t_konv-kwert.
          IF sy-tabix <> 0.
            MODIFY t_final  INDEX sy-tabix TRANSPORTING kwert3.
            CLEAR t_final.
            CLEAR t_konv.
          ENDIF.
        ENDIF.
    *-----ROUNDING
        IF t_konv-kschl = 'DIFF'.
          READ TABLE t_final WITH KEY knumv = t_konv-knumv posnr = t_konv-kposn.
          t_final-kwert4 = t_konv-kwert.
          IF sy-tabix <> 0.
            MODIFY t_final  INDEX sy-tabix TRANSPORTING kwert4.
            CLEAR t_final.
            CLEAR t_konv.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ****************TOTAL OF ALL VALUES
      LOOP AT t_final.
        t_final-total = t_final-kwert1 + t_final-kwert2 + t_final-kwert3 + t_final-kwert4.
        MODIFY t_final INDEX sy-tabix TRANSPORTING total .
        CLEAR t_final.
      ENDLOOP.
    *--------------delivery calculation.
      " start change by kalika
      DELETE t_final WHERE total = ' '. " BY KALIKA
      " end change by kalika
      LOOP AT t_final.
        t_temp-vbeln_k = t_final-vbeln_k.
        t_temp-vgbel = t_final-vgbel.
        t_temp-fkart = t_final-fkart.
        t_temp-kunag = t_final-kunag.
        APPEND t_temp.
        CLEAR t_temp.
      ENDLOOP.
      SORT t_temp DESCENDING BY vbeln_k  .
      SORT t_temp BY vgbel.
      LOOP AT t_final.
        READ TABLE t_temp WITH KEY vgbel = t_final-vgbel.
        t_final-vbeln_k = t_temp-vbeln_k.
    *---change by amit for validating migi date by amit
        if t_final-budat = 0.
          t_final-mblnr = ''.
          endif.
    *---change by amit for validating migi date by amit
        MODIFY t_final TRANSPORTING vbeln_k  mblnr.
        CLEAR t_final.
      ENDLOOP.
      " start KALIKA 30.06.2007.
      "SORT t_final STABLE DESCENDING by  fkart fkdat. "plz kalika do not forbid stable even it doent any effect this case but in future when large amount of data in production it will works.
      SORT t_final STABLE ASCENDING BY  fkart fkdat. "plz kalika do not forbid stable even it doent any effect this case but in future when large amount of data in production it will works.
      DATA: l_tabix TYPE sy-tabix.           " declare the sy-tabix as local variable
      DATA: l_lines TYPE sy-tabix.
      DATA: l_index TYPE sy-tabix.
      DESCRIBE TABLE t_final LINES  l_lines .       "The current number of table rows of the internal table itab is determined and is assigned to the data object lin
      CHECK l_lines > 1.                               " check lines are greater than 1
      LOOP AT t_final WHERE fkart = 'F8'.
        l_tabix = sy-tabix.                              " assine Index of Internal Tables into local var l_tabix
        l_index = l_tabix + 1.
        READ TABLE t_final INTO wa_sfinal1 INDEX l_index.  " read the temp table with index l_index
        IF sy-subrc = 0.
          CHECK t_final-vgbel = wa_sfinal1-vgbel AND t_final-knumv NE wa_sfinal1-knumv.
          IF sy-subrc =  0.
            t_final-w_flag = 'X'.
            MODIFY t_final TRANSPORTING w_flag.
          ENDIF.
        ENDIF.
      ENDLOOP.
      "DELETE ADJACENT DUPLICATES FROM t_final[] COMPARING fkart
      DELETE t_final[] WHERE w_flag = 'X'.
      " end KALIKA 30.06.2007.
    *--change by amit for performa invoice deletion
      DELETE t_final[] WHERE aedat = 0.
    ENDFORM.                                                  " sub_CAL
    *                       FORM ALV GET DATA FOR NOTIONAL AREA      *
    FORM alv_get_data .
      CLEAR it_fieldcat.
    ***************** SUPPLYING PLANT
    *  wa_fieldcat-col_pos    = '1'.                    " ALV O/P COL-1
      wa_fieldcat-fieldname  = 'VSTEL'.
      wa_fieldcat-seltext_m  = 'SUPPLYING PLANT'.
      wa_fieldcat-just       = 'L'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      wa_fieldcat-tabname    = 'T_FINAL'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ***************** SUPPLYING PLANT
    *  wa_fieldcat-col_pos    = '2'.                    " ALV O/P COL-1
      wa_fieldcat-fieldname  = 'NAME1'.
      wa_fieldcat-seltext_m  = 'SUPP PLANT DESCRTN'.
      wa_fieldcat-just       = 'L'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 20.
      wa_fieldcat-tabname    = 'T_FINAL'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ******************** RECEIVING PLANT
    *  wa_fieldcat-col_pos    = '3'.                     " ALV O/P COL-2
      wa_fieldcat-fieldname  = 'KUNAG'.
      wa_fieldcat-seltext_m  = 'RECEIVING PLANT'.
      wa_fieldcat-just       = 'L'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ******************** RECEIVING PLANT
    *  wa_fieldcat-col_pos    = '4'.                     " ALV O/P COL-2
      wa_fieldcat-fieldname  = 'NAME21'.
      wa_fieldcat-seltext_m  = 'RECE PLNT DESCRTN'.
      wa_fieldcat-just       = 'L'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ***************** BILL NUMBER
    *  wa_fieldcat-col_pos    = '5'.                     " ALV O/P COL-3
      wa_fieldcat-fieldname  = 'VBELN_K'.
      wa_fieldcat-seltext_m  = 'BILL NUMBER'.
      wa_fieldcat-just       = 'L'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    *******************BILL DATE
    *  wa_fieldcat-col_pos    = '6'.                     " ALV O/P COL-4
      wa_fieldcat-fieldname  = 'FKDAT'.
      wa_fieldcat-seltext_m  = 'BILL DATE'.
      wa_fieldcat-just       = 'L'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    *********** OUT BOUND DELIVERY NO
    *  wa_fieldcat-col_pos    = '7'.                     " ALV O/P COL-5
      wa_fieldcat-fieldname  = 'VGBEL'.
      wa_fieldcat-seltext_m  = 'OUT BOUND DELIVERY NO'.
      wa_fieldcat-just       = 'L'.
    * wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    *********** OUT BOUND DELIVERY DATE
    **  wa_fieldcat-col_pos    = '8'.                     " ALV O/P COL-6
    *  wa_fieldcat-fieldname  = 'LFDAT'.
    *  wa_fieldcat-seltext_m  = 'OUT BOUND DELIVERY DATE'.
    *  wa_fieldcat-just       = 'L'.
    *  wa_fieldcat-tabname    = 'T_FINAL'.
    *  wa_fieldcat-outputlen  = 15.
    *  APPEND wa_fieldcat TO it_fieldcat.
    *  CLEAR wa_fieldcat.
      " *  wa_fieldcat-col_pos    = '8'.                     " ALV O/P COL-6
      wa_fieldcat-fieldname  = 'BLDAT'.
      wa_fieldcat-seltext_m  = 'DELIVERY DOC DATE'.  " NEW CHANGE
      wa_fieldcat-just       = 'L'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ************* S.T.O. NO.
    *  wa_fieldcat-col_pos    = '9'.                     " ALV O/P COL-6
      wa_fieldcat-fieldname  = 'AUBEL'.
      wa_fieldcat-seltext_m  = 'S.T.O. NO.'.
      wa_fieldcat-just       = 'L'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    *********** S.T.O. DATE
    *  wa_fieldcat-col_pos    = '10'.                     " ALV O/P COL-6
      wa_fieldcat-fieldname  = 'AEDAT'.
      wa_fieldcat-seltext_m  = 'S.T.O. DATE'.
      wa_fieldcat-just       = 'L'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ************ DIVISION
    *  wa_fieldcat-col_pos    = '11'.                     " ALV O/P COL-7
      wa_fieldcat-fieldname  = 'SPART'.
      wa_fieldcat-seltext_m  = 'DIVISION'.
      wa_fieldcat-just       = 'L'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ********** MATERIAL CODE
    *  wa_fieldcat-col_pos    = '12'.                     " ALV O/P COL-9
      wa_fieldcat-fieldname  = 'MATNR'.
      wa_fieldcat-seltext_m  = 'MATERIAL CODE'.
      wa_fieldcat-just       = 'L'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-outputlen  = 20.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ************ DESCRIPTION
    *  wa_fieldcat-col_pos    = '13'.                     " ALV O/P COL-10
      wa_fieldcat-fieldname  = 'ARKTX'.
      wa_fieldcat-seltext_m  = 'DESCRIPTION'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    **************MATERIAL TYPE
    *  wa_fieldcat-col_pos    = '14'.                     " ALV O/P COL-11
      wa_fieldcat-fieldname  = 'MTART'.
      wa_fieldcat-seltext_m  = 'MATERIAL TYPE'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ************MATERIAL GROUP
    *  wa_fieldcat-col_pos    = '15'.                     " ALV O/P COL-13
      wa_fieldcat-fieldname  = 'MATKL'.
      wa_fieldcat-seltext_m  = 'MATERIAL GROUP'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    *******************modification additioon of chapter ID  30.04.2007
    ******************chapterID
    *  wa_fieldcat-col_pos    = '32'.                  " ALV O/P COL-27'.
      wa_fieldcat-fieldname  = 'J_1ICHID'.
      wa_fieldcat-seltext_m  = 'CHAPTER-ID'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    *  wa_fieldcat-col_pos    = '33'.                  " ALV O/P COL-27'.
      wa_fieldcat-fieldname  = 'EXNUM'.
      wa_fieldcat-seltext_m  = 'EXCISE DOC.NO.'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    *  wa_fieldcat-col_pos    = '34'.                  " ALV O/P COL-27'.
      wa_fieldcat-fieldname  = 'EXDAT'.
      wa_fieldcat-seltext_m  = 'EXCISE DOC.DATE'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ***************end of modification additioon of chapter ID  30.04.2007
    *********SUB GROUP
    *  wa_fieldcat-col_pos    = '16'.                     " ALV O/P COL-13
      wa_fieldcat-fieldname  = 'MVGR1'.
      wa_fieldcat-seltext_m  = 'SUB GROUP'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    *  wa_fieldcat-col_pos    = '16'.                     " ALV O/P COL-13
      wa_fieldcat-fieldname  = 'BEZIE'.
      wa_fieldcat-seltext_m  = 'SUB GROUP DISCRP'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ***************GROUP DISCRIPTION
    *  wa_fieldcat-col_pos    = '17'.                     " ALV O/P COL-14
      wa_fieldcat-fieldname  = 'WGBEZ'.
      wa_fieldcat-seltext_m  = 'GROUP DISCRIPTION'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    *****************FINISH
    *  wa_fieldcat-col_pos    = '18'.                     " ALV O/P COL-15
      wa_fieldcat-fieldname  = 'WRKST'.
      wa_fieldcat-seltext_m  = 'FINISH'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    *****************sale u o m
    *  wa_fieldcat-col_pos    = '19'.                     " ALV O/P COL-15
      wa_fieldcat-fieldname  = 'VRKME'.
      wa_fieldcat-seltext_m  = 'SALE U O M'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    *****************BASE u o m
    *  wa_fieldcat-col_pos    = '19'.                     " ALV O/P COL-15
      wa_fieldcat-fieldname  = 'MEINS'.
      wa_fieldcat-seltext_m  = 'BASE U O M'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    **************DESIGN NO.
    *  wa_fieldcat-col_pos    = '20'.                     " ALV O/P COL-17
      wa_fieldcat-fieldname  = 'EXTWG'.
      wa_fieldcat-seltext_m  = 'DESIGN NO.'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    *****************CATEGORY
    *  wa_fieldcat-col_pos    = '21'.                     " ALV O/P COL-18
      wa_fieldcat-fieldname  = 'LABOR'.
      wa_fieldcat-seltext_m  = 'CATEGORY'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    **************THICKNESS
    *  wa_fieldcat-col_pos    = '22'.                     " ALV O/P COL-19.
      wa_fieldcat-fieldname  = 'NORMT'.
      wa_fieldcat-seltext_m  = 'THICKNESS'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    **************SIZE
    *  wa_fieldcat-col_pos    = '23'.                      " ALV O/P COL-20.
      wa_fieldcat-fieldname  = 'BISMT'.
      wa_fieldcat-seltext_m  = 'SIZE'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ****************BILLED QTY
    *  wa_fieldcat-col_pos    = '24'.                    " ALV O/P COL-21.
      wa_fieldcat-fieldname  = 'FKIMG'.
      wa_fieldcat-seltext_m  = 'BILLED QTY'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    **************RETE
    *  wa_fieldcat-col_pos    = '26'.                    " ALV O/P COL-21.
      wa_fieldcat-fieldname  = 'BOM'.
      wa_fieldcat-seltext_m  = 'CONVERSION RATE'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ******************MULT
    *  wa_fieldcat-col_pos    = '32'.                  " ALV O/P COL-27'.
      wa_fieldcat-fieldname  = 'MULT'.
      wa_fieldcat-seltext_m  = 'BILLED QTY IN BUM'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    **************RETE
    *  wa_fieldcat-col_pos    = '25'.                    " ALV O/P COL-21.
      wa_fieldcat-fieldname  = 'KBETR'.
      wa_fieldcat-seltext_m  = 'RATE / BASE UOM'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    **************ASSESSIBLE VALUE
    *  wa_fieldcat-col_pos     = '27'.                    " ALV O/P COL-22.
      wa_fieldcat-fieldname   = 'KWERT1'.
      wa_fieldcat-seltext_m   = 'ASSESSIBLE VALUE'.
      wa_fieldcat-tabname     = 'T_FINAL'.
      wa_fieldcat-just        = 'R'.
      wa_fieldcat-no_zero(1)  = 'X'.
      wa_fieldcat-outputlen   = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ****************EXCISE
    *  wa_fieldcat-col_pos    = '28'.                     " ALV O/P COL-23.
      wa_fieldcat-fieldname  = 'KWERT2'.
      wa_fieldcat-seltext_m  = 'EXCISE'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    *****************CESS
    *  wa_fieldcat-col_pos    = '29'.                      " ALV O/P COL-24.
      wa_fieldcat-fieldname  = 'KWERT3'.
      wa_fieldcat-seltext_m  = 'CESS'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ******************ROUNDING
    *  wa_fieldcat-col_pos    = '30'.                    " ALV O/P COL-26.
      wa_fieldcat-fieldname  = 'KWERT4'.
      wa_fieldcat-seltext_m  = 'ROUNDING'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ******************TOTAL
    *  wa_fieldcat-col_pos    = '31'.                  " ALV O/P COL-27'.
      wa_fieldcat-fieldname  = 'TOTAL'.
      wa_fieldcat-seltext_m  = 'TOTAL'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname  = 'AREA'.
      wa_fieldcat-seltext_m  = 'NA'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname  = 'MBLNR'.
      wa_fieldcat-seltext_m  = 'MIGO NO'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname  = 'BUDAT'.
      wa_fieldcat-seltext_m  = 'MIGO DATE'.
      wa_fieldcat-just       = 'R'.
      wa_fieldcat-tabname    = 'T_FINAL'.
      wa_fieldcat-no_zero(1) = 'X'.
      wa_fieldcat-outputlen  = 15.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ENDFORM.                                                       " ALV_GET_DATA
    *                            FORM ALV_GRID                                  *
    FORM alv_grid .
      PERFORM fill_list_header USING it_top_of_page[].
      PERFORM event-build USING gt_events[].
      PERFORM fill_layout USING ls_layout.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          is_layout          = ls_layout
          it_fieldcat        = it_fieldcat
          it_events          = gt_events[]
          i_save             = 'A'
        TABLES
          t_outtab    

  • Regarding report for material status

    HI All,
    Can u guys pls help me thre is an error in the report
    which iam presenting now. The error is that iam getting
    the output for units in simple report is 'PC' and iam getting the out put for units in ALV as 'ST'.
    why, i need an immediate reply.
    *& Report  ZSTOCKDETAILS4                                              *
    REPORT  zstockdetails4         NO STANDARD PAGE HEADING
                                   LINE-SIZE 160
                                   LINE-COUNT 60(3).
                  tables declaration                 *
    TABLES : mara,        "general material data
             marc,        "plant data for material
             mard,        "storage location data for material
             makt.        "material description
    TYPE-POOLS : slis.
                 internal table declaration             *
    TYPES : BEGIN OF ty_mara,
            matnr TYPE matnr,
            mtart TYPE mtart,
            meins TYPE meins,
            END OF ty_mara.
    TYPES : BEGIN OF ty_marc,
            matnr TYPE matnr,
            werks TYPE werks,
            END OF ty_marc.
    TYPES : BEGIN OF ty_mard,
            matnr TYPE matnr,
            werks TYPE werks,
            lgort TYPE lgort_d,
            labst TYPE labst,
            END OF ty_mard.
    TYPES : BEGIN OF ty_makt,
            matnr TYPE matnr,
            maktx TYPE maktx,
            END OF ty_makt.
    DATA:t_mara TYPE TABLE OF ty_mara WITH HEADER LINE,
         t_marc TYPE TABLE OF ty_marc WITH HEADER LINE,
         t_mard TYPE TABLE OF ty_mard WITH HEADER LINE,
         t_makt TYPE TABLE OF ty_makt WITH HEADER LINE.
    PARAMETER : p_alv AS CHECKBOX DEFAULT 'X'.
                    final internal table                    *
    TYPES : BEGIN OF ty_out,
            matnr TYPE matnr,
            werks TYPE werks,
            lgort TYPE lgort_d,
            labst TYPE labst,
            meins TYPE meins,
            mtart TYPE mtart,
            maktx TYPE maktx,
            END OF ty_out.
    DATA:t_out TYPE TABLE OF ty_out WITH HEADER LINE.
                 DATA DECLARATION FOR ALV                          *
    DATA : fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
           gd_repid LIKE sy-repid,
           gd_layout TYPE slis_layout_alv,
           gd_tab_group TYPE slis_t_sp_group_alv,
           gt_list_top_of_page TYPE slis_t_listheader,
           it_sortcat TYPE slis_sortinfo_alv OCCURS 1,
           wa_sort LIKE LINE OF it_sortcat.
                  selection screen                                 *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_werks FOR marc-werks OBLIGATORY,
                     s_matnr FOR mara-matnr,
                     s_mtart FOR mara-mtart,
                     s_lgort FOR mard-lgort.
    SELECTION-SCREEN END OF BLOCK b1.
                 start-of-selection                                 *
    START-OF-SELECTION.
      SELECT matnr mtart meins
                  FROM mara
                    INTO TABLE t_mara
                     WHERE matnr IN s_matnr
                     AND mtart IN s_mtart.
      SORT t_mara BY matnr.
      SELECT matnr werks
                  FROM marc
                  INTO TABLE t_marc
                  FOR ALL ENTRIES IN t_mara
                  WHERE matnr = t_mara-matnr
                  AND werks IN s_werks.
      SORT t_marc BY matnr.
      SELECT matnr  lgort labst
                FROM mard
                INTO CORRESPONDING FIELDS OF TABLE t_mard
                FOR ALL ENTRIES IN t_mara
                WHERE matnr = t_mara-matnr
                AND lgort IN s_lgort.
      SORT t_mard BY matnr.
      LOOP AT t_mara.
        READ TABLE t_marc WITH KEY matnr = t_mara-matnr BINARY SEARCH.
       READ TABLE t_mard WITH KEY matnr = t_mara-matnr BINARY SEARCH.
        MOVE : t_mara-matnr TO t_out-matnr.
        MOVE : t_mara-mtart TO t_out-mtart.
        MOVE : t_mara-meins TO t_out-meins.
        MOVE : t_marc-werks TO t_out-werks.
       MOVE : t_mard-lgort TO t_out-lgort.
       MOVE : t_mard-labst TO t_out-labst.
        SELECT SINGLE matnr maktx
                    FROM makt
                    INTO CORRESPONDING FIELDS OF makt
                    WHERE matnr = t_mara-matnr.
        MOVE-CORRESPONDING makt TO t_out.
        LOOP AT t_mard WHERE matnr = t_mara-matnr.
          MOVE : t_mard-lgort TO t_out-lgort.
          MOVE : t_mard-labst TO t_out-labst.
          APPEND t_out.
          CLEAR : t_out-lgort, t_out-labst.
        ENDLOOP.
        CLEAR t_out.
      ENDLOOP.
      SORT t_out BY werks lgort matnr.
      IF
      p_alv = 'X'.
        PERFORM build_fieldcatalog.
        PERFORM display_alv_report.
      ELSE.
        DATA: tot_lgort TYPE labst,
        tot_werks TYPE labst,
        tot TYPE labst.
        LOOP AT t_out.
          NEW-LINE.
          WRITE :/ sy-vline,  t_out-matnr,
                  15 t_out-werks,
                  35 t_out-lgort,
                  45 t_out-labst,
                  85 t_out-meins,
                 100 t_out-mtart,
                 120 t_out-maktx,160 sy-vline.
          tot_lgort = tot_lgort + t_out-labst.
          tot_werks = tot_werks + t_out-labst.
          tot = tot + t_out-labst.
          AT LAST.
            ULINE.
            WRITE : / 'THE GRAND TAOTAL IS', 52 tot.
          ENDAT.
        ENDLOOP.
      ENDIF.
                           TOP-OF-PAGE                            *
    TOP-OF-PAGE.
      ULINE.
      WRITE : sy-vline, 'MATERIAL',
              15 'PLANT',
              32 'STOR LOC',
              56 'STOCK',
              80 'UNITS',
              95 'MAT TYPE',
             115 'MAT DESCR',160 sy-vline.
      ULINE.
    *&      Form  build_fieldcatalog
          text
    FORM build_fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname  =  'WERKS'.
      fieldcatalog-seltext_m  =  'Plant'.
      fieldcatalog-col_pos    =  1.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname =  'LGORT'.
      fieldcatalog-seltext_m  =  'Storage Location'.
      fieldcatalog-col_pos    =  2.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname =  'LABST'.
      fieldcatalog-seltext_m  =  'Stock'.
      fieldcatalog-col_pos    =  3.
      fieldcatalog-outputlen  =  15.
      fieldcatalog-do_sum     =  'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname =  'MEINS'.
      fieldcatalog-seltext_m  =  'Unit of Measure'.
      fieldcatalog-col_pos    =  4.
    fieldcatalog-datatype   =  'PC'.
    fieldcatalog-reptext_ddic  = 'Unit of Measure'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname =  'MTART'.
      fieldcatalog-seltext_m  =  'Material Type'.
      fieldcatalog-col_pos    =  5.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname =  'MAKTX'.
      fieldcatalog-seltext_m  =  'Material Description'.
      fieldcatalog-col_pos    =  6.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
    ENDFORM.                      "build_fieldcatalog
    *&      Form  display_alv_report
          text
    FORM display_alv_report.
      gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        I_INTERFACE_CHECK                 = ' '
        I_BYPASSING_BUFFER                = ' '
        I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = gd_repid
        I_CALLBACK_PF_STATUS_SET          = ' '
        I_CALLBACK_USER_COMMAND           = ' '
         i_callback_top_of_page            = 'TOP-OF-PAGE'
        I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
        I_CALLBACK_HTML_END_OF_LIST       = ' '
        I_STRUCTURE_NAME                  =
        I_BACKGROUND_ID                   = ' '
        I_GRID_TITLE                      =
        I_GRID_SETTINGS                   =
         is_layout                         = gd_layout
         it_fieldcat                       = fieldcatalog[]
        IT_EXCLUDING                      =
        IT_SPECIAL_GROUPS                 =
         it_sort                           = it_sortcat
        IT_FILTER                         =
        IS_SEL_HIDE                       =
        I_DEFAULT                         = 'X'
        I_SAVE                            = ' '
        IS_VARIANT                        =
        IT_EVENTS                         =
        IT_EVENT_EXIT                     =
        IS_PRINT                          =
        IS_REPREP_ID                      =
        I_SCREEN_START_COLUMN             = 0
        I_SCREEN_START_LINE               = 0
        I_SCREEN_END_COLUMN               = 0
        I_SCREEN_END_LINE                 = 0
        IT_ALV_GRAPHICS                   =
        IT_HYPERLINK                      =
        IT_ADD_FIELDCAT                   =
        IT_EXCEPT_QINFO                   =
        I_HTML_HEIGHT_TOP                 =
        I_HTML_HEIGHT_END                 =
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER           =
        ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = t_out
       EXCEPTIONS
         program_error                     = 1
         OTHERS                            = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "display_alv_report

    Hi Sai,
    Please do the following:
    While populating the fileld catalog for "MEINS".
    <u>
    add the shown code in bold:</u>
    fieldcatalog-fieldname = 'MEINS'.
    fieldcatalog-seltext_m = 'Unit of Measure'.
    <b>fieldcatalog-CFIELDNAME = 'MEINS'.
    fieldcatalog-CTABNAME = 'MARA'</b>.
    fieldcatalog-col_pos = 4.
    fieldcatalog-datatype = 'PC'.
    fieldcatalog-reptext_ddic = 'Unit of Measure'.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    This will bring you "EA" in place of ST.
    Hope this will work for you.
    Lanka

  • SAP Report for Material purchased from Vendors

    Can anyone tell me if there is a report in SAP that we can use to list all suppliers for a given material?   We are operating in SAP ECC6.0 and need a report that will list all  vendors that the company has used for a given part.   Is there a standard report in SAP that pulls information from purchasing info records?
    Also does anybody know of any SAP consultants that can help us create custom reports?
    Edited by: TonyMart on Oct 20, 2011 2:46 PM
    Edited by: TonyMart on Oct 20, 2011 2:47 PM

    Hi,
         There is not standard report for ageing... You have to develop a custom one if you are talking in terms of GR/IR...
    Raghav

  • Need detailed report for Material wise cost components??

    HI
    I can only view one material at a time for the ck80_99 cost component report. Is there a way to view more materials from the same report. we have a option to give multiple material numbers but its not executing the report at that point, it first display all the materials with the costing variant when we further execute the reprt it is generating for only one material. Please help me on its urgent.
    If standard report is not available, can we go customized report for this?
    Thanks,

    HI Siva,
    Thanks for quick reply. Yeah, in S_ALR_87013047 i can compare only two materials. but i am looking for a report for group of materials for forecasting. Can we create acustomised report for this.
    Please let me know.
    Thanks
    vamshi

Maybe you are looking for

  • How to take last months date to current month date

    Hi, I am designing a report wherein the data should range from 12:01am on the 28th day of the previous month to 11:59 pm on the 27th of the current month..  Also this report would be scheduled accordingly and I should  not be able to modify the repor

  • Unsupported image format after moving from one project to another

    I scanned several thousands of images to my Aperture library. Went thru all of them providing adjustments to many of them, keywords to all of them and adjust date/time to all of them. All of the pics were visible, format is jpeg. This is a managed li

  • Add to iPhoto removes file name

    Apple Mail - It's great that we now have the return of the "Add to iPhoto" link for image attachments However, when using this function Mail renames the file as IMAGE, IMAGE-1, IMAGE-2 etc etc in the metadata.  This creates an issue where iPhoto is t

  • Query - Download as CSV file

    Hi, By using Query (SQ01), we are able to download data in Excel format, Text format, etc. But... is there an option that I can download in CSV format. Thanks..... Rgds, Kian

  • Individual versus Company listing for Apps

    I noticed that some apps have the developer's actual name and other apps have the company's name listed.  What is the benefit to listing as an individual as opposed to listing as a company?