Vendor Scorecard Performance Report

The Vendor Scorecard Performance Report data is based on dates entered in the PO (dates provided by the vendor to us at the time we cut the PO or even months after the PO is cut-this date can change) as opposed to our expected lead time (lead time promised by the vendor in general).We always need to put the vendor's advised date in the PO so that our back-order reports have the correct ETA info. Currently, the report will show the vendor as having an almost perfect record because our expected receipt date is based on the vendor's production schedule (whether it is within our expected lead time or not).
We need some kind of indicator in the vendor set up which tells the system that the expected delivery date is "out of tolerance". Is there any way to achieve this and have the report based on expected lead time as opposed to PO dates?
Could somebody please help me to achieve this...?

No database version? No example tables and data? No attempt to solve this yourself?
Please provide the necessary details as mentioned in the SQL and PL/SQL FAQ:
{message:id=9360002}

Similar Messages

  • Vendor Evaluation/performance report

    We need a report that shows vendor delivery performance. We wanna do that report by comparing GR date with Delivery date including delivery quantity between a specified time interval(for example september.2007). Report must check if supplier sends the parts on time.If supplier send parts, for example 4 days early, then system must find it comparing delivery date with actual good receipt date.And also order quantity must be compared with delivered quantity.This analysis must be done for schedule lines and POs all together.

    Dear Gopala Turaga,
    Actually, we are looking for standard SAP transactions if we can make use of like MCE3, MC$8 and MC$6. What I concluded from those transactions that MC$& and MC$8 can cover our requirements, but resulting quantities and deviations are not meaningful. For example, for any supplier I know that deliveries are on time with 3 days delays however report yields totally different results. Do you any other transations other than MC$8 ,MC$6 and MCE3,MCE7,MCE8, etc...? second question is how to customize tolerances at related transactions?
    The KPI Supplier-On Time Delivery Performance is the comparison of the required delivery date in the purchase order/schedule line to the actual goods receipt entry date per supplier. For the calculation of the Supplier-On Time Delivery Performance the delivery tolerances are respected.

  • Vendor Payment Performance Report

    Hi,
    I am in the process of developing a report which should show details of Project, Service orders and purchase orders information. If end user inputs project/SO/PO/Vendor in the selection screen of the report, they are expected to see service orders and their related costs information. In the drill down they would like to see related Purchase orders information of the service orders including PO Quantity, PO Value, Invoiced Quanity, Invoice value, Invoice creation date, Invoice posting date, Invoice due date(Invoice date + Vendor Payment terms), Actual payment date to Vendor, Blocked invoices, Reason for blocking, Vendor info. Is there any Business Content reports, cubes, extractors availabe to serve my purpose ?  If this requirement can't be developed in one report please suggest what is the best way of doing.
    Eg of Report Result data:
    Selection screen can have Project, Service Order, PO, Vendor, Year & Month
    Report Results:
    Project     SO         PlannedCost
    WBS1      1001      5000 GBP        
    (5000 GBP contains 2000 GBP spent on labour cost + 3000 GBP spent on material which will  be paid to different vendors)
    If we drill down using Purchase Order it should show PO details for 3000 GBP and show blank for 2000 GBP
    Project    SO        PO     POValue   InvoiceValue    IVdate   IVPaiddate    IVDuedate    Vendor
    WBS1     1001    2000   -
    WBS1     1001    P123   1000          1000               1.8.09     16.8.09       15.8.09         CP
    WBS1     1001    P234      500           500               15.7.09    15.8.09      15.8.09         BP
    With the above info 100% ontime payment made to vendor BP, for CP it is not, Customer is interested to see this level of information.
    For 3000 GBP , for  all the purchase orders we need to show PO Quantity, PO Value, Invoiced Quanity, Invoice value, Invoice creation date, Invoice posting date, Invoice due date(Invoice date + Payment terms), Actual invoice payment date, Blocked invoices, Reason for blocking, Vendor info details
    Waiting for experts suggestions on the above requirement.

    Hi,
    You can create a report on this, but first have to findout in which all the tables your fields existing. Based on this you can build a report in r/3 or a FM which you can use it in Generic DS.
    Hev you gone thru standard Purchase DS which available in r/3 side. Just check them it might suits your requirement.
    also check the below docu for more info:
    http://help.sap.com/saphelp_470/helpdata/en/75/ee1fa755c811d189900000e8322d00/frameset.htm
    Reg
    Pra

  • Vendor performance report

    hai
    how to create an vendor performance report which display purchase order issued to a vendor, material supplied delivery times, payment terms, prices during a period of time.
        for this report what are the tables and fields we have to use pls give me sample report..
                  thank you..

    Hi,
    Against the RFQ's vendor submit quotations and the Based on the RFQ's data we have to compare the different Vendors with the respective data like terms and prices
    Fetch the data of all RFQ's from EKKO and EKPO tables
    and take the EKKO-KNUMV field and pass to KONV table and fetch the different prices based on the Condition types  for each RFQ and put it in a tabular format  and compare.
    see the sample code
    *& Report  ZRFQ_COMP
    *& Quotation Comparison Report
    REPORT  ZRFQ_COMP no standard page heading line-size 187 line-count 35.
    *&Tables
    Tables : ekko,
             ekpo,
             konp,
             a016.
    *&Data Decleration
    Data : v_pos type i value 19.
    Data : begin of it_rfq occurs 0,
            ebeln type ekko-ebeln,
            ekorg type ekko-ekorg,
            lifnr type ekko-lifnr,
            matnr type ekpo-matnr,
            WERKS type ekpo-WERKS,
           end of it_rfq.
    Data : begin of it_a016 occurs 0,
            ebeln type ekko-ebeln,
            knumh type knumh,
           end of it_a016.
    Data : begin of it_a363 occurs 0,
            werks type werks,
            lifnr type lifnr,
            matnr type matnr,
            knumh type knumh,
           end of it_a363.
    Data : begin of it_pr_details occurs 0,
            knumh type knumh,
            kschl type kschl,
            kbetr type kwert,
           end of it_pr_details.
    Data : begin of it_final occurs 0,
            ebeln type ebeln,
            lifnr type lifnr,
            name1 type lfa1-name1,
            pb00  type kbetr,
            zpac  type kbetr,
            zb00  type kbetr,
            ZIN1  type kbetr,
            JEC1  type kbetr,
            JHX1  type kbetr,
            JMOP  type kbetr,
            JMX1  type kbetr,
            JMX3  type kbetr,
            JSEP  TYPE KBETR,
            JVRD  type kbetr,
           end of it_final.
    Data : begin of it_vendorname occurs 0,
            lifnr type lifnr,
            name1 type lfa1-name1,
           end of it_vendorname.
    *&Selection Screen
    Selection-screen: begin of block blk1 with frame title text-001.
      parameters     : p_matnr like ekpo-matnr obligatory.
      select-options : s_ebeln for ekko-ebeln,
                       s_ekorg for ekko-ekorg,
                       s_lifnr for ekko-lifnr.
    Selection-screen: end of block blk1.
    *&Start-of-Selection.
    Start-of-selection.
      Select ekko~ebeln
             ekko~ekorg
             ekko~lifnr
             ekpo~matnr
             ekpo~werks
        into table it_rfq
        from ekko
       inner join ekpo
          on ekkoebeln eq ekpoebeln
        where ekko~ebeln in s_ebeln
          and ekko~ekorg in s_ekorg
          and ekko~lifnr in s_lifnr
          and ekpo~matnr eq p_matnr
          and ekko~bstyp eq 'A'.
      if sy-subrc eq 0.
    *--> Condition number from A tables.
      Perform get_connum.
    *--> Getting the Pricing Details from Konp Table.
      Perform get_prices.
    *--> Populate Vendor Name.
      Perform pop_vendor_name.
    *--> Populating the Final Internal table for Report.
      Perform pop_final_tab.
      else.
       message 'Purchase Document does not exist' type 'E'.
      endif.
    *&End-of-Selection.
    End-of-Selection.
    write :/ sy-vline,
           2 'Vendor Number',
           19 sy-vline.
    v_pos = 19.
    loop at it_final.
      write at v_pos sy-vline.
      v_pos = v_pos + 1.
      write at v_pos it_final-lifnr.
      v_pos = v_pos + 35.
    endloop.
    write at: v_pos sy-vline,
              /(v_pos) sy-uline.
    write :/ sy-vline,
           2 'Gross Price',
           19 sy-vline.
    v_pos = 19.
    loop at it_final.
      write at v_pos sy-vline.
      v_pos = v_pos + 20.
      write at v_pos it_final-pb00.
      v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
              /(v_pos) sy-uline.
    write :/ sy-vline,
           2 'Packing & Forward',
           19 sy-vline.
    v_pos = 19.
    loop at it_final.
      write at v_pos sy-vline.
      v_pos = v_pos + 20.
      write at v_pos it_final-zpac.
      v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
              /(v_pos) sy-uline.
    write :/ sy-vline,
           2 'Surcharge',
           19 sy-vline.
    v_pos = 19.
    loop at it_final.
      write at v_pos sy-vline.
      v_pos = v_pos + 20.
      write at v_pos it_final-zb00.
      v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
              /(v_pos) sy-uline.
    write :/ sy-vline,
           2 'Installation',
           19 sy-vline.
    v_pos = 19.
    loop at it_final.
      write at v_pos sy-vline.
      v_pos = v_pos + 20.
      write at v_pos it_final-zin1.
      v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
              /(v_pos) sy-uline.
    write :/ sy-vline,
           2 'Ed cess on BED%',
           19 sy-vline.
    v_pos = 19.
    loop at it_final.
      write at v_pos sy-vline.
      v_pos = v_pos + 20.
      write at v_pos it_final-jec1.
      v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
              /(v_pos) sy-uline.
    write :/ sy-vline,
           2 'A/P Secess set off',
           19 sy-vline.
    v_pos = 19.
    loop at it_final.
      write at v_pos sy-vline.
      v_pos = v_pos + 20.
      write at v_pos it_final-jhx1.
      v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
              /(v_pos) sy-uline.
    write :/ sy-vline,
           2 'Basic Excise Duty',
           19 sy-vline.
    v_pos = 19.
    loop at it_final.
      write at v_pos sy-vline.
      v_pos = v_pos + 20.
      write at v_pos it_final-zpac.
      v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
              /(v_pos) sy-uline.
    write :/ sy-vline,
           2 'A/P BED set off',
           19 sy-vline.
    v_pos = 19.
    loop at it_final.
      write at v_pos sy-vline.
      v_pos = v_pos + 20.
      write at v_pos it_final-jmx1.
      v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
              /(v_pos) sy-uline.
    write :/ sy-vline,
           2 'Ecess % set off',
           19 sy-vline.
    v_pos = 19.
    loop at it_final.
      write at v_pos sy-vline.
      v_pos = v_pos + 20.
      write at v_pos it_final-jmx3.
      v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
              /(v_pos) sy-uline.
    write :/ sy-vline,
           2 'Sec ED Cess on BED',
           19 sy-vline.
    v_pos = 19.
    loop at it_final.
      write at v_pos sy-vline.
      v_pos = v_pos + 20.
      write at v_pos it_final-jsep.
      v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
              /(v_pos) sy-uline.
    write :/ sy-vline,
           2 'VAT%',
           19 sy-vline.
    v_pos = 19.
    loop at it_final.
      write at v_pos sy-vline.
      v_pos = v_pos + 20.
      write at v_pos it_final-jvrd.
      v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
              /(v_pos) sy-uline.
    *&Top-of-Page.
    Top-of-Page.
    format color 1.
    Write: 'Material Number :' color 1, p_matnr color 1.
    loop at it_final.
      v_pos = v_pos + 1.
      v_pos = v_pos + 35.
    endloop.
    write at: /(v_pos) sy-uline,/ sy-vline,2 'Vendor Name'.
    v_pos = 19.
    loop at it_final.
      write at v_pos sy-vline.
      v_pos = v_pos + 1.
      write at v_pos it_final-name1.
      v_pos = v_pos + 35.
    endloop.
    write at: v_pos sy-vline,
              /(v_pos) sy-uline.
    *&      Form  get_connum
          Condition number from A tables
    form get_connum .
        Select EVRTN
               knumh
          from a016
          into table it_a016
           for all entries in it_rfq
         where EVRTN eq it_rfq-ebeln.
        Select werks
               lifnr
               matnr
               knumh
          from a363
          into table it_a363
           for all entries in it_rfq
         where werks eq it_rfq-werks
           and lifnr eq it_rfq-lifnr
           and matnr eq it_rfq-matnr.
    endform.                    " get_connum
    *&      Form  get_prices
          Getting the Pricing Details from Konp Table.
    form get_prices .
      if not it_a016[] is initial.
        select knumh
               kschl
               kbetr
          from konp
          into table it_pr_details
           for all entries in it_a016
         where knumh eq it_a016-knumh.
      endif.
      if not it_a363[] is initial.
        select knumh
               kschl
               kbetr
          from konp
    appending table it_pr_details
           for all entries in it_a016
         where knumh eq it_a016-knumh.
      endif.
    endform.                    " get_prices
    *&      Form  pop_final_tab
          Populating the Final Internal table for Report
    form pop_final_tab .
    data : l_subrc like sy-subrc.
      sort it_a016 by ebeln.
      loop at it_rfq.
        clear l_subrc.
        read table it_a016 with key ebeln = it_rfq-ebeln
        binary search.
        if sy-subrc eq 0.
          loop at it_pr_details where knumh eq it_a016-knumh.
            it_final-ebeln = it_rfq-ebeln.
            it_final-lifnr = it_rfq-lifnr.
            read table it_vendorname with
            key lifnr = it_rfq-lifnr.
            it_final-name1 = it_vendorname-name1.
            case it_pr_details-kschl.
            when 'PBOO'.
              it_final-pb00 = it_pr_details-kbetr.
              if it_pr_details-kbetr eq 0.
               clear it_final.
               continue.
              endif.
            when 'ZPAC'.
              it_final-zpac = it_pr_details-kbetr.
            when 'ZB00'.
              it_final-ZB00 = it_pr_details-kbetr.
            when 'ZIN1'.
              it_final-ZIN1 = it_pr_details-kbetr.
            endcase.
          endloop.
        else.
          l_subrc = sy-subrc.
        endif.
        read table it_a363 with key lifnr = it_rfq-lifnr
                                    werks = it_rfq-werks
                                    matnr = it_rfq-matnr.
        if sy-subrc eq 0.
          loop at it_pr_details where knumh eq it_a016-knumh.
            it_final-ebeln = it_rfq-ebeln.
            it_final-lifnr = it_rfq-lifnr.
            read table it_vendorname with
            key lifnr = it_rfq-lifnr.
            it_final-name1 = it_vendorname-name1.
            case it_pr_details-kschl.
            when 'JEC1'.
              it_final-JEC1 = it_pr_details-kbetr.
            when 'JHX1'.
              it_final-JHX1 = it_pr_details-kbetr.
            when 'JMOP'.
              it_final-JMOP = it_pr_details-kbetr.
            when 'JMX1'.
              it_final-JMX1 = it_pr_details-kbetr.
            when 'JMX3'.
              it_final-JMX3 = it_pr_details-kbetr.
            when 'JSEP'.
              it_final-JSEP = it_pr_details-kbetr.
            when 'JVRD'.
              it_final-JVRD = it_pr_details-kbetr.
            endcase.
          endloop.
        elseif l_subrc ne 0.
       continue.
        endif.
        append it_final.
        clear  it_final.
      endloop.
    endform.                    " pop_final_tab
    *&      Form  pop_vendor_name
          Populate Vendor Name
    form pop_vendor_name .
      if not it_rfq[] is initial.
      Select lifnr
             name1
        from lfa1
        into table it_vendorname
       where lifnr eq it_rfq-lifnr.
      endif.
    endform.                    " pop_vendor_name
    Reward points if useful
    Regards
    Anji

  • What are the main tables using in vendor performance report.

    what are the main tables using in vendor performance report.
    how many select statements are in ABAP reports.

    Refer the links -
    vendor performance report !!!
    vendor performance report
    vendor performance report
    I need standard vendor performance report
    Regards,
    Amit
    Reward all helpful replies.

  • Functiona Spec For VENDOR PERFORMANCE REPORT

    Hi experts
    I need to develope a VENDOR PERFORMANCE REPORT. But due to some reason i cant be able to get the Functional Specification for that object. So could you please help me by sending  the above mention functional Specification.
    thnaks and regadrs
    Pratik

    Pratik,
    Bad question in ABAP forum.
    can you please close this thread and put it into MM forum for quick reply.
    Amit.

  • What is vendor performance report what are the fields using in the report

    What is vendor performance report what are the fields using in the report and i need some sample reports for that particular topic (clasical report)not using any alvs or any advance topics.
    U R Satish Patnaik

    hi
    good
    *"Table declarations...................................................
    TABLES:
    EKKO, " Purchasing Document Header
    CDHDR, " Change document header
    SSCRFIELDS. " Fields on selection screens
    *"Selection screen elements............................................
    SELECT-OPTIONS:
    S_EBELN FOR EKKO-EBELN, " Purchasing Document Number
    S_LIFNR FOR EKKO-LIFNR, " Vendor's account number
    S_EKGRP FOR EKKO-EKGRP, " Purchasing group
    S_BEDAT FOR EKKO-BEDAT, " Purchasing Document Date
    S_UDATE FOR CDHDR-UDATE. " Creation date of the change
    " document
    *" Data declarations...................................................
    Field String to hold Purchase Document Number *
    DATA:
    BEGIN OF FS_EBELN,
    EBELN(90) TYPE C, " Purchase Document Number
    ERNAM TYPE EKKO-ERNAM, " Name of Person who Created
    " the Object
    LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    EKGRP TYPE EKKO-EKGRP, " Purchasing group
    BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
    END OF FS_EBELN,
    Field String to hold Purchase Document Header *
    BEGIN OF FS_EKKO,
    EBELN TYPE EKKO-EBELN, " Purchasing Document Number
    ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
    " Object
    LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    EKGRP TYPE EKKO-EKGRP, " Purchasing group
    BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
    END OF FS_EKKO,
    Field String to hold Account Number and name of the Vendor *
    BEGIN OF FS_LFA1,
    LIFNR TYPE LFA1-LIFNR, " Account Number of Vendor
    NAME1 TYPE LFA1-NAME1, " Name1
    END OF FS_LFA1,
    Field String to hold Change date and the name of the user *
    BEGIN OF FS_CDHDR,
    OBJECTCLAS TYPE CDHDR-OBJECTCLAS, " Object Class
    OBJECTID TYPE CDHDR-OBJECTID, " Object value
    CHANGENR TYPE CDHDR-CHANGENR, " Document change number
    USERNAME TYPE CDHDR-USERNAME, " User name
    UDATE TYPE CDHDR-UDATE, " Creation date of the change
    " document
    END OF FS_CDHDR,
    Field String to hold Change document items *
    BEGIN OF FS_CDPOS,
    OBJECTCLAS TYPE CDPOS-OBJECTCLAS," Object class
    OBJECTID(10) TYPE C, " Object Value
    CHANGENR TYPE CDPOS-CHANGENR, " Document change number
    TABNAME TYPE CDPOS-TABNAME, " Table Name
    FNAME TYPE CDPOS-FNAME, " Field Name
    VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
    VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
    END OF FS_CDPOS,
    Field String to hold Date Element Name *
    BEGIN OF FS_DATAELE,
    TABNAME TYPE DD03L-TABNAME, " Table Name
    FIELDNAME TYPE DD03L-FIELDNAME, " Field Name
    ROLLNAME TYPE DD03L-ROLLNAME, " Data element (semantic domain)
    END OF FS_DATAELE,
    Field String to hold Short Text of the Date Element *
    BEGIN OF FS_TEXT,
    ROLLNAME TYPE DD04T-ROLLNAME, " Data element (semantic domain)
    DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
    " Repository Objects
    END OF FS_TEXT,
    Field String to hold data to be displayed on the ALV grid *
    BEGIN OF FS_OUTTAB,
    EBELN TYPE EKKO-EBELN, " Purchasing Document Number
    ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
    " Object
    LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    EKGRP TYPE EKKO-EKGRP, " Purchasing group
    BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
    WERKS TYPE LFA1-WERKS, " Plant
    NAME1 TYPE LFA1-NAME1, " Name1
    USERNAME TYPE CDHDR-USERNAME, " User name
    UDATE TYPE CDHDR-UDATE, " Creation date of the change
    " document
    DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
    " Repository Objects
    VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
    VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
    END OF FS_OUTTAB,
    Internal table to hold Purchase Document Number *
    T_EBELN LIKE STANDARD TABLE
    OF FS_EBELN,
    Internal table to hold Purchase Document Header *
    T_EKKO LIKE STANDARD TABLE
    OF FS_EKKO,
    Temp Internal table to hold Purchase Document Header *
    T_EKKO_TEMP LIKE STANDARD TABLE
    OF FS_EKKO,
    Internal table to hold Account number and Name of the Vendor *
    T_LFA1 LIKE STANDARD TABLE
    OF FS_LFA1,
    Internal Table to hold Change date and the name of the user *
    T_CDHDR LIKE STANDARD TABLE
    OF FS_CDHDR,
    Internal Table to hold Change document items *
    T_CDPOS LIKE STANDARD TABLE
    OF FS_CDPOS,
    Temp. Internal Table to hold Change document items *
    T_CDPOS_TEMP LIKE STANDARD TABLE
    OF FS_CDPOS,
    Internal Table to hold Data Element Name *
    T_DATAELE LIKE STANDARD TABLE
    OF FS_DATAELE,
    Temp. Internal Table to hold Data Element Name *
    T_DATAELE_TEMP LIKE STANDARD TABLE
    OF FS_DATAELE,
    Internal Table to hold Short Text of the Date Element *
    T_TEXT LIKE STANDARD TABLE
    OF FS_TEXT,
    Internal Table to hold data to be displayed on the ALV grid *
    T_OUTTAB LIKE STANDARD TABLE
    OF FS_OUTTAB.
    C L A S S D E F I N I T I O N *
    CLASS LCL_EVENT_HANDLER DEFINITION DEFERRED.
    *" Data declarations...................................................
    Work variables *
    DATA:
    W_EBELN TYPE EKKO-EBELN, " Purchasing Document Number
    W_LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    W_EKGRP TYPE EKKO-EKGRP, " Purchasing group
    W_VALUE TYPE EKKO-EBELN, " Reflected Value
    W_SPACE VALUE ' ', " Space
    W_FLAG TYPE I, " Flag Variable
    W_VARIANT TYPE DISVARIANT, " Variant
    *--- ALV Grid
    W_GRID TYPE REF TO CL_GUI_ALV_GRID,
    *--- Event Handler
    W_EVENT_CLICK TYPE REF TO LCL_EVENT_HANDLER,
    *--- Field catalog table
    T_FIELDCAT TYPE LVC_T_FCAT.
    AT SELECTION-SCREEN EVENT *
    AT SELECTION-SCREEN ON S_EBELN.
    Subroutine to validate Purchase Document Number.
    PERFORM VALIDATE_PD_NUM.
    AT SELECTION-SCREEN ON S_LIFNR.
    Subroutine to validate Vendor Number.
    PERFORM VALIDATE_VEN_NUM.
    AT SELECTION-SCREEN ON S_EKGRP.
    Subroutine to validate Purchase Group.
    PERFORM VALIDATE_PUR_GRP.
    START-OF-SELECTION EVENT *
    START-OF-SELECTION.
    Subroutine to select all Purchase orders.
    PERFORM SELECT_PO.
    CHECK W_FLAG EQ 0.
    Subroutine to select Object values.
    PERFORM SELECT_OBJ_ID.
    CHECK W_FLAG EQ 0.
    Subroutine to select Changed values.
    PERFORM SELECT_CHANGED_VALUE.
    CHECK W_FLAG EQ 0.
    Subroutine to Select Purchase Orders.
    PERFORM SELECT_PUR_DOC.
    Subroutine to select Vendor Details.
    PERFORM SELECT_VENDOR.
    Subroutine to select Text for the Changed values.
    PERFORM DESCRIPTION.
    END-OF-SELECTION EVENT *
    END-OF-SELECTION.
    IF NOT T_EKKO IS INITIAL.
    Subroutine to populate the Output Table.
    PERFORM FILL_OUTTAB.
    Subroutine to build Field Catalog.
    PERFORM PREPARE_FIELD_CATALOG CHANGING T_FIELDCAT.
    CALL SCREEN 100.
    ENDIF. " IF NOT T_EKKO...
    CLASS LCL_EVENT_HANDLER DEFINITION
    Defining Class which handles events
    CLASS LCL_EVENT_HANDLER DEFINITION .
    PUBLIC SECTION .
    METHODS:
    HANDLE_HOTSPOT_CLICK
    FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
    IMPORTING E_ROW_ID E_COLUMN_ID.
    ENDCLASS. " LCL_EVENT_HANDLER DEFINITION
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION
    Implementing the Class which can handle events
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION .
    *---Handle Double Click
    METHOD HANDLE_HOTSPOT_CLICK .
    Subroutine to get the HotSpot Cell information.
    PERFORM GET_CELL_INFO.
    SET PARAMETER ID 'BES' FIELD W_VALUE.
    CALL TRANSACTION 'ME23N'.
    ENDMETHOD. " HANDLE_HOTSPOT_CLICK
    ENDCLASS. " LCL_EVENT_HANDLER
    *& Module STATUS_0100 OUTPUT
    PBO Event
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'OOPS'.
    SET TITLEBAR 'TIT'.
    Subroutine to fill the Variant Structure
    PERFORM FILL_VARIANT.
    IF W_GRID IS INITIAL.
    CREATE OBJECT W_GRID
    EXPORTING
    I_SHELLSTYLE = 0
    I_LIFETIME =
    I_PARENT = CL_GUI_CONTAINER=>SCREEN0
    I_APPL_EVENTS =
    I_PARENTDBG =
    I_APPLOGPARENT =
    I_GRAPHICSPARENT =
    I_NAME =
    I_FCAT_COMPLETE = SPACE
    EXCEPTIONS
    ERROR_CNTL_CREATE = 1
    ERROR_CNTL_INIT = 2
    ERROR_CNTL_LINK = 3
    ERROR_DP_CREATE = 4
    OTHERS = 5.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF. " IF SY-SUBRC <> 0
    CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT = W_VARIANT
    I_SAVE = 'A'
    I_DEFAULT = 'X'
    IS_LAYOUT =
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    IR_SALV_ADAPTER =
    CHANGING
    IT_OUTTAB = T_OUTTAB
    IT_FIELDCATALOG = T_FIELDCAT
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    INVALID_PARAMETER_COMBINATION = 1
    PROGRAM_ERROR = 2
    TOO_MANY_LINES = 3
    OTHERS = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF. " IF SY-SUBRC <> 0.
    ENDIF. " IF W_GRID IS INITIAL
    CREATE OBJECT W_EVENT_CLICK.
    SET HANDLER W_EVENT_CLICK->HANDLE_HOTSPOT_CLICK FOR W_GRID.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    PAI Event
    MODULE USER_COMMAND_0100 INPUT.
    CASE SY-UCOMM.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    WHEN 'CANCEL'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Form PREPARE_FIELD_CATALOG
    Subroutine to build the Field catalog
    <--P_T_FIELDCAT Field Catalog Table
    FORM PREPARE_FIELD_CATALOG CHANGING PT_FIELDCAT TYPE LVC_T_FCAT .
    DATA LS_FCAT TYPE LVC_S_FCAT.
    Purchasing group...
    LS_FCAT-FIELDNAME = 'EKGRP'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Purchasing Document Number...
    LS_FCAT-FIELDNAME = 'EBELN'.
    LS_FCAT-REF_TABLE = 'EKKO' .
    LS_FCAT-EMPHASIZE = 'C411'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-HOTSPOT = 'X'.
    APPEND LS_FCAT TO PT_FIELDCAT .
    CLEAR LS_FCAT .
    Name of Person who Created the Object...
    LS_FCAT-FIELDNAME = 'ERNAM'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-OUTPUTLEN = '15' .
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Purchasing Document Date...
    LS_FCAT-FIELDNAME = 'BEDAT'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Vendor's account number...
    LS_FCAT-FIELDNAME = 'LIFNR'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Account Number of Vendor or Creditor...
    LS_FCAT-FIELDNAME = 'NAME1'.
    LS_FCAT-REF_TABLE = 'LFA1'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-COLTEXT = 'Vendor Name'(001).
    LS_FCAT-SELTEXT = 'Vendor Name'(001).
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Creation date of the change document...
    LS_FCAT-FIELDNAME = 'UDATE'.
    LS_FCAT-REF_TABLE = 'CDHDR'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-COLTEXT = 'Change Date'(002).
    LS_FCAT-SELTEXT = 'Change Date'(002).
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    User name of the person responsible in change document...
    LS_FCAT-FIELDNAME = 'USERNAME'.
    LS_FCAT-REF_TABLE = 'CDHDR'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-COLTEXT = 'Modified by'(003).
    LS_FCAT-SELTEXT = 'Modified by'(003).
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Short Text Describing R/3 Repository Objects...
    LS_FCAT-FIELDNAME = 'DDTEXT'.
    LS_FCAT-REF_TABLE = 'DD04T'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '15'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Old contents of changed field...
    LS_FCAT-FIELDNAME = 'VALUE_OLD'.
    LS_FCAT-REF_TABLE = 'CDPOS'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '12'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    New contents of changed field...
    LS_FCAT-FIELDNAME = 'VALUE_NEW'.
    LS_FCAT-REF_TABLE = 'CDPOS'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '12'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    ENDFORM. " PREPARE_FIELD_CATALOG
    *& Form SELECT_PO
    Subroutine to select all the Purchase Orders
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_PO .
    SELECT EBELN " Purchasing Document Number
    ERNAM " Name of Person who Created
    " the Object
    LIFNR " Vendor's account number
    EKGRP " Purchasing group
    BEDAT " Purchasing Document Date
    FROM EKKO
    PACKAGE SIZE 10000
    APPENDING TABLE T_EBELN
    WHERE EBELN IN S_EBELN
    AND BEDAT IN S_BEDAT.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    W_FLAG = 1.
    MESSAGE S401(M8).
    ENDIF. " IF SY-SUBRC NE 0
    ENDFORM. " SELECT_PO
    *& Form SELECT_OBJ_ID
    Subroutine to select Object ID
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_OBJ_ID .
    IF NOT T_EBELN IS INITIAL.
    SELECT OBJECTCLAS " Object Class
    OBJECTID " Object value
    CHANGENR " Document change number
    USERNAME " User name
    UDATE " Creation date
    FROM CDHDR
    INTO TABLE T_CDHDR
    FOR ALL ENTRIES IN T_EBELN
    WHERE OBJECTID EQ T_EBELN-EBELN
    AND UDATE IN S_UDATE
    AND TCODE IN ('ME21N','ME22N','ME23N').
    ENDSELECT.
    IF SY-SUBRC NE 0.
    W_FLAG = 1.
    MESSAGE S833(M8) WITH 'Header Not Found'(031).
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_EBELN IS INITIAL
    ENDFORM. " SELECT_OBJ_ID
    *& Form SELECT_CHANGED_VALUE
    Subroutine to select Changed Values
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_CHANGED_VALUE .
    IF NOT T_CDHDR IS INITIAL.
    SELECT OBJECTCLAS " Object class
    OBJECTID " Object value
    CHANGENR " Document change number
    TABNAME " Table Name
    FNAME " Field Name
    VALUE_NEW " New contents of changed field
    VALUE_OLD " Old contents of changed field
    FROM CDPOS
    PACKAGE SIZE 10000
    APPENDING TABLE T_CDPOS
    FOR ALL ENTRIES IN T_CDHDR
    WHERE OBJECTCLAS EQ T_CDHDR-OBJECTCLAS
    AND OBJECTID EQ T_CDHDR-OBJECTID
    AND CHANGENR EQ T_CDHDR-CHANGENR.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    W_FLAG = 1.
    MESSAGE S833(M8) WITH 'Item Not Found'(032).
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_CDHDR IS INITIAL
    T_CDPOS_TEMP[] = T_CDPOS[].
    ENDFORM. " SELECT_CHANGED_VALUE
    *& Form SELECT_PUR_DOC
    Subroutine to select Purchase Order Details
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_PUR_DOC .
    IF NOT T_CDPOS IS INITIAL.
    SORT T_EBELN BY EBELN.
    LOOP AT T_CDPOS INTO FS_CDPOS.
    READ TABLE T_EBELN INTO FS_EBELN WITH KEY EBELN =
    FS_CDPOS-OBJECTID BINARY SEARCH.
    IF SY-SUBRC NE 0.
    DELETE TABLE T_EBELN FROM FS_EBELN.
    ENDIF. " IF SY-SUBRC NE 0.
    ENDLOOP. " LOOP AT T_CDPOS...
    LOOP AT T_EBELN INTO FS_EBELN.
    MOVE FS_EBELN-EBELN TO FS_EKKO-EBELN.
    MOVE FS_EBELN-ERNAM TO FS_EKKO-ERNAM.
    MOVE FS_EBELN-LIFNR TO FS_EKKO-LIFNR.
    MOVE FS_EBELN-EKGRP TO FS_EKKO-EKGRP.
    MOVE FS_EBELN-BEDAT TO FS_EKKO-BEDAT.
    APPEND FS_EKKO TO T_EKKO.
    ENDLOOP. " LOOP AT T_EBELN...
    T_EKKO_TEMP[] = T_EKKO[].
    ENDIF. " IF NOT T_CDPOS IS INITIAL
    ENDFORM. " SELECT_PUR_DOC
    *& Form SELECT_VENDOR
    Subroutine to select Vendor details
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_VENDOR .
    IF NOT T_EKKO IS INITIAL.
    SORT T_EKKO_TEMP BY LIFNR.
    DELETE ADJACENT DUPLICATES FROM T_EKKO_TEMP COMPARING LIFNR.
    SELECT LIFNR " Account Number of Vendor or
    " Creditor
    NAME1 " Name 1
    FROM LFA1
    INTO TABLE T_LFA1
    FOR ALL ENTRIES IN T_EKKO_TEMP
    WHERE LIFNR EQ T_EKKO_TEMP-LIFNR.
    IF SY-SUBRC NE 0.
    MESSAGE S002(M8) WITH 'Master Details'(033).
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_EKKO IS INITIAL
    ENDFORM. " SELECT_VENDOR
    *& Form DESCRIPTION
    Subroutine to get the description
    There are no interface parameters to be passed to this subroutine.
    FORM DESCRIPTION .
    IF NOT T_CDPOS IS INITIAL.
    SORT T_CDPOS_TEMP BY TABNAME FNAME.
    DELETE ADJACENT DUPLICATES FROM T_CDPOS_TEMP COMPARING TABNAME FNAME
    SELECT TABNAME " Table Name
    FIELDNAME " Field Name
    ROLLNAME " Data element
    FROM DD03L
    INTO TABLE T_DATAELE
    FOR ALL ENTRIES IN T_CDPOS_TEMP
    WHERE TABNAME EQ T_CDPOS_TEMP-TABNAME
    AND FIELDNAME EQ T_CDPOS_TEMP-FNAME.
    IF NOT T_DATAELE IS INITIAL.
    T_DATAELE_TEMP[] = T_DATAELE[].
    SORT T_DATAELE_TEMP BY ROLLNAME.
    DELETE ADJACENT DUPLICATES FROM T_DATAELE_TEMP COMPARING ROLLNAME.
    SELECT ROLLNAME " Data element
    DDTEXT " Short Text Describing R/3
    " Repository Objects
    FROM DD04T
    INTO TABLE T_TEXT
    FOR ALL ENTRIES IN T_DATAELE_TEMP
    WHERE ROLLNAME EQ T_DATAELE_TEMP-ROLLNAME
    AND DDLANGUAGE EQ SY-LANGU.
    IF SY-SUBRC NE 0.
    EXIT.
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_DATAELE IS INITIAL.
    ENDIF. " IF NOT T_CDPOS IS INITIAL.
    ENDFORM. " DESCRIPTION
    *& Form FILL_OUTTAB
    Subroutine to populate the Outtab
    There are no interface parameters to be passed to this subroutine.
    FORM FILL_OUTTAB .
    SORT T_CDHDR BY OBJECTCLAS OBJECTID CHANGENR.
    SORT T_EKKO BY EBELN.
    SORT T_LFA1 BY LIFNR.
    SORT T_DATAELE BY TABNAME FIELDNAME.
    SORT T_TEXT BY ROLLNAME.
    LOOP AT T_CDPOS INTO FS_CDPOS.
    READ TABLE T_CDHDR INTO FS_CDHDR WITH KEY
    OBJECTCLAS = FS_CDPOS-OBJECTCLAS
    OBJECTID = FS_CDPOS-OBJECTID
    CHANGENR = FS_CDPOS-CHANGENR
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_CDHDR-USERNAME TO FS_OUTTAB-USERNAME.
    MOVE FS_CDHDR-UDATE TO FS_OUTTAB-UDATE.
    READ TABLE T_EKKO INTO FS_EKKO WITH KEY
    EBELN = FS_CDHDR-OBJECTID
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_EKKO-EBELN TO FS_OUTTAB-EBELN.
    MOVE FS_EKKO-ERNAM TO FS_OUTTAB-ERNAM.
    MOVE FS_EKKO-LIFNR TO FS_OUTTAB-LIFNR.
    MOVE FS_EKKO-EKGRP TO FS_OUTTAB-EKGRP.
    MOVE FS_EKKO-BEDAT TO FS_OUTTAB-BEDAT.
    READ TABLE T_LFA1 INTO FS_LFA1 WITH KEY
    LIFNR = FS_EKKO-LIFNR
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_LFA1-NAME1 TO FS_OUTTAB-NAME1.
    ENDIF. " IF SY-SUBRC EQ 0.
    ENDIF. " IF SY-SUBRC EQ 0.
    ENDIF. " IF SY-SUBRC EQ 0.
    MOVE FS_CDPOS-VALUE_NEW TO FS_OUTTAB-VALUE_NEW.
    MOVE FS_CDPOS-VALUE_OLD TO FS_OUTTAB-VALUE_OLD.
    READ TABLE T_DATAELE INTO FS_DATAELE WITH KEY
    TABNAME = FS_CDPOS-TABNAME
    FIELDNAME = FS_CDPOS-FNAME
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    READ TABLE T_TEXT INTO FS_TEXT WITH KEY
    ROLLNAME = FS_DATAELE-ROLLNAME
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_TEXT-DDTEXT TO FS_OUTTAB-DDTEXT.
    ENDIF. " IF SY-SUBRC EQ 0.
    ENDIF. " IF SY-SUBRC EQ 0.
    APPEND FS_OUTTAB TO T_OUTTAB.
    CLEAR FS_OUTTAB.
    ENDLOOP.
    ENDFORM. " FILL_OUTTAB
    *& Form GET_CELL_INFO
    Subroutine to get the Cell Information
    --> W_VALUE Holds the value of Hotspot clicked
    FORM GET_CELL_INFO .
    CALL METHOD W_GRID->GET_CURRENT_CELL
    IMPORTING
    E_ROW =
    E_VALUE = W_VALUE
    E_COL =
    ES_ROW_ID =
    ES_COL_ID =
    ES_ROW_NO =
    ENDFORM. " GET_CELL_INFO
    *& Form VALIDATE_PD_NUM
    Subroutine to validate Purchase Document Number
    There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_PD_NUM .
    IF NOT S_EBELN[] IS INITIAL.
    SELECT EBELN " Purchase Document Number
    FROM EKKO
    INTO W_EBELN
    UP TO 1 ROWS
    WHERE EBELN IN S_EBELN.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    CLEAR SSCRFIELDS-UCOMM.
    MESSAGE E717(M8).
    ENDIF. " IF SY-SUBRC NE 0
    ENDIF. " IF NOT S_EBELN[]...
    ENDFORM. " VALIDATE_PD_NUM
    *& Form VALIDATE_VEN_NUM
    Subroutine to validate Vendor Number
    There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_VEN_NUM .
    IF NOT S_LIFNR[] IS INITIAL.
    SELECT LIFNR " Vendor Number
    FROM LFA1
    INTO W_LIFNR
    UP TO 1 ROWS
    WHERE LIFNR IN S_LIFNR.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    CLEAR SSCRFIELDS-UCOMM.
    MESSAGE E002(M8) WITH W_SPACE.
    ENDIF. " IF SY-SUBRC NE 0
    ENDIF. " IF NOT S_LIFNR[]...
    ENDFORM. " VALIDATE_VEN_NUM
    *& Form VALIDATE_PUR_GRP
    Subroutine to validate the Purchase Group
    There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_PUR_GRP .
    IF NOT S_EKGRP[] IS INITIAL.
    SELECT EKGRP " Purchase Group
    FROM T024
    INTO W_EKGRP
    UP TO 1 ROWS
    WHERE EKGRP IN S_EKGRP.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    CLEAR SSCRFIELDS-UCOMM.
    MESSAGE E622(M8) WITH W_SPACE.
    ENDIF. " IF SY-SUBRC NE 0
    ENDIF. " IF NOT S_EKFRP[]...
    ENDFORM. " VALIDATE_PUR_GRP
    *& Form FILL_VARIANT
    Subroutine to fill the Variant Structure
    There are no interface parameters to be passed to this subroutine
    FORM FILL_VARIANT .
    Filling the Variant structure
    W_VARIANT-REPORT = SY-REPID.
    W_VARIANT-USERNAME = SY-UNAME.
    ENDFORM. " FILL_VARIANT
    reward point if helpful.
    thanks
    mrutyun^

  • Need Vendor performance report

    i want  Vendor performance report based on which you finalise the PO on a particular vendor?
    pls give the source code

    See this sample code
    *"Table declarations...................................................
    TABLES:
      EKKO,                                " Purchasing Document Header
      CDHDR,                               " Change document header
      SSCRFIELDS.                          " Fields on selection screens
    *"Selection screen elements............................................
    SELECT-OPTIONS:
      S_EBELN FOR EKKO-EBELN,              " Purchasing Document Number
      S_LIFNR FOR EKKO-LIFNR,              " Vendor's account number
      S_EKGRP FOR EKKO-EKGRP,              " Purchasing group
      S_BEDAT FOR EKKO-BEDAT,              " Purchasing Document Date
      S_UDATE FOR CDHDR-UDATE.             " Creation date of the change
                                           " document
    *" Data declarations...................................................
    Field String to hold Purchase Document Number                       *
    DATA:
      BEGIN OF FS_EBELN,
        EBELN(90) TYPE C,                  " Purchase Document Number
        ERNAM     TYPE EKKO-ERNAM,         " Name of Person who Created
                                           " the Object
        LIFNR     TYPE EKKO-LIFNR,         " Vendor's account number
        EKGRP     TYPE EKKO-EKGRP,         " Purchasing group
        BEDAT     TYPE EKKO-BEDAT,         " Purchasing Document Date
      END OF FS_EBELN,
    Field String to hold Purchase Document Header                       *
      BEGIN OF FS_EKKO,
        EBELN TYPE EKKO-EBELN,             " Purchasing Document Number
        ERNAM TYPE EKKO-ERNAM,             " Name of Person who Created the
                                           " Object
        LIFNR TYPE EKKO-LIFNR,             " Vendor's account number
        EKGRP TYPE EKKO-EKGRP,             " Purchasing group
        BEDAT TYPE EKKO-BEDAT,             " Purchasing Document Date
      END OF FS_EKKO,
    Field String to hold Account Number and name of the Vendor          *
      BEGIN OF FS_LFA1,
        LIFNR TYPE LFA1-LIFNR,             " Account Number of Vendor
        NAME1 TYPE LFA1-NAME1,             " Name1
      END OF FS_LFA1,
    Field String to hold Change date and the name of the user           *
      BEGIN OF FS_CDHDR,
        OBJECTCLAS TYPE CDHDR-OBJECTCLAS,  " Object Class
        OBJECTID   TYPE CDHDR-OBJECTID,    " Object value
        CHANGENR   TYPE CDHDR-CHANGENR,    " Document change number
        USERNAME   TYPE CDHDR-USERNAME,    " User name
        UDATE      TYPE CDHDR-UDATE,       " Creation date of the change
                                           " document
      END OF FS_CDHDR,
    Field String to hold Change document items                          *
      BEGIN OF FS_CDPOS,
        OBJECTCLAS   TYPE CDPOS-OBJECTCLAS," Object class
        OBJECTID(10) TYPE C,               " Object Value
        CHANGENR     TYPE CDPOS-CHANGENR,  " Document change number
        TABNAME      TYPE CDPOS-TABNAME,   " Table Name
        FNAME        TYPE CDPOS-FNAME,     " Field Name
        VALUE_NEW    TYPE CDPOS-VALUE_NEW, " New contents of changed field
        VALUE_OLD    TYPE CDPOS-VALUE_OLD, " Old contents of changed field
      END OF FS_CDPOS,
    Field String to hold Date Element Name                              *
      BEGIN OF FS_DATAELE,
        TABNAME   TYPE DD03L-TABNAME,      " Table Name
        FIELDNAME TYPE DD03L-FIELDNAME,    " Field Name
        ROLLNAME  TYPE DD03L-ROLLNAME,     " Data element (semantic domain)
      END OF FS_DATAELE,
    Field String to hold Short Text of the Date Element                 *
      BEGIN OF FS_TEXT,
        ROLLNAME TYPE DD04T-ROLLNAME,      " Data element (semantic domain)
        DDTEXT   TYPE DD04T-DDTEXT,        " Short Text Describing R/3
                                           " Repository Objects
      END OF FS_TEXT,
    Field String to hold data to be displayed on the ALV grid           *
      BEGIN OF FS_OUTTAB,
        EBELN      TYPE EKKO-EBELN,        " Purchasing Document Number
        ERNAM      TYPE EKKO-ERNAM,        " Name of Person who Created the
                                           " Object
        LIFNR      TYPE EKKO-LIFNR,        " Vendor's account number
        EKGRP      TYPE EKKO-EKGRP,        " Purchasing group
        BEDAT      TYPE EKKO-BEDAT,        " Purchasing Document Date
        WERKS      TYPE LFA1-WERKS,        " Plant
        NAME1      TYPE LFA1-NAME1,        " Name1
        USERNAME   TYPE CDHDR-USERNAME,    " User name
        UDATE      TYPE CDHDR-UDATE,       " Creation date of the change
                                           " document
        DDTEXT     TYPE DD04T-DDTEXT,      " Short Text Describing R/3
                                           " Repository Objects
        VALUE_NEW  TYPE CDPOS-VALUE_NEW,   " New contents of changed field
        VALUE_OLD  TYPE CDPOS-VALUE_OLD,   " Old contents of changed field
      END OF FS_OUTTAB,
    Internal table to hold Purchase Document Number                     *
      T_EBELN LIKE STANDARD TABLE
                OF FS_EBELN,
    Internal table to hold Purchase Document Header                     *
    T_EKKO LIKE STANDARD TABLE
              OF FS_EKKO,
    Temp Internal table to hold Purchase Document Header                *
    T_EKKO_TEMP LIKE STANDARD TABLE
                   OF FS_EKKO,
    Internal table to hold Account number and Name of the Vendor        *
      T_LFA1 LIKE STANDARD TABLE
               OF FS_LFA1,
    Internal Table to hold Change date and the name of the user         *
      T_CDHDR LIKE STANDARD TABLE
                OF FS_CDHDR,
    Internal Table to hold Change document items                        *
      T_CDPOS LIKE STANDARD TABLE
                OF FS_CDPOS,
    Temp. Internal Table to hold Change document items                  *
      T_CDPOS_TEMP LIKE STANDARD TABLE
                     OF FS_CDPOS,
    Internal Table to hold Data Element Name                            *
      T_DATAELE LIKE STANDARD TABLE
                  OF FS_DATAELE,
    Temp. Internal Table to hold Data Element Name                      *
      T_DATAELE_TEMP LIKE STANDARD TABLE
                       OF FS_DATAELE,
    Internal Table to hold Short Text of the Date Element               *
      T_TEXT LIKE STANDARD TABLE
               OF FS_TEXT,
    Internal Table to hold data to be displayed on the ALV grid         *
      T_OUTTAB LIKE STANDARD TABLE
                 OF FS_OUTTAB.
                   C L A S S   D E F I N I T I O N                      *
      CLASS LCL_EVENT_HANDLER  DEFINITION DEFERRED.
    *" Data declarations...................................................
    Work variables                                                      *
      DATA:
        W_EBELN       TYPE EKKO-EBELN,     " Purchasing Document Number
        W_LIFNR       TYPE EKKO-LIFNR,     " Vendor's account number
        W_EKGRP       TYPE EKKO-EKGRP,     " Purchasing group
        W_VALUE       TYPE EKKO-EBELN,     " Reflected Value
        W_SPACE       VALUE ' ',           " Space
        W_FLAG        TYPE I,              " Flag Variable
        W_VARIANT     TYPE DISVARIANT,     " Variant
    *--- ALV Grid
        W_GRID        TYPE REF TO CL_GUI_ALV_GRID,
    *--- Event Handler
        W_EVENT_CLICK TYPE REF TO LCL_EVENT_HANDLER,
    *--- Field catalog table
        T_FIELDCAT    TYPE LVC_T_FCAT.
                          AT SELECTION-SCREEN EVENT                     *
    AT SELECTION-SCREEN ON S_EBELN.
    Subroutine to validate Purchase Document Number.
      PERFORM VALIDATE_PD_NUM.
    AT SELECTION-SCREEN ON S_LIFNR.
    Subroutine to validate Vendor Number.
      PERFORM VALIDATE_VEN_NUM.
    AT SELECTION-SCREEN ON S_EKGRP.
    Subroutine to validate Purchase Group.
      PERFORM VALIDATE_PUR_GRP.
                          START-OF-SELECTION EVENT                      *
    START-OF-SELECTION.
    Subroutine to select all Purchase orders.
      PERFORM SELECT_PO.
      CHECK W_FLAG EQ 0.
    Subroutine to select Object values.
        PERFORM SELECT_OBJ_ID.
      CHECK W_FLAG EQ 0.
    Subroutine to select Changed values.
        PERFORM SELECT_CHANGED_VALUE.
      CHECK W_FLAG EQ 0.
    Subroutine to Select Purchase Orders.
        PERFORM SELECT_PUR_DOC.
    Subroutine to select Vendor Details.
        PERFORM SELECT_VENDOR.
    Subroutine to select Text for the Changed values.
        PERFORM DESCRIPTION.
                          END-OF-SELECTION EVENT                        *
    END-OF-SELECTION.
      IF NOT T_EKKO IS INITIAL.
    Subroutine to populate the Output Table.
        PERFORM FILL_OUTTAB.
    Subroutine to build Field Catalog.
        PERFORM PREPARE_FIELD_CATALOG CHANGING T_FIELDCAT.
        CALL SCREEN 100.
      ENDIF.                               " IF NOT T_EKKO...
    CLASS LCL_EVENT_HANDLER DEFINITION
    Defining Class which handles events
    CLASS LCL_EVENT_HANDLER DEFINITION .
      PUBLIC SECTION .
        METHODS:
            HANDLE_HOTSPOT_CLICK
                 FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
                           IMPORTING E_ROW_ID E_COLUMN_ID.
    ENDCLASS.                              " LCL_EVENT_HANDLER DEFINITION
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION
    Implementing the Class which can handle events
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION .
    *---Handle Double Click
      METHOD HANDLE_HOTSPOT_CLICK .
    Subroutine to get the HotSpot Cell information.
        PERFORM GET_CELL_INFO.
        SET PARAMETER ID 'BES' FIELD W_VALUE.
        CALL TRANSACTION 'ME23N'.
      ENDMETHOD.                           " HANDLE_HOTSPOT_CLICK
    ENDCLASS.                              " LCL_EVENT_HANDLER
    *&      Module  STATUS_0100  OUTPUT
          PBO Event
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'OOPS'.
      SET TITLEBAR 'TIT'.
    Subroutine to fill the Variant Structure
      PERFORM FILL_VARIANT.
      IF W_GRID IS INITIAL.
        CREATE OBJECT W_GRID
          EXPORTING
       I_SHELLSTYLE      = 0
       I_LIFETIME        =
            I_PARENT       = CL_GUI_CONTAINER=>SCREEN0
       I_APPL_EVENTS     =
       I_PARENTDBG       =
       I_APPLOGPARENT    =
       I_GRAPHICSPARENT  =
       I_NAME            =
       I_FCAT_COMPLETE   = SPACE
          EXCEPTIONS
            ERROR_CNTL_CREATE = 1
            ERROR_CNTL_INIT   = 2
            ERROR_CNTL_LINK   = 3
            ERROR_DP_CREATE   = 4
            OTHERS            = 5.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.                             " IF SY-SUBRC <> 0
        CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
           I_BUFFER_ACTIVE               =
           I_BYPASSING_BUFFER            =
           I_CONSISTENCY_CHECK           =
           I_STRUCTURE_NAME              =
            IS_VARIANT                    = W_VARIANT
            I_SAVE                        = 'A'
           I_DEFAULT                     = 'X'
           IS_LAYOUT                     =
           IS_PRINT                      =
           IT_SPECIAL_GROUPS             =
           IT_TOOLBAR_EXCLUDING          =
           IT_HYPERLINK                  =
           IT_ALV_GRAPHICS               =
           IT_EXCEPT_QINFO               =
           IR_SALV_ADAPTER               =
          CHANGING
            IT_OUTTAB                     = T_OUTTAB
            IT_FIELDCATALOG               = T_FIELDCAT
           IT_SORT                       =
           IT_FILTER                     =
          EXCEPTIONS
            INVALID_PARAMETER_COMBINATION = 1
            PROGRAM_ERROR                 = 2
            TOO_MANY_LINES                = 3
            OTHERS                        = 4
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.                             " IF SY-SUBRC <> 0.
      ENDIF.                               " IF W_GRID IS INITIAL
      CREATE OBJECT W_EVENT_CLICK.
      SET HANDLER W_EVENT_CLICK->HANDLE_HOTSPOT_CLICK FOR W_GRID.
    ENDMODULE.                             " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          PAI Event
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN 'CANCEL'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                             " USER_COMMAND_0100  INPUT
    *&      Form  PREPARE_FIELD_CATALOG
          Subroutine to build the Field catalog
          <--P_T_FIELDCAT  Field Catalog Table
    FORM PREPARE_FIELD_CATALOG  CHANGING PT_FIELDCAT TYPE LVC_T_FCAT .
      DATA LS_FCAT TYPE LVC_S_FCAT.
    Purchasing group...
      LS_FCAT-FIELDNAME = 'EKGRP'.
      LS_FCAT-REF_TABLE = 'EKKO'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '10'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    Purchasing Document Number...
      LS_FCAT-FIELDNAME = 'EBELN'.
      LS_FCAT-REF_TABLE = 'EKKO' .
      LS_FCAT-EMPHASIZE = 'C411'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '10'.
      LS_FCAT-HOTSPOT   = 'X'.
      APPEND LS_FCAT TO PT_FIELDCAT .
      CLEAR LS_FCAT .
    Name of Person who Created the Object...
      LS_FCAT-FIELDNAME = 'ERNAM'.
      LS_FCAT-REF_TABLE = 'EKKO'.
      LS_FCAT-OUTPUTLEN = '15' .
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    Purchasing Document Date...
      LS_FCAT-FIELDNAME = 'BEDAT'.
      LS_FCAT-REF_TABLE = 'EKKO'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '10'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    Vendor's account number...
      LS_FCAT-FIELDNAME = 'LIFNR'.
      LS_FCAT-REF_TABLE = 'EKKO'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '10'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    Account Number of Vendor or Creditor...
      LS_FCAT-FIELDNAME = 'NAME1'.
      LS_FCAT-REF_TABLE = 'LFA1'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '10'.
      LS_FCAT-COLTEXT   = 'Vendor Name'(001).
      LS_FCAT-SELTEXT   = 'Vendor Name'(001).
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    Creation date of the change document...
      LS_FCAT-FIELDNAME = 'UDATE'.
      LS_FCAT-REF_TABLE = 'CDHDR'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '10'.
      LS_FCAT-COLTEXT   = 'Change Date'(002).
      LS_FCAT-SELTEXT   = 'Change Date'(002).
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    User name of the person responsible in change document...
      LS_FCAT-FIELDNAME = 'USERNAME'.
      LS_FCAT-REF_TABLE = 'CDHDR'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '10'.
      LS_FCAT-COLTEXT   = 'Modified by'(003).
      LS_FCAT-SELTEXT   = 'Modified by'(003).
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    Short Text Describing R/3 Repository Objects...
      LS_FCAT-FIELDNAME = 'DDTEXT'.
      LS_FCAT-REF_TABLE = 'DD04T'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '15'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    Old contents of changed field...
      LS_FCAT-FIELDNAME = 'VALUE_OLD'.
      LS_FCAT-REF_TABLE = 'CDPOS'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '12'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    New contents of changed field...
      LS_FCAT-FIELDNAME = 'VALUE_NEW'.
      LS_FCAT-REF_TABLE = 'CDPOS'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '12'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    ENDFORM.                               " PREPARE_FIELD_CATALOG
    *& Form  SELECT_PO
    Subroutine to select all the Purchase Orders
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_PO .
       SELECT EBELN                        " Purchasing Document Number
              ERNAM                        " Name of Person who Created
                                           " the Object
              LIFNR                        " Vendor's account number
              EKGRP                        " Purchasing group
              BEDAT                        " Purchasing Document Date
         FROM EKKO
      PACKAGE SIZE 10000
    APPENDING TABLE T_EBELN
        WHERE EBELN IN S_EBELN
          AND BEDAT IN S_BEDAT.
       ENDSELECT.
    IF SY-SUBRC NE 0.
       W_FLAG = 1.
       MESSAGE S401(M8).
    ENDIF.                                " IF SY-SUBRC NE 0
    ENDFORM.                               " SELECT_PO
    *&  Form  SELECT_OBJ_ID
      Subroutine to select Object ID
      There are no interface parameters to be passed to this subroutine.
    FORM SELECT_OBJ_ID .
    IF NOT T_EBELN IS INITIAL.
        SELECT OBJECTCLAS                  " Object Class
               OBJECTID                    " Object value
               CHANGENR                    " Document change number
               USERNAME                    " User name
               UDATE                       " Creation date
          FROM CDHDR
          INTO TABLE T_CDHDR
       FOR ALL ENTRIES IN T_EBELN
         WHERE OBJECTID EQ T_EBELN-EBELN
           AND UDATE IN S_UDATE
           AND TCODE IN ('ME21N','ME22N','ME23N').
       ENDSELECT.
       IF SY-SUBRC NE 0.
         W_FLAG = 1.
         MESSAGE S833(M8) WITH 'Header Not Found'(031).
       ENDIF.                              " IF SY-SUBRC NE 0.
    ENDIF.                                " IF NOT T_EBELN IS INITIAL
    ENDFORM.                               " SELECT_OBJ_ID
    *&  Form  SELECT_CHANGED_VALUE
      Subroutine to select Changed Values
      There are no interface parameters to be passed to this subroutine.
    FORM SELECT_CHANGED_VALUE .
    IF NOT T_CDHDR IS INITIAL.
        SELECT OBJECTCLAS                  " Object class
               OBJECTID                    " Object value
               CHANGENR                    " Document change number
               TABNAME                     " Table Name
               FNAME                       " Field Name
               VALUE_NEW                   " New contents of changed field
               VALUE_OLD                   " Old contents of changed field
          FROM CDPOS
       PACKAGE SIZE 10000
    APPENDING TABLE T_CDPOS
       FOR ALL ENTRIES IN T_CDHDR
         WHERE OBJECTCLAS EQ T_CDHDR-OBJECTCLAS
           AND OBJECTID   EQ T_CDHDR-OBJECTID
           AND CHANGENR   EQ T_CDHDR-CHANGENR.
        ENDSELECT.
        IF SY-SUBRC NE 0.
          W_FLAG = 1.
          MESSAGE S833(M8) WITH 'Item Not Found'(032).
        ENDIF.                             " IF SY-SUBRC NE 0.
    ENDIF.                               " IF NOT T_CDHDR IS INITIAL
      T_CDPOS_TEMP[] = T_CDPOS[].
    ENDFORM.                               " SELECT_CHANGED_VALUE
    *&   Form  SELECT_PUR_DOC
       Subroutine to select Purchase Order Details
       There are no interface parameters to be passed to this subroutine.
    FORM SELECT_PUR_DOC .
    IF NOT T_CDPOS IS INITIAL.
        SORT T_EBELN BY EBELN.
        LOOP AT T_CDPOS INTO FS_CDPOS.
          READ TABLE T_EBELN INTO FS_EBELN WITH KEY EBELN =
                                          FS_CDPOS-OBJECTID BINARY SEARCH.
          IF SY-SUBRC NE 0.
            DELETE TABLE T_EBELN FROM FS_EBELN.
          ENDIF.                           " IF SY-SUBRC NE 0.
        ENDLOOP.                           " LOOP AT T_CDPOS...
        LOOP AT T_EBELN INTO FS_EBELN.
          MOVE FS_EBELN-EBELN TO FS_EKKO-EBELN.
          MOVE FS_EBELN-ERNAM TO FS_EKKO-ERNAM.
          MOVE FS_EBELN-LIFNR TO FS_EKKO-LIFNR.
          MOVE FS_EBELN-EKGRP TO FS_EKKO-EKGRP.
          MOVE FS_EBELN-BEDAT TO FS_EKKO-BEDAT.
          APPEND FS_EKKO TO T_EKKO.
        ENDLOOP.                           " LOOP AT T_EBELN...
        T_EKKO_TEMP[] = T_EKKO[].
    ENDIF.                               " IF NOT T_CDPOS IS INITIAL
    ENDFORM.                               " SELECT_PUR_DOC
    *&  Form  SELECT_VENDOR
      Subroutine to select Vendor details
      There are no interface parameters to be passed to this subroutine.
    FORM SELECT_VENDOR .
      IF NOT T_EKKO IS INITIAL.
        SORT T_EKKO_TEMP BY LIFNR.
        DELETE ADJACENT DUPLICATES FROM T_EKKO_TEMP COMPARING LIFNR.
        SELECT LIFNR                       " Account Number of Vendor or
                                           " Creditor
               NAME1                       " Name 1
          FROM LFA1
          INTO TABLE T_LFA1
       FOR ALL ENTRIES IN T_EKKO_TEMP
         WHERE LIFNR EQ T_EKKO_TEMP-LIFNR.
       IF SY-SUBRC NE 0.
         MESSAGE S002(M8) WITH 'Master Details'(033).
       ENDIF.                              " IF SY-SUBRC NE 0.
      ENDIF.                               " IF NOT T_EKKO IS INITIAL
    ENDFORM.                               " SELECT_VENDOR
    *&  Form  DESCRIPTION
      Subroutine to get the description
      There are no interface parameters to be passed to this subroutine.
    FORM DESCRIPTION .
    IF NOT T_CDPOS IS INITIAL.
        SORT T_CDPOS_TEMP BY TABNAME FNAME.
        DELETE ADJACENT DUPLICATES FROM T_CDPOS_TEMP COMPARING TABNAME FNAME
        SELECT TABNAME                     " Table Name
               FIELDNAME                   " Field Name
               ROLLNAME                    " Data element
          FROM DD03L
          INTO TABLE T_DATAELE
       FOR ALL ENTRIES IN T_CDPOS_TEMP
         WHERE TABNAME EQ T_CDPOS_TEMP-TABNAME
           AND FIELDNAME EQ T_CDPOS_TEMP-FNAME.
        IF NOT T_DATAELE IS INITIAL.
        T_DATAELE_TEMP[] = T_DATAELE[].
        SORT T_DATAELE_TEMP BY ROLLNAME.
        DELETE ADJACENT DUPLICATES FROM T_DATAELE_TEMP COMPARING ROLLNAME.
          SELECT ROLLNAME                  " Data element
                 DDTEXT                    " Short Text Describing R/3
                                           " Repository Objects
            FROM DD04T
            INTO TABLE T_TEXT
         FOR ALL ENTRIES IN T_DATAELE_TEMP
           WHERE ROLLNAME EQ T_DATAELE_TEMP-ROLLNAME
             AND DDLANGUAGE EQ SY-LANGU.
          IF SY-SUBRC NE 0.
            EXIT.
          ENDIF.                           " IF SY-SUBRC NE 0.
        ENDIF.                             " IF NOT T_DATAELE IS INITIAL.
    ENDIF.                               " IF NOT T_CDPOS IS INITIAL.
    ENDFORM.                               " DESCRIPTION
    *&  Form  FILL_OUTTAB
      Subroutine to populate the Outtab
      There are no interface parameters to be passed to this subroutine.
    FORM FILL_OUTTAB .
      SORT T_CDHDR   BY OBJECTCLAS OBJECTID CHANGENR.
      SORT T_EKKO    BY EBELN.
      SORT T_LFA1    BY LIFNR.
      SORT T_DATAELE BY TABNAME FIELDNAME.
      SORT T_TEXT    BY ROLLNAME.
      LOOP AT T_CDPOS INTO FS_CDPOS.
        READ TABLE T_CDHDR INTO FS_CDHDR WITH KEY
                                       OBJECTCLAS = FS_CDPOS-OBJECTCLAS
                                       OBJECTID = FS_CDPOS-OBJECTID
                                       CHANGENR = FS_CDPOS-CHANGENR
                                       BINARY SEARCH.
          IF SY-SUBRC EQ 0.
            MOVE FS_CDHDR-USERNAME TO FS_OUTTAB-USERNAME.
            MOVE FS_CDHDR-UDATE    TO FS_OUTTAB-UDATE.
            READ TABLE T_EKKO INTO FS_EKKO WITH KEY
                                           EBELN = FS_CDHDR-OBJECTID
                                           BINARY SEARCH.
              IF SY-SUBRC EQ 0.
                MOVE FS_EKKO-EBELN TO FS_OUTTAB-EBELN.
                MOVE FS_EKKO-ERNAM TO FS_OUTTAB-ERNAM.
                MOVE FS_EKKO-LIFNR TO FS_OUTTAB-LIFNR.
                MOVE FS_EKKO-EKGRP TO FS_OUTTAB-EKGRP.
                MOVE FS_EKKO-BEDAT TO FS_OUTTAB-BEDAT.
                READ TABLE T_LFA1 INTO FS_LFA1 WITH KEY
                                               LIFNR = FS_EKKO-LIFNR
                                               BINARY SEARCH.
                  IF SY-SUBRC EQ 0.
                    MOVE FS_LFA1-NAME1 TO FS_OUTTAB-NAME1.
                  ENDIF.                   " IF SY-SUBRC EQ 0.
              ENDIF.                       " IF SY-SUBRC EQ 0.
          ENDIF.                           " IF SY-SUBRC EQ 0.
        MOVE FS_CDPOS-VALUE_NEW TO FS_OUTTAB-VALUE_NEW.
        MOVE FS_CDPOS-VALUE_OLD TO FS_OUTTAB-VALUE_OLD.
        READ TABLE T_DATAELE INTO FS_DATAELE WITH KEY
                                             TABNAME = FS_CDPOS-TABNAME
                                             FIELDNAME = FS_CDPOS-FNAME
                                             BINARY SEARCH.
          IF SY-SUBRC EQ 0.
            READ TABLE T_TEXT INTO FS_TEXT WITH KEY
                                           ROLLNAME = FS_DATAELE-ROLLNAME
                                           BINARY SEARCH.
              IF SY-SUBRC EQ 0.
                MOVE FS_TEXT-DDTEXT TO FS_OUTTAB-DDTEXT.
              ENDIF.                       " IF SY-SUBRC EQ 0.
          ENDIF.                           " IF SY-SUBRC EQ 0.
        APPEND FS_OUTTAB TO T_OUTTAB.
        CLEAR FS_OUTTAB.
      ENDLOOP.
    ENDFORM.                               " FILL_OUTTAB
    *&   Form  GET_CELL_INFO
       Subroutine to get the Cell Information
    -->  W_VALUE   Holds the value of Hotspot clicked
    FORM GET_CELL_INFO .
      CALL METHOD W_GRID->GET_CURRENT_CELL
        IMPORTING
         E_ROW     =
          E_VALUE   = W_VALUE
         E_COL     =
         ES_ROW_ID =
         ES_COL_ID =
         ES_ROW_NO =
    ENDFORM.                               " GET_CELL_INFO
    *&   Form  VALIDATE_PD_NUM
       Subroutine to validate Purchase Document Number
       There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_PD_NUM .
      IF NOT S_EBELN[] IS INITIAL.
        SELECT EBELN                       " Purchase Document Number
          FROM EKKO
          INTO W_EBELN
         UP TO 1 ROWS
         WHERE EBELN IN S_EBELN.
        ENDSELECT.
        IF SY-SUBRC NE 0.
          CLEAR SSCRFIELDS-UCOMM.
          MESSAGE E717(M8).
        ENDIF.                             " IF SY-SUBRC NE 0
      ENDIF.                               " IF NOT S_EBELN[]...
    ENDFORM.                               " VALIDATE_PD_NUM
    *&   Form  VALIDATE_VEN_NUM
       Subroutine to validate Vendor Number
       There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_VEN_NUM .
      IF NOT S_LIFNR[] IS INITIAL.
        SELECT LIFNR                       " Vendor Number
          FROM LFA1
          INTO W_LIFNR
         UP TO 1 ROWS
         WHERE LIFNR IN S_LIFNR.
        ENDSELECT.
        IF SY-SUBRC NE 0.
          CLEAR SSCRFIELDS-UCOMM.
          MESSAGE E002(M8) WITH W_SPACE.
        ENDIF.                             " IF SY-SUBRC NE 0
      ENDIF.                               " IF NOT S_LIFNR[]...
    ENDFORM.                               " VALIDATE_VEN_NUM
    *&   Form  VALIDATE_PUR_GRP
       Subroutine to validate the Purchase Group
       There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_PUR_GRP .
      IF NOT S_EKGRP[] IS INITIAL.
        SELECT EKGRP                       " Purchase Group
          FROM T024
          INTO W_EKGRP
         UP TO 1 ROWS
         WHERE EKGRP IN S_EKGRP.
        ENDSELECT.
        IF SY-SUBRC NE 0.
          CLEAR SSCRFIELDS-UCOMM.
          MESSAGE E622(M8) WITH W_SPACE.
        ENDIF.                             " IF SY-SUBRC NE 0
      ENDIF.                               " IF NOT S_EKFRP[]...
    ENDFORM.                               " VALIDATE_PUR_GRP
    *& Form  FILL_VARIANT
    Subroutine to fill the Variant Structure
    There are no interface parameters to be passed to this subroutine
    FORM FILL_VARIANT .
    Filling the Variant structure
      W_VARIANT-REPORT = SY-REPID.
      W_VARIANT-USERNAME = SY-UNAME.
    ENDFORM.                               " FILL_VARIANT
    Regards,
    Pavan.

  • U0095     Vendor performance report this report gives performance of supplier to se

    Vendor performance report this report gives performance of supplier to send an order to customer

    Kiran,
    The functionality you are asking sounds like standard functionality. Doesn't make sense to custom develop the same.
    Make sure you search and confirm that standard reports are NOT available for the same.
    Regards,
    Ravi
    Note : please mark the helpful answers

  • Vendor aging analysis report

    Vendor aging analysis application, which extract the data from Vendor Master Table and Vendor Transaction Tables supports Accounts Payable. Vendor master display the risk category and transactions record of vendor. How does company plan the cash resources forecast with this application? Explain in detail, how this application analyze vendor payment performance?

    In cash if you do not have Cash Management in place, where you can link your vendor / customer records.
    If you do not have CM, in such case, you can prepare cash flow statements according to your needs.
    Make sure you have completed your financial statement version in OB58.
    Cash Flow Statement (Indirect Method) Variant 1 and Variant 2, please note that these reports are coming from the form 0SAPRATIO-03 Cash flow (indirect) (Refer T code FSI5) and Reports 0SAPRATIO-03 Cash flow (indirect method) variant 1 (Refer Tcode FSI2) & 0SAPRATIO-01 Cash flow (indirect method) variant 2 (Refer T code FSI2)
    0SAPRATIO-04 Cash flow (direct) Form
    0SAPRATIO-04 Cash flow (direct method)
    You should know what format you should like to see in the cash flow statement.
    You should the FS items accordingly copy the standard forms and changed according to your format.
    Regards,
    Ravi
    You should be conversant enough to do basic report painter.
    Pelase let me know if you need further help.
    Regards

  • Functional Spec for VENDOR AGE ANALYSIS report

    Hi experts
    I need to develope a VENDOR AGE ANALYSIS REPORT. But due to some reason i cant be able to get the Functional Specification for that object. So could you please help me by sending the above mention functional Specification.
    thanks and regadrs
    Pratik

    got the following from sdn thread:
    This is the sample report for vendor aging:
    Std reports Tcodes are:
    customer : s_alr_87012178
    vendor : s_alr_87012084
    Custom designed:
    REPORT zfi_customer_ageing
    NO STANDARD PAGE HEADING
    LINE-COUNT 58
    line-size 168
    MESSAGE-ID zh_msg.
    D A T A B A S E T A B L E S D E C L A R A T I O N
    TABLES: kna1, " Customer Master (General)
    t001, " Company Codes
    rfpdo.
    I N T E R N A L T A B L E S D E C L A R A T I O N S *
    Internal Table for Customer Open Items Data
    DATA: BEGIN OF int_bsid OCCURS 0,
    kunnr LIKE bsid-kunnr, " Customer Number
    name1 LIKE kna1-name1, " Customer Name
    shkzg LIKE bsid-shkzg, " Dr/Cr Indicator
    belnr LIKE bsid-belnr, " Document Number
    xblnr LIKE bsid-xblnr, " Ref Doc No
    blart LIKE bsid-blart, " Document Type
    zfbdt LIKE bsid-zfbdt, " Base Line Date
    zbd1t LIKE bsid-zbd1t, " Due date1
    zbd2t LIKE bsid-zbd2t, " Due Date2
    zbd3t LIKE bsid-zbd3t, " Due Date3
    waers LIKE bsid-waers, " Currency
    dmbtr LIKE bsid-dmbtr, " Amount in Local Curr
    END OF int_bsid.
    Internal Table for Amounts Sum Up Data
    DATA: BEGIN OF int_final OCCURS 0,
    kunnr LIKE bsid-kunnr, " Customer Number
    name1 LIKE kna1-name1, " Customer Name
    total1 LIKE bsid-dmbtr, " Amount in Local Curr
    total2 LIKE bsid-dmbtr, " Amount in Local Curr
    total3 LIKE bsid-dmbtr, " Amount in Local Curr
    total4 LIKE bsid-dmbtr, " Amount in Local Curr
    total5 LIKE bsid-dmbtr, " Amount in Local Curr
    total6 LIKE bsid-dmbtr, " Amount in Local Curr
    total LIKE bsid-dmbtr, " Amount in Local Curr
    END OF int_final.
    D A T A D E C L A R A T I O N S
    DATA : v_flag, " Flag
    v_gtotal1 LIKE bsid-dmbtr, " Amount Totals
    v_gtotal2 LIKE bsid-dmbtr, " Amount Totals
    v_gtotal3 LIKE bsid-dmbtr, " Amount Totals
    v_gtotal4 LIKE bsid-dmbtr, " Amount Totals
    v_gtotal5 LIKE bsid-dmbtr, " Amount Totals
    v_gtotal6 LIKE bsid-dmbtr, " Amount Totals
    v_gtotal LIKE bsid-dmbtr, " Amount Totals
    v_subtotal1 LIKE bsid-dmbtr, " Amount Totals
    v_subtotal2 LIKE bsid-dmbtr, " Amount Totals
    v_subtotal3 LIKE bsid-dmbtr, " Amount Totals
    v_subtotal4 LIKE bsid-dmbtr, " Amount Totals
    v_subtotal5 LIKE bsid-dmbtr, " Amount Totals
    v_subtotal6 LIKE bsid-dmbtr, " Amount Totals
    v_subtotal LIKE bsid-dmbtr, " Amount Totals
    v_date LIKE bsid-zfbdt, " Due Date
    v_tage1(4), " Age 30 days
    v_tage2(4), " Age 60 days
    v_tage3(4), " Age 90 days
    v_fir(15), " Column Text1
    v_sec(15), " Column Text2
    v_thir(15), " Column Text3
    v_four(17), " Column Text4
    v_fidd(4), " Days field1
    v_sedd(4), " Days field2
    v_thdd(4), " Days field3
    v_fodd(4), " Days field4
    v_str TYPE SY-LISEL, " String
    v_str1(11), " String
    v_tage(3), " String
    v_date1(10). " Date field
    R A N G E D E C L A R A T I O N S
    RANGES: r_date1 FOR bsid-zfbdt, " Date Range 1
    r_date2 FOR bsid-zfbdt, " Date Range 2
    r_date3 FOR bsid-zfbdt, " Date Range 3
    r_date4 FOR bsid-zfbdt. " Date Range 4
    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-001.
    SELECT-OPTIONS: s_kunnr FOR kna1-kunnr. "Customer account
    PARAMETERS: p_bukrs LIKE t001-bukrs. "Co. Code
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: p_allgst LIKE rfpdo-allgstid OBLIGATORY DEFAULT sy-datum.
    "Open items at key date
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETERS: p_tage1 LIKE rfpdo1-allgfael DEFAULT '30',
    p_tage2 LIKE rfpdo1-allgfael DEFAULT '60',
    p_tage3 LIKE rfpdo1-allgfael DEFAULT '90',
    p_tage4 LIKE rfpdo1-allgfael DEFAULT '120'.
    SELECTION-SCREEN END OF BLOCK b3.
    A T S E L E C T I O N S C R E E N *
    AT SELECTION-SCREEN.
    Validate the screen fields
    PERFORM validate_flds.
    S T A R T O F S E L E C T I O N *
    START-OF-SELECTION.
    Fetch main data
    PERFORM fetch_data.
    T O P O F P A G E
    Header
    TOP-OF-PAGE.
    PERFORM header.
    E N D O F P A G E
    Footer
    END-OF-PAGE.
    ULINE.
    T O P O F P A G E D U R I N G L I N E S E L E C T I O N *
    Top of Page in Secondary List
    TOP-OF-PAGE DURING LINE-SELECTION.
    PERFORM header1.
    A T L I N E S E L E C T I O N *
    AT LINE-SELECTION.
    Perform Line Selections
    PERFORM line_selection.
    E N D O F S E L E C T I O N
    END-OF-SELECTION.
    List generation
    PERFORM basic_list.
    *& Form validate_flds
    Validation of Selection Screen fields
    FORM validate_flds .
    Validate Customer Code
    CLEAR kna1-kunnr.
    SELECT kunnr UP TO 1 ROWS
    INTO kna1-kunnr
    FROM kna1
    WHERE kunnr IN s_kunnr AND
    spras = sy-langu.
    ENDSELECT.
    IF sy-subrc 0.
    MESSAGE e000 WITH 'Invalid Customer Code range'(023).
    ENDIF.
    Validate Company Code
    CLEAR t001-bukrs.
    SELECT bukrs UP TO 1 ROWS
    INTO t001-bukrs
    FROM t001
    WHERE bukrs = p_bukrs AND
    spras = sy-langu.
    ENDSELECT.
    IF sy-subrc 0.
    MESSAGE e021. " Invalid Company Code range
    ENDIF.
    IF ( p_tage1 > p_tage2 ) OR ( p_tage1 > p_tage3 ) OR
    ( p_tage1 > p_tage4 ).
    MESSAGE e999 WITH 'Column 1 greater'(004)
    'than Column# 2 or 3 or 4'(005).
    ENDIF.
    *column 2
    IF ( p_tage2 > p_tage3 ) OR ( p_tage1 > p_tage4 ).
    MESSAGE e999 WITH 'Column 2 greater'(006)
    'than Column# 3 or 4'(007).
    ENDIF.
    *column3
    IF ( p_tage3 > p_tage4 ).
    MESSAGE e999 WITH 'Column 3 greater'(008)
    'than Column#4'(009).
    ENDIF.
    ENDFORM. " validate_flds
    *& Form fetch_data
    Fetching Data from Database Tables
    FORM fetch_data .
    Date Range Population
    r_date1-sign = 'I'.
    r_date1-option = 'BT'.
    r_date1-low = p_allgst.
    r_date1-high = r_date1-low + p_tage1.
    APPEND r_date1.
    r_date2-sign = 'I'.
    r_date2-option = 'BT'.
    r_date2-low = r_date1-high + 1.
    r_date2-high = r_date1-low + p_tage2.
    APPEND r_date2.
    r_date3-sign = 'I'.
    r_date3-option = 'BT'.
    r_date3-low = r_date2-high + 1.
    r_date3-high = r_date1-low + p_tage3.
    APPEND r_date3.
    r_date4-sign = 'I'.
    r_date4-option = 'BT'.
    r_date4-low = r_date3-high + 1.
    r_date4-high = r_date1-low + p_tage4.
    APPEND r_date4.
    Select the Customer Open Items data from bsid
    SELECT l~kunnr
    l1~name1
    b~waers
    b~dmbtr
    b~zfbdt
    b~zbd1t
    b~zbd2t
    b~zbd3t
    b~belnr
    b~xblnr
    b~shkzg
    b~blart
    INTO CORRESPONDING FIELDS OF TABLE int_bsid
    FROM knb1 AS l INNER JOIN kna1 AS l1
    ON lkunnr = l1kunnr
    INNER JOIN bsid AS b
    ON lkunnr = bkunnr AND
    lbukrs = bbukrs
    WHERE l~kunnr IN s_kunnr AND
    l~bukrs = p_bukrs and
    b~zfbdt le p_allgst.
    IF SY-SUBRC 0.
    MESSAGE i000 WITH 'No Data found'(027).
    ENDIF.
    Removing the date limit to get the due items in the past
    DELETE int_bsid WHERE
    ( blart NE 'RE' AND blart NE 'KR' ) OR
    shkzg NE 'H'.
    SORT int_bsid BY kunnr.
    ENDFORM. " fetch_data
    *& Form header
    Display the Report Columns
    FORM header .
    v_tage1 = p_tage1 + 1.
    v_tage2 = p_tage2 + 1.
    v_tage3 = p_tage3 + 1.
    v_fidd = p_tage1.
    v_sedd = p_tage2.
    v_thdd = p_tage3.
    v_fodd = p_tage4.
    MOVE v_fodd0(4) TO v_fodd1(3).
    v_fodd+0(1) = space.
    CONCATENATE '1 to'(010) v_fidd INTO v_fir.
    CONCATENATE v_tage1 ' to '(011) v_sedd INTO v_sec.
    CONCATENATE v_tage2 ' to '(011) v_thdd INTO v_thir.
    CONCATENATE v_tage3 ' to '(011) space v_fodd INTO v_four.
    Standard header
    clear: v_date1, v_str, v_str1, v_tage.
    write p_allgst to v_date1.
    Move p_tage4 to v_tage.
    concatenate '>' v_tage text-025 into v_str1.
    concatenate
    'Summary of Ageing Analysis for Customer Open Invoices as on'(013)
    v_date1 into v_str separated by space.
    CALL FUNCTION 'Z_STANDARD_HEADER'
    EXPORTING
    title1 = 'Saudi International Petrochemical Company'(012)
    title2 = v_str.
    FORMAT COLOR OFF.
    WRITE : /1(168) sy-uline.
    FORMAT COLOR 1 INTENSIFIED.
    WRITE :/1 sy-vline, 13 sy-vline, 49 sy-vline,
    50(101) 'Invoices Due For(In Days)'(014) CENTERED,
    151 sy-vline, 168 sy-vline .
    WRITE :/1 sy-vline, 2(11) 'Customer#'(015) CENTERED,
    13 sy-vline ,14(35) 'Customer Name'(016) CENTERED,
    49 sy-vline,
    50(101) sy-uline,151 sy-vline,
    152(16) 'Total'(017) CENTERED,
    168 sy-vline.
    WRITE : /1 sy-vline,13 sy-vline, 49 sy-vline,
    50(16) v_fir CENTERED, 66 sy-vline,
    67(16) v_sec CENTERED, 83 sy-vline,
    84(16) v_thir CENTERED, 100 sy-vline,
    101(16) v_four CENTERED, 117 sy-vline,
    118(16) v_str1 centered, 134 sy-vline,
    135(16) 'Already Overdue'(018) CENTERED,151 sy-vline,
    168 sy-vline.
    FORMAT COLOR OFF.
    WRITE : /1(168) sy-uline.
    ENDFORM. " header
    *& Form basic_list
    Display the Basic List
    FORM basic_list .
    NEW-PAGE LINE-SIZE 168.
    LOOP AT int_bsid.
    CLEAR v_date.
    IF int_bsid-zbd3t ' '.
    v_date = int_bsid-zfbdt + int_bsid-zbd3t.
    ELSE.
    IF int_bsid-zbd2t ' '.
    v_date = int_bsid-zfbdt + int_bsid-zbd2t.
    ELSE.
    v_date = int_bsid-zfbdt + int_bsid-zbd1t.
    ENDIF.
    ENDIF.
    IF int_bsid-zbd1t = ' '.
    v_date = int_bsid-zfbdt.
    ENDIF.
    IF v_date IN r_date1.
    int_final-total1 = int_final-total1 + int_bsid-dmbtr.
    ELSEIF v_date IN r_date2.
    int_final-total2 = int_final-total2 + int_bsid-dmbtr.
    ELSEIF v_date IN r_date3.
    int_final-total3 = int_final-total3 + int_bsid-dmbtr.
    ELSEIF v_date IN r_date4.
    int_final-total4 = int_final-total4 + int_bsid-dmbtr.
    ELSEif v_date > r_date4-high.
    int_final-total5 = int_final-total5 + int_bsid-dmbtr.
    ELSEif v_date < p_allgst.
    int_final-total6 = int_final-total6 + int_bsid-dmbtr.
    ENDIF.
    AT END OF kunnr.
    v_flag = 1.
    ENDAT.
    IF v_flag = 1.
    int_final-kunnr = int_bsid-kunnr.
    int_final-name1 = int_bsid-name1.
    int_final-total = int_final-total1 + int_final-total2 +
    int_final-total3 + int_final-total4 + int_final-total5 +
    int_final-total6.
    APPEND int_final.
    v_gtotal1 = v_gtotal1 + int_final-total1.
    v_gtotal2 = v_gtotal2 + int_final-total2.
    v_gtotal3 = v_gtotal3 + int_final-total3.
    v_gtotal4 = v_gtotal4 + int_final-total4.
    v_gtotal5 = v_gtotal5 + int_final-total5.
    v_gtotal6 = v_gtotal6 + int_final-total6.
    v_gtotal = v_gtotal + int_final-total.
    WRITE: /1 sy-vline,
    2 int_final-kunnr COLOR 4 INTENSIFIED ON,
    13 sy-vline,
    14 int_final-name1 COLOR 4 INTENSIFIED ON,
    49 sy-vline.
    DATA : v_rem.
    v_rem = sy-tabix MOD 2.
    IF v_rem NE 0.
    FORMAT COLOR 2 INTENSIFIED.
    WRITE : 50 int_final-total1 CURRENCY int_bsid-waers,
    66 sy-vline,
    67 int_final-total2 CURRENCY int_bsid-waers,
    83 sy-vline,
    84 int_final-total3 CURRENCY int_bsid-waers,
    100 sy-vline,
    101 int_final-total4 CURRENCY int_bsid-waers,
    117 sy-vline,
    118 int_final-total5 CURRENCY int_bsid-waers,
    134 sy-vline,
    135 int_final-total6 CURRENCY int_bsid-waers,
    151 sy-vline,
    152 int_final-total CURRENCY int_bsid-waers,
    168 sy-vline.
    ELSE.
    WRITE : 50 int_final-total1 CURRENCY int_bsid-waers,
    66 sy-vline,
    67 int_final-total2 CURRENCY int_bsid-waers,
    83 sy-vline,
    84 int_final-total3 CURRENCY int_bsid-waers,
    100 sy-vline,
    101 int_final-total4 CURRENCY int_bsid-waers,
    117 sy-vline,
    118 int_final-total5 CURRENCY int_bsid-waers,
    134 sy-vline,
    135 int_final-total6 CURRENCY int_bsid-waers,
    151 sy-vline,
    152 int_final-total CURRENCY int_bsid-waers,
    168 sy-vline.
    ENDIF.
    FORMAT COLOR OFF.
    HIDE int_final.
    CLEAR int_final.
    v_flag = 0.
    ENDIF.
    AT LAST.
    WRITE : /1(168) sy-uline.
    FORMAT COLOR 3 INTENSIFIED.
    WRITE : /1 sy-vline, 2(47) 'GRAND TOTAL'(022) CENTERED,
    49 sy-vline, 50 v_gtotal1 CURRENCY int_bsid-waers,
    66 sy-vline, 67 v_gtotal2 CURRENCY int_bsid-waers,
    83 sy-vline, 84 v_gtotal3 CURRENCY int_bsid-waers,
    100 sy-vline,101 v_gtotal4 CURRENCY int_bsid-waers,
    117 sy-vline,118 v_gtotal5 CURRENCY int_bsid-waers,
    134 sy-vline,135 v_gtotal6 CURRENCY int_bsid-waers,
    151 sy-vline,152 v_gtotal CURRENCY int_bsid-waers,
    168 sy-vline.
    HIDE : v_gtotal1,
    v_gtotal2,
    v_gtotal3,
    v_gtotal4,
    v_gtotal5,
    v_gtotal6,
    v_gtotal.
    ENDAT.
    FORMAT COLOR OFF.
    ENDLOOP.
    WRITE : /1(168) sy-uline.
    ENDFORM. " basic_list
    *& Form line_selection
    When double clicked on the line display the seconday list
    FORM line_selection .
    NEW-PAGE LINE-SIZE 206.
    Sy-lsind = 1.
    DATA : v_rem,v_cnt LIKE sy-tabix.
    v_cnt = 0.
    SORT int_bsid BY belnr zfbdt.
    LOOP AT int_bsid WHERE kunnr EQ int_final-kunnr.
    v_rem = v_cnt MOD 2.
    CLEAR v_date.
    IF int_bsid-zbd3t ' '.
    v_date = int_bsid-zfbdt + int_bsid-zbd3t.
    ELSE.
    IF int_bsid-zbd2t ' '.
    v_date = int_bsid-zfbdt + int_bsid-zbd2t.
    ELSE.
    v_date = int_bsid-zfbdt + int_bsid-zbd1t.
    ENDIF.
    ENDIF.
    IF int_bsid-zbd1t = ' '.
    v_date = int_bsid-zfbdt.
    ENDIF.
    IF v_rem NE 0.
    format color 2 intensified.
    WRITE :/1 sy-vline, 2 int_bsid-belnr,
    12 sy-vline,13 int_bsid-kunnr,
    23 sy-vline,24 int_bsid-name1,
    59 sy-vline,60 int_bsid-xblnr,
    76 sy-vline,77 int_bsid-zfbdt,
    87 sy-vline.
    WRITE : 104 sy-vline,121 sy-vline,
    138 sy-vline,155 sy-vline,
    172 sy-vline, 189 sy-vline,
    190 int_bsid-dmbtr CURRENCY int_bsid-waers,
    206 sy-vline.
    IF v_date IN r_date1.
    v_subtotal1 = v_subtotal1 + int_bsid-dmbtr.
    WRITE : 88 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEIF v_date IN r_date2.
    v_subtotal2 = v_subtotal2 + int_bsid-dmbtr.
    WRITE : 105 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEIF v_date IN r_date3.
    v_subtotal3 = v_subtotal3 + int_bsid-dmbtr.
    WRITE : 122 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEIF v_date IN r_date4.
    v_subtotal4 = v_subtotal4 + int_bsid-dmbtr.
    WRITE : 139 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEif v_date > r_date4-high.
    v_subtotal5 = v_subtotal5 + int_bsid-dmbtr.
    WRITE : 156 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEif v_date < p_allgst.
    v_subtotal6 = v_subtotal6 + int_bsid-dmbtr.
    WRITE : 173 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ENDIF.
    format color off.
    ELSE.
    WRITE :/1 sy-vline, 2 int_bsid-belnr,
    12 sy-vline,13 int_bsid-kunnr,
    23 sy-vline,24 int_bsid-name1,
    59 sy-vline,60 int_bsid-xblnr,
    76 sy-vline,77 int_bsid-zfbdt,
    87 sy-vline.
    WRITE : 104 sy-vline,121 sy-vline,
    138 sy-vline,155 sy-vline,
    172 sy-vline,189 sy-vline,
    190 int_bsid-dmbtr CURRENCY int_bsid-waers,
    206 sy-vline.
    IF v_date IN r_date1.
    v_subtotal1 = v_subtotal1 + int_bsid-dmbtr.
    WRITE : 88 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEIF v_date IN r_date2.
    v_subtotal2 = v_subtotal2 + int_bsid-dmbtr.
    WRITE : 105 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEIF v_date IN r_date3.
    v_subtotal3 = v_subtotal3 + int_bsid-dmbtr.
    WRITE : 122 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEIF v_date IN r_date4.
    v_subtotal4 = v_subtotal4 + int_bsid-dmbtr.
    WRITE : 139 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEif v_date > r_date4-high.
    v_subtotal5 = v_subtotal5 + int_bsid-dmbtr.
    WRITE : 156 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEif v_date < p_allgst.
    v_subtotal6 = v_subtotal6 + int_bsid-dmbtr.
    WRITE : 173 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ENDIF.
    ENDIF.
    FORMAT COLOR OFF.
    v_cnt = v_cnt + 1.
    ENDLOOP.
    WRITE : /1(206) sy-uline.
    v_subtotal = v_subtotal1 + v_subtotal2 + v_subtotal3
    + v_subtotal4 + v_subtotal5 + v_subtotal6.
    FORMAT COLOR 3 INTENSIFIED.
    WRITE : /1 sy-vline,
    2(85) 'Total'(017) CENTERED CURRENCY int_bsid-waers ,
    87 sy-vline,
    88 v_subtotal1 CURRENCY int_bsid-waers,
    104 sy-vline,
    105 v_subtotal2 CURRENCY int_bsid-waers,
    121 sy-vline,
    122 v_subtotal3 CURRENCY int_bsid-waers,
    138 sy-vline,
    139 v_subtotal4 CURRENCY int_bsid-waers,
    155 sy-vline,
    156 v_subtotal5 CURRENCY int_bsid-waers,
    172 sy-vline,
    173 v_subtotal6 CURRENCY int_bsid-waers,
    189 sy-vline,
    190 v_subtotal CURRENCY int_bsid-waers,
    206 sy-vline.
    FORMAT COLOR OFF.
    WRITE : /1(206) sy-uline.
    CLEAR : v_subtotal,v_subtotal1,v_subtotal2,v_subtotal3,
    v_subtotal4,v_subtotal5,v_gtotal1,v_gtotal2,v_gtotal3,
    v_gtotal4, v_gtotal5,v_gtotal,v_subtotal6,v_gtotal6.
    ENDFORM. " line_selection
    *& Form header1
    Secondary List Header
    FORM header1 .
    Standard header
    clear: v_date1, v_str, v_str1, v_tage.
    write p_allgst to v_date1.
    Move p_tage4 to v_tage.
    concatenate '>' v_tage text-025 into v_str1.
    concatenate
    'Details of Ageing Analysis for Customer Open Invoices as on'(024)
    v_date1 into v_str separated by space.
    CALL FUNCTION 'Z_STANDARD_HEADER'
    EXPORTING
    title1 = 'Saudi International Petrochemical Company'(012)
    title2 = v_str.
    FORMAT COLOR 1 intensified.
    WRITE :/1(206) sy-uline.
    WRITE :/1 sy-vline,12 sy-vline ,
    23 sy-vline,59 sy-vline,76 sy-vline,87 sy-vline,
    88(101) 'Invoices Due For(In Days)'(014) CENTERED,
    189 sy-vline,206 sy-vline.
    WRITE : /1 sy-vline, 2(10) 'Doc Number'(021) CENTERED,
    12 sy-vline, 13(10) 'Customer#'(015) CENTERED,
    23 sy-vline, 24(35) 'Customer Name'(016) CENTERED,
    59 sy-vline, 60(16) 'Ref invoice#'(019) CENTERED,
    76 sy-vline, 77(10) 'Inv dt'(020) CENTERED,
    87 sy-vline, 88(101) sy-uline,
    189 sy-vline,190(16) 'Total'(017) CENTERED,
    206 sy-vline.
    WRITE : /1 sy-vline, 12 sy-vline,
    23 sy-vline,59 sy-vline,
    76 sy-vline,87 sy-vline,
    88(16) v_fir CENTERED, 104 sy-vline,
    105(16) v_sec CENTERED, 121 sy-vline,
    122(16) v_thir CENTERED, 138 sy-vline,
    139(16) v_four CENTERED, 155 sy-vline,
    156(16) v_str1 CENTERED,
    172 sy-vline,
    173(16) 'Already Overdue'(018) CENTERED,
    189 sy-vline,
    206 sy-vline.
    format color off.
    WRITE : /1(206) sy-uline.
    ENDFORM. " header1
    REPORT zfi_vendor_ageing
    NO STANDARD PAGE HEADING
    LINE-COUNT 58
    line-size 168
    MESSAGE-ID zh_msg.
    Report Name : Vendor Open Items Ageing Report
    Purpose : This report displays the Vendor Open Items based on
    different Ageing days (Calculated by taking the Base
    Line date and the days mentioned in Payment Terms)
    M O D I F I C A T I O N L O G
    Date | Change Number | Initials | Description
    30-Aug-2004 | DTSK900**** | Anji Reddy | Initial
    D A T A B A S E T A B L E S D E C L A R A T I O N
    TABLES: lfa1, " Vendor Master (General)
    t001, " Company Codes
    rfpdo.
    I N T E R N A L T A B L E S D E C L A R A T I O N S *
    Internal Table for Vendor Open Items Data
    DATA: BEGIN OF int_bsik OCCURS 0,
    lifnr LIKE bsik-lifnr, " Vendor Number
    name1 LIKE lfa1-name1, " Vendor Name
    shkzg LIKE bsik-shkzg, " Dr/Cr Indicator
    belnr LIKE bsik-belnr, " Document Number
    xblnr LIKE bsik-xblnr, " Ref Doc No
    blart LIKE bsik-blart, " Document Type
    zfbdt LIKE bsik-zfbdt, " Base Line Date
    zbd1t LIKE bsik-zbd1t, " Due date1
    zbd2t LIKE bsik-zbd2t, " Due Date2
    zbd3t LIKE bsik-zbd3t, " Due Date3
    waers LIKE bsik-waers, " Currency
    dmbtr LIKE bsik-dmbtr, " Amount in Local Curr
    END OF int_bsik.
    Internal Table for Amounts Sum Up Data
    DATA: BEGIN OF int_final OCCURS 0,
    lifnr LIKE bsik-lifnr, " Vendor Number
    name1 LIKE lfa1-name1, " Vendor Name
    total1 LIKE bsik-dmbtr, " Amount in Local Curr
    total2 LIKE bsik-dmbtr, " Amount in Local Curr
    total3 LIKE bsik-dmbtr, " Amount in Local Curr
    total4 LIKE bsik-dmbtr, " Amount in Local Curr
    total5 LIKE bsik-dmbtr, " Amount in Local Curr
    total6 LIKE bsik-dmbtr, " Amount in Local Curr
    total LIKE bsik-dmbtr, " Amount in Local Curr
    END OF int_final.
    D A T A D E C L A R A T I O N S
    DATA : v_flag, " Flag
    v_gtotal1 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal2 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal3 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal4 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal5 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal6 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal LIKE bsik-dmbtr, " Amount Totals
    v_subtotal1 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal2 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal3 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal4 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal5 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal6 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal LIKE bsik-dmbtr, " Amount Totals
    v_date LIKE bsik-zfbdt, " Due Date
    v_tage1(4), " Age 30 days
    v_tage2(4), " Age 60 days
    v_tage3(4), " Age 90 days
    v_fir(15), " Column Text1
    v_sec(15), " Column Text2
    v_thir(15), " Column Text3
    v_four(17), " Column Text4
    v_fidd(4), " Days field1
    v_sedd(4), " Days field2
    v_thdd(4), " Days field3
    v_fodd(4), " Days field4
    v_str TYPE SY-LISEL, " String
    v_str1(11), " String
    v_tage(3), " String
    v_date1(10). " Date field
    R A N G E D E C L A R A T I O N S
    RANGES: r_date1 FOR bsik-zfbdt, " Date Range 1
    r_date2 FOR bsik-zfbdt, " Date Range 2
    r_date3 FOR bsik-zfbdt, " Date Range 3
    r_date4 FOR bsik-zfbdt. " Date Range 4
    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-001.
    SELECT-OPTIONS: s_lifnr FOR lfa1-lifnr. "Vendor account
    PARAMETERS: p_bukrs LIKE t001-bukrs. "Co. Code
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: p_allgst LIKE rfpdo-allgstid OBLIGATORY DEFAULT sy-datum.
    "Open items at key date
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETERS: p_tage1 LIKE rfpdo1-allgfael DEFAULT '30',
    p_tage2 LIKE rfpdo1-allgfael DEFAULT '60',
    p_tage3 LIKE rfpdo1-allgfael DEFAULT '90',
    p_tage4 LIKE rfpdo1-allgfael DEFAULT '120'.
    SELECTION-SCREEN END OF BLOCK b3.
    A T S E L E C T I O N S C R E E N *
    AT SELECTION-SCREEN.
    Validate the screen fields
    PERFORM validate_flds.
    S T A R T O F S E L E C T I O N *
    START-OF-SELECTION.
    Fetch main data
    PERFORM fetch_data.
    T O P O F P A G E
    Header
    TOP-OF-PAGE.
    PERFORM header.
    E N D O F P A G E
    Footer
    END-OF-PAGE.
    ULINE.
    T O P O F P A G E D U R I N G L I N E S E L E C T I O N *
    Top of Page in Secondary List
    TOP-OF-PAGE DURING LINE-SELECTION.
    PERFORM header1.
    A T L I N E S E L E C T I O N *
    AT LINE-SELECTION.
    Perform Line Selections
    PERFORM line_selection.
    E N D O F S E L E C T I O N
    END-OF-SELECTION.
    List generation
    PERFORM basic_list.
    *& Form validate_flds
    Validation of Selection Screen fields
    FORM validate_flds .
    Validate Vendor Code
    CLEAR lfa1-lifnr.
    SELECT lifnr UP TO 1 ROWS
    INTO lfa1-lifnr
    FROM lfa1
    WHERE lifnr IN s_lifnr AND
    spras = sy-langu.
    ENDSELECT.
    IF sy-subrc 0.
    MESSAGE e000 WITH 'Invalid Vendor Code range'(023).
    ENDIF.
    Validate Company Code
    CLEAR t001-bukrs.
    SELECT bukrs UP TO 1 ROWS
    INTO t001-bukrs
    FROM t001
    WHERE bukrs = p_bukrs AND
    spras = sy-langu.
    ENDSELECT.
    IF sy-subrc 0.
    MESSAGE e021. " Invalid Company Code range
    ENDIF.
    IF ( p_tage1 > p_tage2 ) OR ( p_tage1 > p_tage3 ) OR
    ( p_tage1 > p_tage4 ).
    MESSAGE e999 WITH 'Column 1 greater'(004)
    'than Column# 2 or 3 or 4'(005).
    ENDIF.
    *column 2
    IF ( p_tage2 > p_tage3 ) OR ( p_tage1 > p_tage4 ).
    MESSAGE e999 WITH 'Column 2 greater'(006)
    'than Column# 3 or 4'(007).
    ENDIF.
    *column3
    IF ( p_tage3 > p_tage4 ).
    MESSAGE e999 WITH 'Column 3 greater'(008)
    'than Column#4'(009).
    ENDIF.
    ENDFORM. " validate_flds
    *& Form fetch_data
    Fetching Data from Database Tables
    FORM fetch_data .
    Date Range Population
    r_date1-sign = 'I'.
    r_date1-option = 'BT'.
    r_date1-low = p_allgst.
    r_date1-high = r_date1-low + p_tage1.
    APPEND r_date1.
    r_date2-sign = 'I'.
    r_date2-option = 'BT'.
    r_date2-low = r_date1-high + 1.
    r_date2-high = r_date1-low + p_tage2.
    APPEND r_date2.
    r_date3-sign = 'I'.
    r_date3-option = 'BT'.
    r_date3-low = r_date2-high + 1.
    r_date3-high = r_date1-low + p_tage3.
    APPEND r_date3.
    r_date4-sign = 'I'.
    r_date4-option = 'BT'.
    r_date4-low = r_date3-high + 1.
    r_date4-high = r_date1-low + p_tage4.
    APPEND r_date4.
    Select the Vendor Open Items data from BSIK
    SELECT l~lifnr
    l1~name1
    b~waers
    b~dmbtr
    b~zfbdt
    b~zbd1t
    b~zbd2t
    b~zbd3t
    b~belnr
    b~xblnr
    b~shkzg
    b~blart
    INTO CORRESPONDING FIELDS OF TABLE int_bsik
    FROM lfb1 AS l INNER JOIN lfa1 AS l1
    ON llifnr = l1lifnr
    INNER JOIN bsik AS b
    ON llifnr = blifnr AND
    lbukrs = bbukrs
    WHERE l~lifnr IN s_lifnr AND
    l~bukrs = p_bukrs and
    b~zfbdt le p_allgst.
    IF SY-SUBRC 0.
    MESSAGE i000 WITH 'No Data found'(027).
    ENDIF.
    Removing the date limit to get the due items in the past
    DELETE int_bsik WHERE
    ( blart NE 'RE' AND blart NE 'KR' ) OR
    shkzg NE 'H'.
    SORT int_bsik BY lifnr.
    ENDFORM. " fetch_data
    *& Form header
    Display the Report Columns
    FORM header .
    v_tage1 = p_tage1 + 1.
    v_tage2 = p_tage2 + 1.
    v_tage3 = p_tage3 + 1.
    v_fidd = p_tage1.
    v_sedd = p_tage2.
    v_thdd = p_tage3.
    v_fodd = p_tage4.
    MOVE v_fodd0(4) TO v_fodd1(3).
    v_fodd+0(1) = space.
    CONCATENATE '1 to'(010) v_fidd INTO v_fir.
    CONCATENATE v_tage1 ' to '(011) v_sedd INTO v_sec.
    CONCATENATE v_tage2 ' to '(011) v_thdd INTO v_thir.
    CONCATENATE v_tage3 ' to '(011) space v_fodd INTO v_four.
    Standard header
    clear: v_date1, v_str, v_str1, v_tage.
    write p_allgst to v_date1.
    Move p_tage4 to v_tage.
    concatenate '>' v_tage text-025 into v_str1.
    concatenate
    'Summary of Ageing Analysis for Vendor Open Invoices as on'(013)
    v_date1 into v_str separated by space.
    CALL FUNCTION 'Z_STANDARD_HEADER'
    EXPORTING
    title1 = 'Saudi International Petrochemical Company'(012)
    title2 = v_str.
    FORMAT COLOR OFF.
    WRITE : /1(168) sy-uline.
    FORMAT COLOR 1 INTENSIFIED.
    WRITE :/1 sy-vline, 13 sy-vline, 49 sy-vline,
    50(101) 'Invoices Due For(In Days)'(014) CENTERED,
    151 sy-vline, 168 sy-vline .
    WRITE :/1 sy-vline, 2(11) 'Vendor#'(015) CENTERED,
    13 sy-vline ,14(35) 'Vendor Name'(016) CENTERED,
    49 sy-vline,
    50(101) sy-uline,151 sy-vline,
    152(16) 'Total'(017) CENTERED,
    168 sy-vline.
    WRITE : /1 sy-vline,13 sy-vline, 49 sy-vline,
    50(16) v_fir CENTERED, 66 sy-vline,
    67(16) v_sec CENTERED, 83 sy-vline,
    84(16) v_thir CENTERED, 100 sy-vline,
    101(16) v_four CENTERED, 117 sy-vline,
    118(16) v_str1 centered, 134 sy-vline,
    135(16) 'Already Overdue'(018) CENTERED,151 sy-vline,
    168 sy-vline.
    FORMAT COLOR OFF.
    WRITE : /1(168) sy-uline.
    ENDFORM. " header
    *& Form basic_list
    Display the Basic List
    FORM basic_list .
    NEW-PAGE LINE-SIZE 168.
    LOOP AT int_bsik.
    CLEAR v_date.
    IF int_bsik-zbd3t ' '.
    v_date = int_bsik-zfbdt + int_bsik-zbd3t.
    ELSE.
    IF int_bsik-zbd2t ' '.
    v_date = int_bsik-zfbdt + int_bsik-zbd2t.
    ELSE.
    v_date = int_bsik-zfbdt + int_bsik-zbd1t.
    ENDIF.
    ENDIF.
    IF int_bsik-zbd1t = ' '.
    v_date = int_bsik-zfbdt.
    ENDIF.
    IF v_date IN r_date1.
    int_final-total1 = int_final-total1 + int_bsik-dmbtr.
    ELSEIF v_date IN r_date2.
    int_final-total2 = int_final-total2 + int_bsik-dmbtr.
    ELSEIF v_date IN r_date3.
    int_final-total3 = int_final-total3 + int_bsik-dmbtr.
    ELSEIF v_date IN r_date4.
    int_final-total4 = int_final-total4 + int_bsik-dmbtr.
    ELSEif v_date > r_date4-high.
    int_final-total5 = int_final-total5 + int_bsik-dmbtr.
    ELSEif v_date < p_allgst.
    int_final-total6 = int_final-total6 + int_bsik-dmbtr.
    ENDIF.
    AT END OF lifnr.
    v_flag = 1.
    ENDAT.
    IF v_flag = 1.
    int_final-lifnr = int_bsik-lifnr.
    int_final-name1 = int_bsik-name1.
    int_final-total = int_final-total1 + int_final-total2 +
    int_final-total3 + int_final-total4 + int_final-total5 +
    int_final-total6.
    APPEND int_final.
    v_gtotal1 = v_gtotal1 + int_final-total1.
    v_gtotal2 = v_gtotal2 + int_final-total2.
    v_gtotal3 = v_gtotal3 + int_final-total3.
    v_gtotal4 = v_gtotal4 + int_final-total4.
    v_gtotal5 = v_gtotal5 + int_final-total5.
    v_gtotal6 = v_gtotal6 + int_final-total6.
    v_gtotal = v_gtotal + int_final-total.
    WRITE: /1 sy-vline,
    2 int_final-lifnr COLOR 4 INTENSIFIED ON,
    13 sy-vline,
    14 int_final-name1 COLOR 4 INTENSIFIED ON,
    49 sy-vline.
    DATA : v_rem.
    v_rem = sy-tabix MOD 2.
    IF v_rem NE 0.
    FORMAT COLOR 2 INTENSIFIED.
    WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
    66 sy-vline,
    67 int_final-total2 CURRENCY int_bsik-waers,
    83 sy-vline,
    84 int_final-total3 CURRENCY int_bsik-waers,
    100 sy-vline,
    101 int_final-total4 CURRENCY int_bsik-waers,
    117 sy-vline,
    118 int_final-total5 CURRENCY int_bsik-waers,
    134 sy-vline,
    135 int_final-total6 CURRENCY int_bsik-waers,
    151 sy-vline,
    152 int_final-total CURRENCY int_bsik-waers,
    168 sy-vline.
    ELSE.
    WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
    66 sy-vline,
    67 int_final-total2 CURRENCY int_bsik-waers,
    83 sy-vline,
    84 int_final-total3 CURRENCY int_bsik-waers,
    100 sy-vline,
    101 int_final-total4 CURRENCY int_bsik-waers,
    117 sy-vline,
    118 int_final-total5 CURRENCY int_bsik-waers,
    134 sy-vline,
    135 int_final-total6 CURRENCY int_bsik-waers,
    151 sy-vline,
    152 int_final-total CURRENCY int_bsik-waers,
    168 sy-vline.
    ENDIF.
    FORMAT COLOR OFF.
    HIDE int_final.
    CLEAR int_final.
    v_flag = 0.
    ENDIF.
    AT LAST.
    WRITE : /1(168) sy-uline.
    FORMAT COLOR 3 INTENSIFIED.
    WRITE : /1 sy-vline, 2(47) 'GRAND TOTAL'(022) CENTERED,
    49 sy-vline, 50 v_gtotal1 CURRENCY int_bsik-waers,
    66 sy-vline, 67 v_gtotal2 CURRENCY int_bsik-waers,
    83 sy-vline, 84 v_gtotal3 CURRENCY int_bsik-waers,
    100 sy-vline,101 v_gtotal4 CURRENCY int_bsik-waers,
    117 sy-vline,118 v_gtotal5 CURRENCY int_bsik-waers,
    134 sy-vline,135 v_gtotal6 CURRENCY int_bsik-waers,
    151 sy-vline,152 v_gtotal CURRENCY int_bsik-waers,
    168 sy-vline.
    HIDE : v_gtotal1,
    v_gtotal2,
    v_gtotal3,
    v_gtotal4,
    v_gtotal5,
    v_gtotal6,
    v_gtotal.
    ENDAT.
    FORMAT COLOR OFF.
    ENDLOOP.
    WRITE : /1(168) sy-uline.
    ENDFORM. " basic_list
    *& Form line_selection
    When double clicked on the line display the seconday list
    FORM line_selection .
    NEW-PAGE LINE-SIZE 206.
    Sy-lsind = 1.
    DATA : v_rem,v_cnt LIKE sy-tabix.
    v_cnt = 0.
    SORT int_bsik BY belnr zfbdt.
    LOOP AT int_bsik WHERE lifnr EQ int_final-lifnr.
    v_rem = v_cnt MOD 2.
    CLEAR v_date.
    IF int_bsik-zbd3t ' '.
    v_date = int_bsik-zfbdt + int_bsik-zbd3t.
    ELSE.
    IF int_bsik-zbd2t ' '.
    v_date = int_bsik-zfbdt + int_bsik-zbd2t.
    ELSE.
    v_date = int_bsik-zfbdt + int_bsik-zbd1t.
    ENDIF.
    ENDIF.
    IF int_bsik-zbd1t = ' '.
    v_date = int_bsik-zfbdt.
    ENDIF.
    IF v_rem NE 0.
    format color 2 intensified.
    WRITE :/1 sy-vline, 2 int_bsik-belnr,
    12 sy-vline,13 int_bsik-lifnr,
    23 sy-vline,24 int_bsik-name1,
    59 sy-vline,60 int_bsik-xblnr,
    76 sy-vline,77 int_bsik-zfbdt,
    87 sy-vline.
    WRITE : 104 sy-vline,121 sy-vline,
    138 sy-vline,155 sy-vline,
    172 sy-vline, 189 sy-vline,
    190 int_bsik-dmbtr CURRENCY int_bsik-waers,
    206 sy-vline.
    IF v_date IN r_date1.
    v_subtotal1 = v_subtotal1 + int_bsik-dmbtr.
    WRITE : 88 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEIF v_date IN r_date2.
    v_subtotal2 = v_subtotal2 + int_bsik-dmbtr.
    WRITE : 105 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEIF v_date IN r_date3.
    v_subtotal3 = v_subtotal3 + int_bsik-dmbtr.
    WRITE : 122 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEIF v_date IN r_date4.
    v_subtotal4 = v_subtotal4 + int_bsik-dmbtr.
    WRITE : 139 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEif v_date > r_date4-high.
    v_subtotal5 = v_subtotal5 + int_bsik-dmbtr.
    WRITE : 156 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEif v_date < p_allgst.
    v_subtotal6 = v_subtotal6 + int_bsik-dmbtr.
    WRITE : 173 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ENDIF.
    format color off.
    ELSE.
    WRITE :/1 sy-vline, 2 int_bsik-belnr,
    12 sy-vline,13 int_bsik-lifnr,
    23 sy-vline,24 int_bsik-name1,
    59 sy-vline,60 int_bsik-xblnr,
    76 sy-vline,77 int_bsik-zfbdt,
    87 sy-vline.
    WRITE : 104 sy-vline,121 sy-vline,
    138 sy-vline,155 sy-vline,
    172 sy-vline,189 sy-vline,
    190 int_bsik-dmbtr CURRENCY int_bsik-waers,
    206 sy-vline.
    IF v_date IN r_date1.
    v_subtotal1 = v_subtotal1 + int_bsik-dmbtr.
    WRITE : 88 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEIF v_date IN r_date2.
    v_subtotal2 = v_subtotal2 + int_bsik-dmbtr.
    WRITE : 105 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEIF v_date IN r_date3.
    v_subtotal3 = v_subtotal3 + int_bsik-dmbtr.
    WRITE : 122 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEIF v_date IN r_date4.
    v_subtotal4 = v_subtotal4 + int_bsik-dmbtr.
    WRITE : 139 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEif v_date > r_date4-high.
    v_subtotal5 = v_subtotal5 + int_bsik-dmbtr.
    WRITE : 156 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEif v_date < p_allgst.
    v_subtotal6 = v_subtotal6 + int_bsik-dmbtr.
    WRITE : 173 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ENDIF.
    ENDIF.
    FORMAT COLOR OFF.
    v_cnt = v_cnt + 1.
    ENDLOOP.
    WRITE : /1(206) sy-uline.
    v_subtotal = v_subtotal1 + v_subtotal2 + v_subtotal3
    + v_subtotal4 + v_subtotal5 + v_subtotal6.
    FORMAT COLOR 3 INTENSIFIED.
    WRITE : /1 sy-vline,
    2(85) 'Total'(017) CENTERED CURRENCY int_bsik-waers ,
    87 sy-vline,
    88 v_subtotal1 CURRENCY int_bsik-waers,
    104 sy-vline,
    105 v_subtotal2 CURRENCY int_bsik-waers,
    121 sy-vline,
    122 v_subtotal3 CURRENCY int_bsik-waers,
    138 sy-vline,
    139 v_subtotal4 CURRENCY int_bsik-waers,
    155 sy-vline,
    156 v_subtotal5 CURRENCY int_bsik-waers,
    172 sy-vline,
    173 v_subtotal6 CURRENCY int_bsik-waers,
    189 sy-vline,
    190 v_subtotal CURRENCY int_bsik-waers,
    206 sy-vline.
    FORMAT COLOR OFF.
    WRITE : /1(206) sy-uline.
    CLEAR : v_subtotal,v_subtotal1,v_subtotal2,v_subtotal3,
    v_subtotal4,v_subtotal5,v_gtotal1,v_gtotal2,v_gtotal3,
    v_gtotal4, v_gtotal5,v_gtotal,v_subtotal6,v_gtotal6.
    ENDFORM. " line_selection
    *& Form header1
    Secondary List Header
    FORM header1 .
    Standard header
    clear: v_date1, v_str, v_str1, v_tage.
    write p_allgst to v_date1.
    Move p_tage4 to v_tage.
    concatenate '>' v_tage text-025 into v_str1.
    concatenate
    'Details of Ageing Analysis for Vendor Open Invoices as on'(024)
    v_date1 into v_str separated by space.
    CALL FUNCTION 'Z_STANDARD_HEADER'
    EXPORTING
    title1 = 'Saudi International Petrochemical Company'(012)
    title2 = v_str.
    FORMAT COLOR 1 intensified.
    WRITE :/1(206) sy-uline.
    WRITE :/1 sy-vline,12 sy-vline ,
    23 sy-vline,59 sy-vline,76 sy-vline,87 sy-vline,
    88(101) 'Invoices Due For(In Days)'(014) CENTERED,
    189 sy-vline,206 sy-vline.
    WRITE : /1 sy-vline, 2(10) 'Doc Number'(021) CENTERED,
    12 sy-vline, 13(10) 'Vendor#'(015) CENTERED,
    23 sy-vline, 24(35) 'Vendor Name'(016) CENTERED,
    59 sy-vline, 60(16) 'Ref invoice#'(019) CENTERED,
    76 sy-vline, 77(10) 'Inv dt'(020) CENTERED,
    87 sy-vline, 88(101) sy-uline,
    189 sy-vline,190(16) 'Total'(017) CENTERED,
    206 sy-vline.
    WRITE : /1 sy-vline, 12 sy-vline,
    23 sy-vline,59 sy-vline,
    76 sy-vline,87 sy-vline,
    88(16) v_fir CENTERED, 104 sy-vline,
    105(16) v_sec CENTERED, 121 sy-vline,
    122(16) v_thir CENTERED, 138 sy-vline,
    139(16) v_four CENTERED, 155 sy-vline,
    156(16) v_str1 CENTERED,
    172 sy-vline,
    173(16) 'Already Overdue'(018) CENTERED,
    189 sy-vline,
    206 sy-vline.
    format color off.
    WRITE : /1(206) sy-uline.
    ENDFORM. " header1
    The below link will give Tables & Relations.
    http://www.erpgenie.com/abap/tables.htm
    http://goldenink.com/abap/files_in_sap.html
    http://abap4.tripod.com/SAP_Tables.html
    http://www.geocities.com/sapcircle/Relations.pdf
    regards,
    indranil

  • Vendor Delivery Performance by Material

    Is there an SAP Report that provides Vendor Delivery Performance by Material over a stated time period?

    I have answered my own question.  You can run MC$6 or MC$8 and switch the drilldown to material if anyone is interested.

  • Oracle Hyperion Performance Reporting Suite

    Hi All,
    I am a newbie to Hyperion. We have Oracle Hyperion Performance Reporting Suite* as our front end for reporting in my current assignmnent.
    I have previously worked with other OLAP tools and was eager to know what essentiallly does this sute contains of which my customer is looking for.
    Would appreciate if someone can let me know the tools the stated suite consists of for Oracle Hyperion 9.3 as our Application Server....
    Thanks in advance,
    Cheers!!!
    Any inputs for my query!!!
    Edited by: Neela on Feb 17, 2009 11:47 PM

    Set the system configuration.
    Windows XP 2003 SP2
    Database : oracle / sql
    Installl : Oracle EPM Suite the following components:
    -Oracle EPM Foundation / Shared Services
    -Oracle EPM Performance Scorecard
    Please check and confirm.
    regards,
    Apo

  • GT70 2PC – Software testing and performance report.

    It is so excited here again. Currently, my first/only object after work is playing Titanfall.
    I intended to share another performance testing today. But I didn’t. I found there are too many great open box posts on different forums. Therefore, I decide to dig the MSI software compatibility and do a touring. What can I say? I’m Mr.Curiosity who really desires to know every built-in application in system. That is why I share this article with you, my friends. I would like to discuss with everybody who is interested in MSI software. Of course, I have some performance reports for you, too. Please also remind me if you find any typo/wrong in this post. Thanks in advance.  
    1. MSI Boot Configure
        This is the first software which pops up immediately. It is thoughtful design because we can choose enter the [Windows 8.1 metro] or [desktop] by ourselves now. I give it two thumbs up!!!
    Select your favorite boot configuration and press [OK]. If we want it work immdiately, we can logout the system and re-login again.
    2.   MSI Remind Manager
    Honestly, I didn’t know what it is in the beginning. The cute robot shows every time when I login the system. I found this is a reminder for product registration. Good, I would like to have best MSI support and warranty for my lovely GT70 2PC. But don’t worry, if you don’t want to get this message again, you just need to select the right option and close it.
    3.   Synaptics TouchPad
    This is a driver for mouse. [Mouse property] will show if we do the double clicks on TouchPad icon in tray. You can choose enable/disable internal pointing device when external pointing device is attached. This is brilliant. A tough guy (like me…HA! HA!) didn’t like to play game with touchpad. Because the character in game will be weak and slow if I control it by touchpad. Of course, I need the external mouse all the time and don’t want the interference from touchpad.
    4.   System Control Manager (SCM)
    We can enable/disable the WLAN/BT/camera devices by SCM. Besides, it can control the display brightness, volume, screen on/off and ECO. ECO is special mode for gaming watching movie.  
    5.   Sound Blaster CINEMA
    Sound Blaster CINEMA is come from an old school audio company – CREATIVE. The software can adjust the surround sound easily. We also can adjust 5.1/7.1 surround sound for the internal speakers and external headphone. That is great, isn’t it?
    Besides, we can also adjust CRYSTALIZER/BASS/SMART VOLUME/digital output by ourselves.
    6.   Killer Network Manager
    This is a major feature of MSI NB.
    In Killer Network Manager, we can set the network priority for each of applications and we also can abandon the connection from malicious software.
    [Performance] shows current status of network. We can find out which application occupied the most greedy resources by it.
    [Network -> Test Network Speed] will detect the network environment automatically. Furthermore, it will adjust the priority for applications.
    [Killer Ethernet] show the LAN connection info.
    [Killer Wireless] show the router info.
    7.   SteelSeries Engine
    This is another major feature of MSI NB
    If we do the right click on icon in tray, the menu will show following list. We can select [Launch SteelSeries Firmware Update Tool], [Updates]…and so on.
    If we select the [Settings]. It can help us change default language and set application auto running when system power on.
    I.   Buttons
    Double click to open the SteelSeries Engine. I think it can set 4 different keyboard settings for each of profiles. And it can switch by FN+1~4.
    [Keypress Marc] can record what you input. And [Record Delays ] can modify the delay time. HA! No game can block us anymore. Please remember to press the [SAVE] for your setting
    [Launch Application] can launch any application immediately. I suggest to set the cold key for this function.
    Here is example. I use [PgUp] to quick start the 3D Mark11. See, it will pop up when I pressed [PgUp].
    It is simple to use [TextMarco] set our own phrase. Now I become a quick speaker in my team. One key, only one key can help me to type a lot of words.
    Are you tired to press some keys that you never want to touch in game (Like WIN KEY)? It is not the problem now.  [Disable Key] will do the favor and disable any key which you hate.
    II.   [Colors] can change the color of backlight keyboard. Also, you can set different modes (Gaming/Audio…etc) on it.
    We can change the color zone. There is not only 4 or 5 colors. The engine provides thousands of colors for us. [Audio mode] is the coolest. It will change colors by itself when we play music by speakers. I like to dance with my keyboard.
    III.   We can select different languages by [Settings].
    IV.   [Properties] can save our hard works of settings reliably.
    V.   If you want to defeat your competitors, it is important to know your enemy. However, It is more important to know yourself. [Statistics] can help us observe which keys are most popular by our fingers.
    Right click on [Profile]. It can modify/export/import/delete the profiles.
    Mouse can use the same kind of settings as keyboard.
    DPI setting for mouse.
    Save files.
    We can record the mouse, too.
    8.   Norton
    Norton Internet Security: Anti-Virus software, MSI provides 60 days for free.
    Norton Online Backup: Online data backup software, MSI provides 30 days for free.
    Norton Anti-Theft: Anti-Theft software, MSI provides 30 days for free.
    If you like Norton’s products, you can buy it online.
    If you don’t, I believe we can uninstall it directly.
    So, the decision is ours.
    Introduction from Norton official website
    9.   Dragon Gaming Center
    I.   System Monitor:
    It can monitor CPU/GPU loading and temperature. We also can find the network speed and fan speed in it.  
    II.   Utility:
    You can set your favorite apps in [Add new Utility].
    E.g. I added a [MSI Afterburner]. Click [Open] to build the link. Do you feel familiar with something? Exactly, [Launch Application] of [SteelSeries Engine] can do this, too.
    III.   Instant Play:
    We can define [Fn+F4] to enable the quick start. But there is more secret.
    We can also use [Browse] to assign the game which we want.  
    Click the icon of game and [Fn+F4] will be ready. We can only use 1 program at once.  
    I usually change the brightness, volume and mouse sensitive before the game. As you know, every games are different. It is sweet because we can use  [Apply Setting] to do this.
    I can’t believe it. We also can find the clock feature in it. How convenient it is!
    IV.   Hybrid Power is another MSI feature.
    It can provide the power by AC adapter and battery in the same time. We can monitor the status in here.
    10. BurnRecovery
    It can create the recovery CD/DVD/USB for MSI NB.
    Here can select Recovery disc/USB/ISO.
    I will make a ISO file first.
    We can select where to put the ISO.
    Creating the recovery file...
    Finish!
    Open the folder and we can find 4 ISO files in it.
    Well…[BurnRecovery Help] provide the details spec.
    In my opinion, everyone should create their own recovery image. You will need it in one day.
    11. Battery Calibration
    This is software for battery calibration. In order to keep our battery good, we should do the calibration every three months. Don’t forget to plug-in the AC adapter and battery during the process..
    Press [Start] to begin the process. It will make the battery fully charged first.
    Then, it will empty the battery like this.
    System will shut down after the empty process. At last, fully charged again. It will take 4~5 hrs to complete the process.
    12. MSI Dragoon Army /MSI Facebook /Web site /YouTube
    Those are MSI forums/Facebook/official website/YouTube and links.
    [MSI Dragoon Army] is the official forum for MSI. We can find NB, MB and AIO info in it.
    Facebook Quick Link for many countries of world.
    MSI official website
    YouTube channel of MSI.
    13. Super-Charger
    There is no message when I click this app at the first time. But when I attached my IPAD, it pops up the [Super-Charger]. It is amazing because IPAD can’t be charge by this USB port. As far as I know, the USB 3.0 only provides maximum 900mA for its device. IPAD will need 2.1A for charge process. I have no idea how MSI NB make IPAD charging okay.
    14. XSplit GameCaster
    This is one of important features. I saw many different first class gaming machines this year. All of them have the broadcast software. (Like PS4, Xbos ONE)
    It can switch the default language after we login.
    Twitch/YouTube / Facebook/ Twitter/Google+ can be used by [Accounts]. It is easy to start the live show.
    We can modify the resolution and use twitch by [Setting]
    We can configure FPS/CPU loading/where to show on display by [Status label].
    Hotkey configuration.
    Videos storage.
    Press [Ctrl+Tab] to call Gamecaster in game. And we can twitch or modify setting. I will provide my gaming video for you later.
    15. Power DVD
    This is a famous video player. Also, it can support BD format.
    We can use the [Setting] to change our language.
    We can change 5 times for default country .
    It is glad that I’ve finished the introduction of GT70 software.
    Performance report:
    Um…Now is late at night. I should go to my lovely bed.  Following is the testing report for the reference.
    1.   FurMark
    1920*1080, 15 minutes.
    2.   AIDA 64
    CPU and GPU stress testing, 30 minutes.
    3. 3D Mark 11
    4. 3DMark Vantage
    5.   3DMark 2013
    6.   Heaven Benchmark 4.0
    7.   CINBENCH 11.5
    8.   FINAL FANTASY XIV Benchmark
    9.   PCMARK 7
    10.   HD Tune Pro  5.50
    11.   AS SSD Benchmark
    12.   Crystal Disk Mark
    I didn’t forget my promise. Here is my gaming videos
    http://youtu.be/tCd5Lnj2U0I

    Editors' Choice Award. Good job MSI !!
    http://www.computershopper.com/laptops/reviews/msi-gt70-dominator-893#review-body

  • Unable to change RFC destination in IT Performance reporting wizard

    Hi Experts,
    I am setting up IT Performance Reporting in my Solman EHP1 system. In the first page of the PErformance reporting wizard, it asked me for RFC destination from BI to Solman(1st field) and Solman to BI (2nd field). I initially entered an existing RFC destination that we are already using in a separate application that has a user with very-limited authorization. Now, I am trying to change the RFC destination by running the same "Configure IT Performance Reporting" wizard but both fields are already GREYED out.
    I tried deleting the RFC destination previously defined in an attempt to reenable the fields but only the 2nd field was enabled. When I try to continue the setup, it results into a Shortdump because it is still looking for the initially defined RFC dest which is defined in the 1st field that cannot be edited.
    SAP has not yet provided us with a solution.Your help is greatly appreciated.
    Thank you very much.

    You canprovide the RFC destination in DOE administration portal. Goto Configurations link and search for "BACKEND DESTINATION" parameter in "BACKEND CONFIGURATION" link. Here you can provide RFC destination at SWCV level or at Data object level.
    After deleting RFC destination in SM59, it will never take you to backend system.

Maybe you are looking for