Sales Report in XL Reporter within Bill Of Materials Components

Hello @ all,
I've tried to create a XL Report, to know which and how many components of the BOMs are sold.
It should look like this example:
article no.12345 (BOM)         sold 10x
- component No. 1----
10x
- component No. 2----
20x
- component No. 3----
30x
The BOM 12345 consits of 1x component No. 1, 2x component No. 2, 3x component No. 3
Please can anybody give me a hint???
Thanks in advance!
Thorsten
Edited by: Philip Eller on May 16, 2008 8:56 AM
Edited by: Philip Eller on May 30, 2008 8:46 AM*

Hello,
I think it is not possible to get only BoM items that have sold.
BoM information can only be found in Production module in XL Reporter but to get sales information, this should be done in Sales module.
I think there are no link between them.
Just for your information, to get the BoM list in XLR,
go to Production module>
choose Product Tree dimension> items dimension(this will choose items that have BoM defined) > Quantity measure(this will list quantities assigned in BoM for each child items.)
In Sales module, you can choose all items where to show the sales information.
Regards,
Maggie An
SAP Business One Forum Team

Similar Messages

  • Sales Report containing billing quantity, net price et al

    Is there a standard report available that can provide a list of billing document no, date, quantity, net price, sold-to party, material & gross billing ?

    try VF05N but u cant find material number and quantity in it. in VF05 u can get these things but no invoice price. For your requirement you need to create your own report in SQVI with tables VBRP and VBRK join the billing document field VBELN and select fields which you want in selection screen and output. Its very easy to do. Just try SQVI

  • Actual Billing Amount is missing In Add on Sales Report

    HI
    Actual Billing Amount is missing In Add on Sales Report in MCSI Report S888
    pls give me solution for that

    Hi Standard Repor MCSI S800  ADD ON Sales  Report will not refelect the Actual Billed amount
    Sales Document     Planned billed amou Actual billed amoun   Order quantity
    Total               15.283.122,97  SAR     595.000,00  SAR        1.820,00 PC
    0002386337             382.501,00  SAR           0,00  SAR            3,00 PC
    0002392610             388.001,00  SAR           0,00  SAR            2,00 PC
    0002428791             275.343,50  SAR           0,00  SAR          167,00 PC
    0002431339             486.965,90  SAR           0,00  SAR          329,00 PC
    0002439394             275.343,50  SAR           0,00  SAR          167,00 PC
    0002481207             486.965,90  SAR           0,00  SAR          329,00 PC
    0002549697             511.000,00  SAR           0,00  SAR           14,00 PC
    0002602797             170.001,00  SAR           0,00  SAR            2,00 PC
    0002623399           5.404.342,50  SAR           0,00  SAR           13,00 PC
    0002686878           1.540.868,50  SAR           0,00  SAR            5,00 PC
    0002723899              10.896,00  SAR           0,00  SAR            2,00 PC
    0002743823             539.884,40  SAR           0,00  SAR            8,00 PC
    0002764196             595.000,00  SAR     595.000,00  SAR           14,00 PC
    0002772537             890.271,35  SAR           0,00  SAR          184,00 PC
    0002777276             646.505,70  SAR           0,00  SAR           36,00 PC
    0002777277             646.505,70  SAR           0,00  SAR           36,00 PC
    0002787438             619.859,90  SAR           0,00  SAR          214,00 PC
    0002790579              55.112,56  SAR           0,00  SAR            9,00 PC
    0002796899             232.200,00  SAR           0,00  SAR            8,00 PC
    0002797204             561.838,85  SAR           0,00  SAR           58,00 PC
    0002810834             508.599,00  SAR           0,00  SAR          207,00 PC
    0002827936              55.116,71  SAR           0,00  SAR           13,00 PC

  • Region wise Sales Report / Sales Analysis

    Hi,
             I have a requirement of Region wise sales report. I have searched in the forum and found that I could acheive it through SE16-->VBRK-->REGIO field . I have tried executing the same, but the problem is when ever i am trying to pull up the sales for a particular region the system is giving an invoice number. But when I go to that particular invoice and see the PAYER , the PAYER is in the different region.
             Please let me know which region the system considers at the table level. I mean to ask which region the system considers for a particular transaction.
    Thankyou,
    Rakesh Tummala.

    Hello Rakesh,
    I am facing a similar issue that you are facing.  Yes, there is a region populated on the billing document in table VBRK.  However, depending on how your order entry is configured, the region listed in the billing document isn't necessarily the region the materials were shipped to.  To fine tune your requirement, are you looking for a report where the ship-to address is in a specific region or where the payer or sold-to address is in a specific region?
    If it's the ship-to address in a specific region, you'll need to develop a table join query in SQ01.  Join the tables VBRK --> VBPA --> ADRC.  VBRK is the billing document header table.  VBPA is the partner table where SH (ship-to partner) can be determined and it gives you an address code.  ADRC is the Business Address Services table that reads the address code and provides the address.  In the next step, make sure ADRC-REGION is a selection field so that you can specify the region.  Then, run the query, ensure VBRK-NETWR is an available field so that you can calculate the net value of billing documents for the specified region.
    If it's the payer or sold-to address in a specific region, this is easier since it's master data and not transaction-specific data (remember, your customer service group could be manually changing the ship-to location when creating a sales order, which is why you would need to follow the aforementioned steps).  You can do a quick search for accounts within a specified region then obtain the information in VBRK for the specified payers.
    I hope this information helps you, please provide questions if you need further clarification.

  • Material Type Vs Sales report.. Urgent

    my client requires materail type vs sales report for particaular period... is there any standard report for these.. or how can we do with a ABAPer.. wat fields we have give to ABAper.... to get the report....
    Kiran

    Hi Kiran,
    Please find the herewith the SAP SD Standard Reports.
    Reports: Reports consist of data, which is expected to be reveiwed or checked the transaction taken in said period. Reports are useful for analysis of decision taking for future activities.
    Some of the standard reports for SD & its configuration guide is as under:
    Standard SAP SD Reports:=
    Statistic Group:
    Purpose – To capture data for Standard Reports, we require to activate Statistic Group as under:
    --> Item category (Configuration)
    --> Sales document type (Configuration)
    --> Customer (Maintain in Master data)
    --> Material (Maintain in Master data)
    When you generate statistics in the logistics information system, the system uses the combination of specified statistics groups to determine the appropriate update sequence. The update sequence in turn determines for exactly which fields the statistics are generated.
    Configuration:
    IMG --> Logistics Information System (LIS) --> Logistics Data Warehouse --> Updating --> Updating Control --> Settings: Sales --> Statistics Groups -->
    1. Maintain Statistics Groups for Customers
    2. Maintain Statistics Groups for Material
    3. Maintain Statistics Groups for Sales Documents
    4. Assign Statistics Groups for Each Sales Document Type
    5. Assign Statistics Groups for each Sales Document Item Type.....
    All Standard Reports which are available are as under:
    SAP Easy Access: Information Systems -> Logistics -> Sales and distribution ->
    1. Customer -> Incoming orders / Returns / Sales / Credit memos / Sales activities / Customer master / Conditions / Credit Master Sheet
    2. Material -> Incoming orders / Returns / Sales / Credit memos / Material master / ...
    3. Sales organization -> Sales organization / Sales office / Sales employee
    4. Shipping point -> Deliveries / Returns
    5. SD documents -> Orders / Deliveries / Billing documents ...
    & so on.
    Some of the Standard reports in SD are:
    Sales summary - VC/2
    Display Customer Hierarchy - VDH2
    Display Condition record report - V/I6
    Pricing Report - V/LD
    Create Net Price List - V_NL
    List customer material info - VD59
    List of sales order - VA05
    List of Billing documents - VF05
    Inquiries list - VA15
    Quotation List - VA25
    Incomplete Sales orders - V.02
    Backorders - V.15
    Outbound Delivery Monitor - VL06o
    Incomplete delivery - V_UC
    Customer Returns-Analysis - MC+A
    Customer Analysis- Sales - MC+E
    Customer Analysis- Cr. Memo - MC+I
    Deliveries-Due list - VL04
    Billing due list - VF04
    Incomplete Billing documents - MCV9
    Customer Analysis-Basic List - MCTA
    Material Analysis(SIS) - MCTC
    Sales org analysis - MCTE
    Sales org analysis-Invoiced sales - MC+2
    Material Analysis-Incoming orders - MC(E
    General- List of Outbound deliveries - VL06f
    Material Returns-Analysis - MC+M
    Material Analysis- Invoiced Sales - MC+Q
    Variant configuration Analysis - MC(B
    Sales org analysis-Incoming orders - MC(I
    Sales org analysis-Returns - MC+Y
    Sales office Analysis- Invoiced Sales - MC-E
    Sales office Analysis- Returns - MC-A
    Shipping point Analysis - MC(U
    Shipping point Analysis-Returns - MC-O
    Blocked orders - V.14
    Order Within time period - SD01
    Duplicate Sales orders in period - SDD1
    Display Delivery Changes - VL22
    Please Reward If Really Helpful,
    Thanks and Regards,
    Sateesh.Kandula

  • LIS Sales Reports

    Dear Friends
    When I am using stand Sales Reports in LIS (MCA,MC(A, MCA, MC+2 ) I am getting report when I have entered only Date but not with customer or Article. 
    I am getting Error that "No data exists for chosen selection"
    I have maintained Customer statics group as well as Material statics group in customer & material Master  respectively
    Even I have assignments in OVRP and OVRO what need to check to get the report.
    Regards
    sudha

    Sudha,
    Hope this helps you.
    Transaction Codes for Standard Reports used in SD Module.
    Sales summary - VC/2
    Display Customer Hierarchy - VDH2
    Display Condition record report - V/I6
    Pricing Report - V/LD
    Create Net Price List - V_NL
    List customer material info - VD59
    List of sales order - VA05
    List of Billing documents - VF05
    Inquiries list - VA15
    Quotation List - VA25
    Incomplete Sales orders - V.02
    Backorders - V.15
    Outbound Delivery Monitor - VL06o
    Incomplete delivery - V_UC
    Customer Returns-Analysis - MC+A
    Customer Analysis- Sales - MC+E
    Customer Analysis- Cr. Memo - MC+I
    Deliveries-Due list - VL04
    Billing due list - VF04
    Incomplete Billing documents - MCV9
    Customer Analysis-Basic List - MCTA
    Material Analysis(SIS) - MCTC
    Sales org analysis - MCTE
    Sales org analysis-Invoiced sales - MC+2
    Material Analysis-Incoming orders - MC(E
    General- List of Outbound deliveries - VL06f
    Material Returns-Analysis - MC+M
    Material Analysis- Invoiced Sales - MC+Q
    Variant configuration Analysis - MC(B
    Sales org analysis-Incoming orders - MC(I
    Sales org analysis-Returns - MC+Y
    Sales office Analysis- Invoiced Sales - MC-E
    Sales office Analysis- Returns - MC-A
    Shipping point Analysis - MC(U
    Shipping point Analysis-Returns - MC-O
    Blocked orders - V.14
    Order Within time period - SD01
    Duplicate Sales orders in period - SDD1
    Display Delivery Changes - VL22

  • Unable to generate Sales Report of Business Partner  by State-XL Reporter

    We are not able to generate Sales Report of Business Partner  by State using XL Reporter.
    The issue is that we can not access the Bill to State for BPs, or for that matter the Ship-to State.  We can access Bill T street, block, city, country u2013 everything except state.
    There is a CRD State, but for sales reports this is useless.  Can someone advise on this?
    Thanks in advance,
    Srini

    You can get around this by creating a UDF and formatted search to populate it.
    The XL Report can then be created, but, watch out on upgrade - XL Reports with UDF's are not easy on upgrade, especially where the UDF will be a run parameter. I often have to re-write after upgrade, so store a base one without the parameter setting

  • Sales Report problem with 2LIS_11_VAHDR, 2LIS_11_VAITM and other DS

    Hi Experts,
    I need your help in following topic. I have a requirement to build a big (overall) sales report in BI (NW2004s).
    I would like to use BI Content because I'm running out of time and try to use all preconfigured stuff if possible.
    In the requirement a bunch of fields of different SD DataSources are used (mostly 2LIS_11_VAHDR and 2LIS_11_VAITM but also some fields of other Datasources).
    In SE16 I know how to locate all the field in the tables VBAK, VBAP, KNA1, VBKD,
    LIKP, VBRK and of course some texts. Some fields could already be located by me, others couldn't even be found in BI.
    The difficulty I have is to bring all the DataSources together so that the data is displayed correct - even if there are redundant parts.
    For example:
    For sales orders the doc no, sales org, distr. channel (and a lot of other header data) should be displayed in each line together with item data such as item no., material code, quantity (and a lot of other item data). If an order has multiple items each item should be diplayed in one row in the report.
    In the Query the report should look like a common table (e.g. as in an ALV Grid if you model a query with SQ01) --> a lot of columns.
    I'm not sure if I should use one big DSO with multiple InfoSources or if I should create a MultiCube and add the BI DSOs 0SD_O03 (Orders) and 0SD_O01(Order Items).
    I know this is a very common requirement in SD. Do you know how to combine the most common SD datasources that no issues come up?
    Thank you very much in advance,
    Horst
    Message was edited by:
            Horst Henkel

    Hi Horst,
    Reporting on ODS / DSo is slow. I'm here at a cleint where we have lots of reports on SD_O01 and SD_O03. The best way to have good  query performance is to build cubes on top of your ODS. Build a sales cube on top of SD_O03 with all fields and a billing cube on top of SD_O01. Load the data from your ODS to your new cubes. Then create a multipovider on top of both cubes, identify the keyfigures and characteristics required for your queries. Build the queries on top of the multiprovider.
    You can display all items of a bill in one row if you choose drill-across for the irems in the query, instead of drill-down. So it looks for a standard SD report.
    Regards,
    Juergen

  • Sales employee wise sales report

    Hi,
    Can anyone explain me,how to write functional specifications to obtain sales employee wise sales report?
    Thanks in advance..
    Regards..
    Yogi...

    Hi
    This is the standard T Code for sales employee-MCTI
    But as per your requirement we hv to create.
    Examplemy past implimantation..we hv captured sales employee as partner function.sales employee1& 2  with peoper  partner determination proceture.then we hv captured at Billing document Header Partner function.
    This Sales employee name has to captured through HR Master data.According U hv to say only the business process and from where data has to captured to ABAPER.
    I think it ll help
    Regards
    JAGA

  • Sales report ship to party wise

    I want to see the sales report for each ship to pary wise.
    Sold to, bill to n payer remain same.
    Reg,
    Madhu

    For that in VF05 report, you need to have ship to party as one of your selection option which you can achieve as follows:-
    IMG --> Sales and Distribution --> Sales --> Lists --> Set Updating of Partner Index.  Here, maintain the following values.
    Transaction Group      Partner Function
               7                 SH
    Now go to VF05,  click on "Partner function" tab,  select SH and execute.
    thanks
    G. Lakshmipathi

  • Sales report: Profit center wise includes net, gross and sales tax URGENT

    Helllo Friends,
    Please help me on the below report
    Client requirement is: Sales report which includes the below
    1. Profit center
    2. Net sales
    3. Sales tax
    4. Gross sales
    5. Period
    Please help me
    Thanks for your help in advance
    Narasim

    Hi,
    You will have to get a Z report developed for  this requirement, it will be a Sales Register looking at the requirement
    Firstly discuss with the client and finalize the selection screen , based on which parameters the client wants nto check this report
    1. Customer
    2. Billinng Document
    3. Sales Area
    4. Billing Type
    5, Period
    And based on this system can collect all the billing documents (except cancelled) and pick up the required values from the billing document tables.
    Finalize if the client would also like to see the all the discounts, freights, rebate (if any) , taxes (separetly) , exchange rates (exports) and any other condition types, this will save all the modifications in the future.
    Also finalize what all billing types have to be excluded, like cancelled, credit notes, debit notes etc and also how the values have to be displayed, rounded off.

  • Can i get month, quarterly, half yearly, yearly wise sales report basing on

    hi,
    sap gurus,
    good evening to all,
    how can i get month, quarterly, half yearly, yearly wise sales report basing on division and material.
    is there any std transaction code for that.
    customization is requried for that.
    regards,
    balaji.t
    09990019711

    Standard SAP SD Reports:=
    Statistic Group:
    Purpose u2013 To capture data for Standard Reports, we require to activate Statistic Group as under:
    --> Item category (Configuration)
    --> Sales document type (Configuration)
    --> Customer (Maintain in Master data)
    --> Material (Maintain in Master data)
    When you generate statistics in the logistics information system, the system uses the combination of specified statistics groups to determine the appropriate update sequence. The update sequence in turn determines for exactly which fields the statistics are generated.
    Configuration:
    IMG --> Logistics Information System (LIS) --> Logistics Data Warehouse --> Updating --> Updating Control --> Settings: Sales --> Statistics Groups -->
    1. Maintain Statistics Groups for Customers
    2. Maintain Statistics Groups for Material
    3. Maintain Statistics Groups for Sales Documents
    4. Assign Statistics Groups for Each Sales Document Type
    5. Assign Statistics Groups for each Sales Document Item Type .....
    All Standard Reports which are available are as under:
    SAP Easy Access: Information Systems -> Logistics -> Sales and distribution ->
    1. Customer -> Incoming orders / Returns / Sales / Credit memos / Sales activities / Customer master / Conditions / Credit Master Sheet
    2. Material -> Incoming orders / Returns / Sales / Credit memos / Material master / ...
    3. Sales organization -> Sales organization / Sales office / Sales employee
    4. Shipping point -> Deliveries / Returns
    5. SD documents -> Orders / Deliveries / Billing documents ...
    & so on.
    Regards,
    Rajesh banka

  • Regarding Sales  Reports MC+Q and MCSI

    Dear all,
                    I want to know about sales report MC+Q and MCSI,
                   What data are coming into following columns of these reports :
                   1.  Sales
                  2. Net Inv. Sales 1
                  3. Net Inv. Sales 2
    Thanks & regards,
    Sandip Sonar.

    Hi,
    Sales-Net Value (from billing)
    Net Inv. Sales 1-Subtotal 2 (KOMP-KZWI2)
    Net Inv. Sales 2-Subtotal 2 (KOMP-KZWI3)
    Regards
    Sanjay

  • Urgent: sales report

    Hi All,
    I want to devlop a sales report,
    please can any one explain me how to write select and go ahead
    the requiremnet is like this
    Based on selection criteria
    Sales organisation (VBRK-VKORG),
    Distribution channel (VBRK-VTWEG),
    Division (VBRK_SPART),
    Billing date(VBRK-ERDAT),
    Customer (VBRK-KUNAG),
    plant (VBRP-WERKS), and
    Material Group1(VBRP-MVGR1).
    Check if VBRK-FKSTO # X, VBRK-RFBSK = C, VBRK-FKART #S1 and S2, take all VBRK-VBELNs (Print in Invoice number ).
    VBRK-ERDAT(Print in Invoice Date).
    Pass VBRK-VBELN to VBRP-VBELN and check for every VBRP-MVGR1 pass VBRP-POSNR to KONV-KPOSN and
    For KONV-KSCHL =’ZPTS” sum all KONV-KWERT and display(PTS value).
    For KONV-KSCHL =”YNRV” sum all KONV-KWERT and display(NRV Value).
    thanks in advacne
    points will be rewarded if it is use full
    jay

    Hi,
    Refer this code.
    REPORT  z_daily_sales
            NO STANDARD PAGE HEADING
            MESSAGE-ID sabapdocu.
                          TABLES                                         *
    TABLES : vbak,                              "Sales Document: Header Data
             tfacs,                             "Factory calendar (display)
             vbrk,                              "Billing: Header Data
             vbrp,                              "Billing: Item Data
             vbpa,                              "Sales Document: Partner
             lips,                              "SD doc: Delivery: Item data
             mkpf,                              "Header: Material Document
             mseg,                              "Document Segment: Material
             konv.                              "Conditions (Trans Data)
                          CONSTANTS                                      *
    CONSTANTS : c_top_of_page(15) TYPE c VALUE 'SUB_TOP_OF_PAGE'.
                          TYPE-POOL                                      *
    TYPE-POOLS : slis. "Global types for generic cunning building blocks
                          VARIABLES                                      *
    DATA : v_repid    TYPE sy-repid,             "Report ID
           v_month(2) TYPE c,                    "Variable for Month
           v_year(4)  TYPE c,                    "Variable for year
           v_days(31) TYPE c,                    "Variable for days
           v_ship(10) TYPE c VALUE 0,            "Variable for total days
           v_jan(31)  TYPE c,                    "Variable for month
           v_count(2) TYPE c VALUE 0,            "Variable for count
           v_wdays(2) TYPE c VALUE 0,            "Variable for working days
           v_ndays(2) TYPE c VALUE 0,            "Variable for non work days
           v_tdays(2) TYPE c VALUE 0,            "Variable for total days
           v_oltot    TYPE i VALUE 0,            "Variable for order total
           v_sotot    TYPE i VALUE 0,            "Variable for special order
           v_corebus  TYPE kzwi2 VALUE 0,        "Variable for core bus
           v_onbulk   TYPE kzwi2 VALUE 0,        "Variable for bulk orders
           v_premier  TYPE kzwi2 VALUE 0,        "Variable for premier prog
           v_shipit   TYPE kzwi2 VALUE 0,        "Variable for ship it prog
           v_onpromo  TYPE kzwi2 VALUE 0,        "Variable for on promo
           v_netrev   TYPE kzwi2 VALUE 0,        "Variable for net rev
           v_storev   TYPE kzwi2 VALUE 0,        "Variable for store rev
           v_connet   TYPE kzwi2 VALUE 0,        "Variable for consignment
           v_sporder  TYPE kzwi2 VALUE 0,        "Variable for special order
           v_stdvd    TYPE kzwi2 VALUE 0,        "Variable for dvd
           v_totrev   TYPE kzwi2 VALUE 0,        "Variable for total rev
           v_totbud   TYPE kzwi2 VALUE 0,        "Variable for total budget
           v_ordsize  TYPE kzwi2 VALUE 0.        "Variable for order size
                          TYPES                                          *
    *--Structure for VBRP Table
    TYPES : BEGIN OF t_vbrp,
            vbeln  TYPE vbeln,                  "Billing document
            fkdat  TYPE fkdat,                  "Billing date
            fktyp  TYPE fktyp,                  "Billing category
            fkart  TYPE fkart,                  "Billing type
            vtweg  TYPE vtweg,                  "Distribution channel
            knumv  TYPE knumv,                  "Number of doc condition
            posnr  TYPE posnr,                  "Billing item
            matnr  TYPE matnr,                  "Material Number
            werks  TYPE werks_d,                "Plant
            vgbel  TYPE xblnr,                  "Referance
            vgbel1 TYPE vgbel,                  "Doc no reference document
            kzwi2  TYPE kzwi2,                  "Subtotal 2
            wavwr  TYPE wavwr,                  "Cost in document currency
            kunnr  TYPE kunnr,                  "Customer
            END OF t_vbrp,
    *--Structure for MKPF Table
            BEGIN OF t_mkpf,
            fkdat TYPE fkdat,                   "Billing date
            mblnr TYPE mblnr,                   "Number of material document
            mjahr TYPE mjahr,                   "Material doc. year
            xblnr TYPE xblnr,                   "Referance
            kunnr  TYPE kunnr,                  "Customer
            END OF t_mkpf,
    *--Structure for MSEG Table
            BEGIN OF t_mseg,
            fkdat TYPE fkdat,                   "Billing date
            mblnr TYPE mblnr,                   "Number of material document
            mjahr TYPE mjahr,                   "Material doc. year
            bwart TYPE bwart,                   "Movement type
            sobkz TYPE sobkz,                   "Special Stock indicator
            dmbtr TYPE dmbtr,                   "Amount in local currency
            kunnr TYPE kunnr,                   "Customer
            matnr TYPE matnr,                   "Material Number
            werks TYPE werks_d,                 "Plant
            END OF t_mseg,
    *--Structure for LIPS Table
            BEGIN OF t_lips,
            vbeln TYPE vbeln_vl,                "Delivery
            fkdat TYPE fkdat,                   "Billing date
            knumv TYPE knumv,                   "Number of doc condition
            matnr TYPE matnr,                   "Material Number
            werks TYPE werks_d,                 "Plant
            bwart TYPE bwart,                   "Movement type
            kzwi2 TYPE kzwi2,                   "Subtotal 2
            lfimg TYPE lfimg,                   "Quantity
            END OF t_lips,
    *--Structure for VBAK Table
            BEGIN OF t_vbak,
            erdat TYPE erdat,                   "Created On
            vbeln TYPE vbeln_va,                "Delivery
            auart TYPE auart,                   "Sales document type
            vtweg TYPE vtweg,                   "Distribution channel
            knumv TYPE knumv,                   "Number of doc condition
            END OF t_vbak,
    *--Structure for KONV Table
            BEGIN OF t_konv,
            knumv TYPE knumv,                   "Number of doc condition
            kschl TYPE kscha,                   "Condition type
            kbetr TYPE kbetr,                   "Rate
            END OF t_konv,
    *--Structure for DUMMY Table
            BEGIN OF t_dummy,
            fkdat TYPE fkdat,                   "Billing date
            matnr TYPE matnr,                   "Material Number
            bwart TYPE bwart,                   "Movement type
            kbetr TYPE kzwi2,                   "Net value of billing item
            END OF t_dummy,
    *--Structure for NDAY table
            BEGIN OF t_nday,
            erdat   TYPE erdat,                 "Created On
            flag(1) TYPE c,                     "Flag
            END OF t_nday,
    *--Structure for TFACS Table
            BEGIN OF t_tfacs,
            ident TYPE wfcid,                   "Factory calendar ID
            jahr  TYPE kjahr,                   "Fiscal Year
            mon01 TYPE mon00,                   "Calendar: Days in a month
            mon02 TYPE mon00,                   "Calendar: Days in a month
            mon03 TYPE mon00,                   "Calendar: Days in a month
            mon04 TYPE mon00,                   "Calendar: Days in a month
            mon05 TYPE mon00,                   "Calendar: Days in a month
            mon06 TYPE mon00,                   "Calendar: Days in a month
            mon07 TYPE mon00,                   "Calendar: Days in a month
            mon08 TYPE mon00,                   "Calendar: Days in a month
            mon09 TYPE mon00,                   "Calendar: Days in a month
            mon10 TYPE mon00,                   "Calendar: Days in a month
            mon11 TYPE mon00,                   "Calendar: Days in a month
            mon12 TYPE mon00,                   "Calendar: Days in a month
            END OF t_tfacs,
    *--Structure for shipping days table.
            BEGIN OF t_ship,
            title(35) TYPE c,                   "Title
            days(10)  TYPE c,                   "Days
            END OF t_ship,
    *--Structure for Final Table
            BEGIN OF t_final,
            erdat   TYPE erdat,                 "Date
            oltot   TYPE i,                     "Online Order total
            sotot   TYPE i,                     "Special Order Total
            corebus TYPE kzwi2,                 "ECS Online Promo Rev
            onbulk  TYPE kzwi2,                 "ECS online Bulk Orders
            premier TYPE kzwi2,                 "MSFT Premier Program
            shipit  TYPE kzwi2,                 "MSFT online shipit program
            onpromo TYPE kzwi2,                 "MSFT online promo rev
            netrev  TYPE kzwi2,                 "MSFT/Xbox Consignment
            storev  TYPE kzwi2,                 "MSFT Retail Store promo rev
            connet  TYPE kzwi2,                 "MSFT Retail Consign net rev
            sporder TYPE kzwi2,                 "Special order revenue
            stdvd   TYPE kzwi2,                 "Traveling Store/DVD
            totrev  TYPE kzwi2,                 "Total ECS Revenue
            totbud  TYPE kzwi2,                 "Total ECS Budget
            ordsize TYPE kzwi2,                 "Avg online order size
            END OF t_final,
    *--Structure for Total Table
            BEGIN OF t_total,
            title(10) TYPE c,                   "Date
            oltot     TYPE i,                   "Online Order total
            sotot     TYPE i,                   "Special Order Total
            corebus   TYPE kzwi2,               "ECS Online Promo Rev
            onbulk    TYPE kzwi2,               "ECS online Bulk Orders
            premier   TYPE kzwi2,               "MSFT Premier Program
            shipit    TYPE kzwi2,               "MSFT online shipit program
            onpromo   TYPE kzwi2,               "MSFT online promo rev
            netrev    TYPE kzwi2,               "MSFT/Xbox Consignment
            storev    TYPE kzwi2,               "MSFT Retail Store promo rev
            connet    TYPE kzwi2,               "MSFT Retail Consign net rev
            sporder   TYPE kzwi2,               "Special order revenue
            stdvd     TYPE kzwi2,               "Traveling Store/DVD
            totrev    TYPE kzwi2,               "Total ECS Revenue
            totbud    TYPE kzwi2,               "Total ECS Budget
            ordsize   TYPE kzwi2,               "Avg online order size
            END OF t_total,
    *--Structure for MKPF Table
            BEGIN OF t_jkmkpf,
            budat TYPE budat,                   "Posting date
            mblnr TYPE mblnr,                   "Number of material document
            mjahr TYPE mjahr,                   "Material doc. year
            END OF t_jkmkpf,
    *--Structure for MSEG Table
            BEGIN OF t_jkmseg,
            fkdat TYPE fkdat,                   "Billing date
            matnr TYPE matnr,                   "Material Number
            mblnr TYPE mblnr,                   "Number of material document
            mjahr TYPE mjahr,                   "Material doc. year
            bwart TYPE bwart,                   "Movement type
            menge TYPE menge_d,                 "Quantity
            kbetr TYPE kbetr_kond,              "Rate
            dmbtr TYPE dmbtr,                   "Amount in local currency
            END OF t_jkmseg,
    *--Structure for A006 Table
            BEGIN OF t_a006,
            fkdat TYPE fkdat,                   "Billing date
            matnr TYPE matnr,                   "Material Number
            kappl TYPE kappl,                   "Application
            kschl TYPE kschl,                   "Condition type
            vkorg TYPE vkorg,                   "Sales organization
            vtweg TYPE vtweg,                   "Distribution channel
            datbi TYPE kodatbi,                 "Validity end date
            datab TYPE kodatab,                 "Validity start date
            knumh TYPE knumh,                   "Condition record number
            END OF t_a006,
    *--Structure for KONP Table
            BEGIN OF t_konp,
            fkdat TYPE fkdat,                   "Billing date
            matnr TYPE matnr,                   "Material Number
            knumh TYPE knumh,                   "Condition record number
            kappl TYPE kappl,                   "Application
            kschl TYPE kschl,                   "Condition type
            kbetr TYPE kbetr_kond,              "Rate
            END OF t_konp.
                          WORK AREAS                                     *
    DATA : wa_vbrp   TYPE t_vbrp,          "Work area for VBRP Table
           wa_mkpf   TYPE t_mkpf,          "Work area for MKPF Table
           wa_mseg   TYPE t_mseg,          "Work area for MSEG Table
           wa_jkmkpf TYPE t_jkmkpf,        "Work area for MKPF Table
           wa_jkmseg TYPE t_jkmseg,        "Work area for MSEG Table
           wa_kjmseg TYPE t_jkmseg,        "Work area for MSEG Table
           wa_lips   TYPE t_lips,          "Work area for LIPS Table
           wa_vbak   TYPE t_vbak,          "Work area for VBAK Table
           wa_konv   TYPE t_konv,          "Work area for KONV Table
           wa_dummy  TYPE t_dummy,         "Work area for DUMMY Table
           wa_tfacs  TYPE t_tfacs,         "Work area for TFACS Table
           wa_final  TYPE t_final,         "Work area for Final Table
           wa_total  TYPE t_total,         "Work area for Total Table
           wa_ship   TYPE t_ship,          "Work area for Ship Table
           wa_a006   TYPE t_a006,
           wa_konp   TYPE t_konp,          "Work area for KONP Table
           wa_nday   TYPE t_nday,
           wa_fieldcat TYPE slis_fieldcat_alv,"Work area for fieldcatalog
           wa_layout1 TYPE slis_layout_alv,
           wa_layout2 TYPE slis_layout_alv,
           wa_layout3 TYPE slis_layout_alv.
                          INTERNAL TABLES                                *
    DATA : it_vbrp   TYPE STANDARD TABLE OF t_vbrp   INITIAL SIZE 0,
           it_mkpf   TYPE STANDARD TABLE OF t_mkpf   INITIAL SIZE 0,
           it_mseg   TYPE STANDARD TABLE OF t_mseg   INITIAL SIZE 0,
           it_jkmkpf TYPE STANDARD TABLE OF t_jkmkpf INITIAL SIZE 0,
           it_jkmseg TYPE STANDARD TABLE OF t_jkmseg INITIAL SIZE 0,
           it_kjmseg TYPE STANDARD TABLE OF t_jkmseg INITIAL SIZE 0,
           it_lips   TYPE STANDARD TABLE OF t_lips   INITIAL SIZE 0,
           it_vbak   TYPE STANDARD TABLE OF t_vbak   INITIAL SIZE 0,
           it_konv   TYPE STANDARD TABLE OF t_konv   INITIAL SIZE 0,
           it_dummy  TYPE STANDARD TABLE OF t_dummy  INITIAL SIZE 0,
           it_tfacs  TYPE STANDARD TABLE OF t_tfacs  INITIAL SIZE 0,
           it_final  TYPE STANDARD TABLE OF t_final  INITIAL SIZE 0,
           it_total  TYPE STANDARD TABLE OF t_total  INITIAL SIZE 0,
           it_ship   TYPE STANDARD TABLE OF t_ship   INITIAL SIZE 0,
           it_nday   TYPE STANDARD TABLE OF t_nday   INITIAL SIZE 0,
           it_a006   TYPE STANDARD TABLE OF t_a006   INITIAL SIZE 0,
           it_konp   TYPE STANDARD TABLE OF t_konp   INITIAL SIZE 0,
           it_fieldcat  TYPE slis_t_fieldcat_alv WITH HEADER LINE,
           it_fieldcat2 TYPE slis_t_fieldcat_alv WITH HEADER LINE,
           it_events TYPE slis_t_event,
           it_event1 TYPE slis_t_event,
           it_event2 TYPE slis_t_event,
           it_header TYPE slis_t_listheader.
                      PARAMETERS &  SELECT-OPTIONS                       *
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_erdat FOR vbak-erdat NO-DISPLAY. "Created On
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(10) text-003.
    PARAMETERS : p_month(7) TYPE c OBLIGATORY.  "Month
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(40) text-030.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(10) text-004.
    PARAMETERS : p_bud(16) TYPE c OBLIGATORY.   "Budget
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK blk1.
                      AT SELECTION SCREEN                                *
    AT SELECTION-SCREEN ON p_month.
    *--Create the date range
      PERFORM sub_create_date.
                      START-OF-SELECTION                                 *
    START-OF-SELECTION.
    *--Select data from TFACS Table
      PERFORM sub_read_tfacs.
    *--Select Data from VBAK Table
      PERFORM sub_read_vbak.
    *--Select Data from VBRP Table
      PERFORM sub_read_vbrp.
    *--Select Data from MKPF Table
      PERFORM sub_read_mkpf.
    *--Select Data from MSEG Table
      PERFORM sub_read_mseg.
    *--Select Data from LIPS Table
      PERFORM sub_read_lips.
    *--Select Data from KONV Table
      PERFORM sub_read_konv.
    *--Collect all the data into final inetrnal table
      PERFORM sub_collect_data.
    *--Collect all the data into final inetrnal table
      PERFORM sub_collect_vbrp.
    *--Collect all the data into final inetrnal table
      PERFORM sub_collect_lips.
    *--Collect MSFT retail store promo rev & MSFT retail
    store consignment net rev
      PERFORM sub_jk_column.
    *--Collect consignment cost
      PERFORM sub_collect_consign.
    *--Calculate Plug Numbers
      PERFORM sub_claculate_plug.
    *--Collect data from vbrp
      PERFORM sub_collect_cost.
    *--Calculate the total & avarages
      PERFORM sub_calculate_total.
    *--Collect totals & avarages into final internal table
      PERFORM sub_collect_total.
                      END-OF-SELECTION                                   *
    END-OF-SELECTION.
    *--This perform creates the ALV events
      PERFORM sub_create_events.
    *--This perform prepare field catalog.
      PERFORM sub_field_catalogmerge.
    *--This perform displays an ALV report
      PERFORM sub_alv_display.
    *&      Form  sub_read_vbrp
          text
    FORM sub_read_vbrp .
    *--Local Variables
      DATA : lv_index LIKE sy-tabix.
    *--Select query to pick the Billing document Billing date Billing
    category Billing type Distribution channel Number of doc condition
    Billing item Material Number Plant Referance Subtotal 2 Cost in
    document currency and Partner function from table VBRK VBRP and VBPA
    using inner join
      SELECT a~vbeln                            "Billing document
             a~fkdat                            "Billing date
             a~fktyp                            "Billing category
             a~fkart                            "Billing type
             a~vtweg                            "Distribution channel
             a~knumv                            "Number of doc condition
             b~posnr                            "Billing item
             b~matnr                            "Material Number
             b~werks                            "Plant
             b~vgbel                            "Referance
             b~kzwi2                            "Subtotal 2
             b~wavwr                            "Cost in document currency
             c~kunnr                            "Partner function
             FROM vbrk AS a
             INNER JOIN vbrp AS b
             ON avbeln EQ bvbeln
             INNER JOIN vbpa AS c
             ON  bvbeln EQ cvbeln
             INTO CORRESPONDING FIELDS OF TABLE it_vbrp
             WHERE fkdat IN s_erdat
             AND   parvw EQ 'ZS'.
      IF sy-subrc EQ 0.
    *--Sort table by Referance
        SORT it_vbrp BY vgbel1.
      ENDIF.
      LOOP AT it_vbrp INTO wa_vbrp.
        lv_index = sy-tabix.
        wa_vbrp-vgbel1 = wa_vbrp-vgbel.
        MODIFY it_vbrp FROM wa_vbrp INDEX lv_index TRANSPORTING
                                          vgbel1.
    *--Clear
        CLEAR : wa_vbrp.
      ENDLOOP.
    ENDFORM.                    " sub_read_vbrp
    *&      Form  sub_read_mkpf
          text
    FORM sub_read_mkpf .
    *--Local Variables
      DATA : lv_index LIKE sy-tabix.
      IF NOT it_vbrp[] IS INITIAL.
    *--Select query to pick the Number of material document Material
    document year and Referance from table MKPF
        SELECT DISTINCT
               mblnr                            "Number of material document
               mjahr                            "Material doc. year
               xblnr                            "Referance
               FROM mkpf
               INTO CORRESPONDING FIELDS OF TABLE it_mkpf
               FOR ALL ENTRIES IN it_vbrp
               WHERE xblnr EQ it_vbrp-vgbel.
      ENDIF.
    *--Sort table by No of material document and fiscal year
      SORT it_mkpf BY mblnr mjahr.
      IF sy-subrc EQ 0.
        DELETE ADJACENT DUPLICATES FROM it_mkpf COMPARING mblnr mjahr.
      ENDIF.
    *--Sort table by referance document
      SORT it_vbrp BY vgbel.
      SORT it_mkpf BY xblnr.
      IF NOT it_mkpf[] IS INITIAL.
        LOOP AT it_mkpf INTO wa_mkpf.
          lv_index = sy-tabix.
    *--Clear
          CLEAR : wa_vbrp.
          READ TABLE it_vbrp INTO wa_vbrp WITH KEY vgbel = wa_mkpf-xblnr
                                                   BINARY SEARCH.
          IF sy-subrc EQ 0.
            wa_mkpf-fkdat = wa_vbrp-fkdat.
            wa_mkpf-kunnr = wa_vbrp-kunnr.
          ENDIF.
          MODIFY it_mkpf FROM wa_mkpf INDEX lv_index TRANSPORTING
                                            fkdat kunnr.
    *--Clear
          CLEAR : wa_mkpf.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " sub_read_mkpf
    *&      Form  sub_read_mseg
          text
    FORM sub_read_mseg .
    *--Local Variables
      DATA : lv_index LIKE sy-tabix.
      IF NOT it_mkpf[] IS INITIAL.
    *--Select query to pick the Number of material document Material
    document year Movement type Special Stock indicator and Amount in
    local currency from table MSEG
        SELECT mblnr                            "Number of material document
               mjahr                            "Material doc. year
               bwart                            "Movement type
               sobkz                            "Special Stock indicator
               dmbtr                            "Amount in local currency
               matnr                            "Material
               werks                            "Plant
               FROM mseg
               INTO CORRESPONDING FIELDS OF TABLE it_mseg
               FOR ALL ENTRIES IN it_mkpf
               WHERE mblnr EQ it_mkpf-mblnr
               AND   mjahr EQ it_mkpf-mjahr.
              AND   bwart EQ '601'.
              AND   sobkz EQ 'K'.
      ENDIF.
    *--Sort table by Number of material document
      SORT it_mkpf BY mblnr.
    *--Sort table by Number of material document
      SORT it_mseg BY mblnr.
      IF NOT it_mseg[] IS INITIAL.
        LOOP AT it_mseg INTO wa_mseg.
          lv_index = sy-tabix.
    *--Clear
          CLEAR : wa_mkpf.
          READ TABLE it_mkpf INTO wa_mkpf WITH KEY mblnr = wa_mseg-mblnr
                                                   BINARY SEARCH.
          IF sy-subrc EQ 0.
            wa_mseg-fkdat = wa_mkpf-fkdat.
            wa_mseg-kunnr = wa_mkpf-kunnr.
          ENDIF.
          MODIFY it_mseg FROM wa_mseg INDEX lv_index TRANSPORTING
                                            fkdat kunnr.
    *--Clear
          CLEAR: wa_mseg.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " sub_read_mseg
    *&      Form  sub_read_lips
          text
    FORM sub_read_lips .
    *--Local Variables
      DATA : lv_index LIKE sy-tabix.
      IF NOT it_vbrp[] IS INITIAL.
    *--Select query to pick the Delivery Material Number Plant
    Movement type Subtotal 2 and Quantity from table LIPS
        SELECT vbeln                            "Delivery
               matnr                            "Material Number
               werks                            "Plant
               bwart                            "Movement type
               kzwi2                            "Subtotal 2
               lfimg                            "Quantity
               FROM lips
               INTO CORRESPONDING FIELDS OF TABLE it_lips
               FOR ALL ENTRIES IN it_vbrp
               WHERE vbeln EQ it_vbrp-vgbel1.
        IF sy-subrc EQ 0.
    *--Sort table by Delivery
          SORT it_lips BY vbeln.
        ENDIF.
      ENDIF.
    *--Sort table
      SORT it_vbrp BY vgbel1.
      LOOP AT it_lips INTO wa_lips.
        lv_index = sy-tabix.
    *--CLear
        CLEAR : wa_vbrp.
        READ TABLE it_vbrp INTO wa_vbrp WITH KEY vgbel1 = wa_lips-vbeln
                                                 BINARY SEARCH.
        IF sy-subrc EQ 0.
          wa_lips-fkdat = wa_vbrp-fkdat.
          wa_lips-knumv = wa_vbrp-knumv.
        ENDIF.
        MODIFY it_lips FROM wa_lips INDEX lv_index TRANSPORTING
                                    fkdat knumv.
    *--Clear
        CLEAR : wa_lips.
      ENDLOOP.
    ENDFORM.                    " sub_read_lips
    *&      Form  sub_read_konv
          text
    FORM sub_read_konv .
      IF NOT it_vbrp[] IS INITIAL.
    *--Select query to pick the Number of doc condition Condition type
    and Rate from table KONV
        SELECT knumv                            "Number of doc condition
               kschl                            "Condition type
               kbetr                            "Rate
               FROM konv
               INTO TABLE it_konv
               FOR ALL ENTRIES IN it_vbrp
               WHERE knumv EQ it_vbrp-knumv
               AND   kschl EQ 'ZR00'.
      ENDIF.
    ENDFORM.                    " sub_read_konv
    *&      Form  sub_read_vbak
          text
    FORM sub_read_vbak .
    *--Select query to pick the Created On Delivery Sales document type
    Distribution channel and Number of doc condition from table VBAK
      SELECT erdat                              "Created On
             vbeln                              "Delivery
             auart                              "Sales document type
             vtweg                              "Distribution channel
             knumv                              "Number of doc condition
             FROM vbak
             INTO TABLE it_vbak
             WHERE erdat IN s_erdat.
      IF sy-subrc EQ 0.
    *--Sort table by created on
        SORT it_vbak BY erdat.
      ENDIF.
    ENDFORM.                    " sub_read_vbak
    Regards,
    prashant

  • Query to replicate the Bill of Materials Report

    I'm looking to recreate the Bill of Materials report as a query, mostly because i cannot add any new database fileds to the pld report.
    As i cannot amend/change the screen layout or PLD i would like to recreate the report as a  query but have struggled to get a query to show the expanded layers of the BoM as the report does.

    Following is one I wrote to find cost vs sell price & GP for Production BOM's.
    You may be able to modify it to include what you need?
    {SELECT T0.[Father],
    sum ( T2.[AvgPrice]* T0.[Quantity]) as [Cost],T3.[Price] AS [Sales Price], 
    (t3.Price - sum(T2.[AvgPrice] * T0.Quantity)) as [GP] ,
    (t3.Price - sum(T2.[AvgPrice] * T0.Quantity))/sum (case when isnull(T2.[AvgPrice],0)= 0 then 1 else isnull(T2.[AvgPrice],0) end * T0.[Quantity])*100 AS [GP%]
    FROM ITT1 T0  INNER JOIN OITT T1 ON T0.Father = T1.Code INNER JOIN OITM T2 ON T0.Code = T2.ItemCode INNER JOIN ITM1 T3 ON T1.Code = T3.ItemCode
    WHERE (T1.[TreeType] = 'P' or  T1.[TreeType] = 's') and  T3.[PriceList] = 1
    GROUP BY T0.[Father],T3.[Price]}

Maybe you are looking for