Last 12 months Sales orders

Hi,
Can any one help me out on this?
User wants to display last 12 month total number of orders including Current.
I am able to get this result with Sap variable but user wants if the orders are not there in one month then he wants to display with “0” no of orders or blank.
Example: In Jan 07 there is no orders this row will not display. But user wants to display with Zero orders. Because he is creating Graph of last 12 months based on the result. The last month names has to display with or with out result.
Calendar Year/Month        Total Orders
SEP 2007                           20
OCt 2007                           1
Nov 2007                           0 .."This row has to display with Zero or blank"
Dec-07     
Jan 2007                            0 .."This row has to display with Zero or blank"
Feb-07     
Mar 2007     
Apr 2007                           12
May 2007     
Jun 2007     
Jul-07                           10
Aug-07                           
Thanks,
Raj

Hi,
Go through the following documents to understand the VBA:
http://help.sap.com/saphelp_bw21c/helpdata/en/f1/0a55f9e09411d2acb90000e829fbfe/content.htm
Also go through the forum for links to VBA code as well as extensive discussions on VBA.
http://www.bwexpertonline.com/downloads/Boeke%20Code.doc
http://www.sap-img.com/business/api-functions-available-in-bex.htm
Hope this helps.
PB

Similar Messages

  • Regarding the date of last change in sales order...

    Hi,
    Can anyone help me in the scenario...
    I have to pick the date of last change in sales order...whether it is done on Configuration items ,additional data B or on the ordered quantity...
    the problem is that it has some customized fields that are included in VBAK....
    So i need help regarding this...shud i have to writ a user exit for this....or i hv to do a change in USEREXIT_SAVE_DOCUMENT .
    Plz help me..
    Edited by: Amit Gupta on May 1, 2008 3:02 PM

    VBAK-AEDAT will be updated, evenIf you have your custom fields in Sales Order.
    Regards,
    Naimesh Patel

  • Monthly Sales Order query Doc Status problem

    Hi Experts,
    I am having an problem while making a total monthly sales order query in which I am not getting the document status which are Open - Printed. Also note that these document which are open printed are not having any target document.
    SELECT T0.[DocStatus],T1.[TargetType],T0.[CANCELED],T0.[CardCode], T0.[CardName], T0.[NumAtCard], T5.[SeriesName], T0.[DocNum], T0.[DocDate], T0.[DocDueDate], T0.[DocTotal],T0.[Max1099]'Total Before Discount',T0.[TotalExpns],T4.[descript]'Territory',T2.[SlpName]'Employee Name'
    ,T0.[discsum]  FROM ORDR T0  ,RDR1 T1,OSLP T2,OCRD T3,OTER T4,NNM1 T5  where  T0.DocEntry = T1.DocEntry AND T0.SlpCode = T2.SlpCode AND T0.CardCode = T3.CardCode
    AND T3.Territory = T4.territryID AND T0.Series = T5.Series and T0.[CANCELED]='N' and T1.[TargetType] is not null
    My mission for the above query is to have Total Monthly Sales Orders with value exluding the cancelled and closed sales sales ( close here means - which are manually done by right click on sales order screen and selecting Close )
    Please guied how to solve this issue because in the back end for Sales Order which have turned to deleivery are showing doc status as closed and the sales order which are manually closed are also showing doc status as closed. How to diffrentiate between them.
    Waiting for a positve feedback.
    Regards,
    Rahul

    Try this one:
    SELECT DISTINCT T0.[DocStatus],T0.[CardCode], T0.[CardName], T0.[NumAtCard], T5.[SeriesName],
    T0.[DocNum], T0.[DocDate], T0.[DocDueDate], T0.[DocTotal],T0.[Max1099]'Total Before Discount',
    T0.[TotalExpns],T4.[descript]'Territory',T2.[SlpName]'Employee Name',T0.[discsum]
    FROM DBO.ORDR T0
    INNER JOIN DBO.RDR1 T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN DBO.OSLP T2 ON T0.SlpCode = T2.SlpCode
    INNER JOIN DBO.OCRD T3 ON T0.CardCode = T3.CardCode
    INNER JOIN DBO.OTER T4 ON T3.Territory = T4.territryID
    INNER JOIN DBO.NNM1 T5 ON T0.Series = T5.Series
    where  T0.[CANCELED]='N' and T1.[TargetType] != -1
    Thanks,
    Gordon

  • Calculate Last 12 months Sales

    Hi Experts,
    I need to have MAT value in Reporting.
    MAT Value = Last 12 Months Sales Value/12.
    How can i achieve this.
    Please suggest the best way to have MAT value.
    Thanks in advance,
    Rafi

    Hi,
    Create one restricted key fig by offsetting month for last 12 months and drag sales value key fig into that.
    Now create a formula variable by dividing the newly created restricted key fig with 12.
    hope it helps...
    regards,
    Raju

  • Last Price for Sales Order History

    Hi Friends,
    I have a requirement in LSMW, where i have to upload Sales Orders data into SAP to convert Customer
    and Material price points for the past X months.
    Is there any SAP standard program or BAPI available for this requirement?
    Thanks in advance.
    Murthy

    Hi Friends,
    I have a requirement in LSMW, where i have to upload Sales Orders data into SAP to convert Customer
    and Material price points for the past X months.
    Is there any SAP standard program or BAPI available for this requirement?
    Thanks in advance.
    Murthy

  • Sales Order - Line Level Information in Info cube

    Hi BW Guru's,
    We are using the following scenario: -
    Info cube = Sales Order – Line level information (yes, we want to capture the product level sales order information in info cube for our internal reporting purpose)
    ODS = NO. we are not using the same
    Info Source – Same as data source (standard one)
    Data Source – 2LIS_11_VAITM (standard business content data source for sales order information)
    Delta in above data source = contract related information (5 extra fields) – working fine – added as append structure in the data source
    Extractor = Standard using SBIW - Perform setup - SD Sales Order (SD – 11)
    Number of Sales order line records / month = 80,000
    Historical Sales order data to be uploaded = 1 year = 80,000 * 12 = Nearly 1 Million records
    Hardware Configuration = 4 * 750 MHZ, 8 GB RAM
    Please advice on the following things: -
    1) How long it will take to upload 1 million records in BW?
    2) Does our server capacity sufficient enough to take 1 million load?
    3) Which delta procedure should we follow for day to day Sales Order line level data updation? Please advice on data selection procedure.
    4) In case, last month Sales Order is changed, how to reflect the same in our info cube? Please suggest the suitable method.
    Waiting for your reply.
    Thanks
    Rajiv

    Hi Rajiv,
    1) How long it will take to upload 1 million records in BW?
    This depends on your network, on the width of your data record, the performance of your machine, on the settings for communication between BW and R/3 ....
    It can be done in 2 hours, in 3 hours, it can take a whole day. There is no exact answer possible.
    2) Does our server capacity sufficient enough to take 1 million load?
    If your disc space is enough, no problem. If you already loaded your master data, there is not too much space necessary to load the transactional data.
    3) Which delta procedure should we follow for day to day Sales Order line level data updation? Please advice on data selection procedure.
    Just run your initial setup and initialize your delta. Run a daily delta package (this is what most companies do).
    4) In case, last month Sales Order is changed, how to reflect the same in our info cube? Please suggest the suitable method.
    The extractor takes care about this, just post the delta to your cube, that's it.
    Hope this helps,
    regards
    Siggi

  • Selecting, reading and sum of billing quantity for last 12 months in transformation end routine

    Hi experts,
    i have requirement to write end routine to read a DSO for last 12 months sales quantity for each month and sum value pass to keyfigure
    not interested using bex variable, while data loading from source to target dso in end routine i am trying to read another DSO which is same as my
    target dso where information is stored by fiscal period, year material etc. finally there is  a keyfigure in target whih needs to be filled with sum of 12
    months sales quantity, for each record form sourc to target maximum of 12 records will be in read dso (for 12 months) my routine is like below.
    i am not expert in abap please kindly gothrough and guide me in this
    TYPES: BEGIN OF s_/BIC/AZOSLS00,
    FISCPER  type /BI0/OIFISCPER,
    FISCVARNT  type /BI0/OIFISCVARNT,
    PLANT  type /BI0/OIPLANT,
    STOR_LOC  type /BI0/OISTOR_LOC,
    /BIC/MATERIAL  type /BIC/OIMATERIAL,
    VTYPE  type /BI0/OIVTYPE,
    BILL_QTY  type /BI0/OIBILL_QTY,
    END OF s_/BIC/AZOSLS00.
    DATA: it_/BIC/AZOSLS00 TYPE TABLE OF s_/BIC/AZOSLS00,
    wa_/BIC/AZOSLS00  TYPE s_/BIC/AZOSLS00.
    SELECT
    FISCPER
    FISCVARNT
    PLANT
    STOR_LOC
    /BIC/MATERIAL
    VTYPE
    BILL_QTY
         FROM /BIC/AZOSLS00 INTO TABLE it_/BIC/AZOSLS00
           FOR ALL
          ENTRIES IN RESULT_PACKAGE
           WHERE
    below field is from value of fiscal period (which is fiscal period -999 ex:  for 001.2014 this
    value will be 002.2013 so 12 months including current period)
    FISCPER >=  RESULT_PACKAGE-/BIC/ZFISCPERF
    below is result filed fiscal period (here i dont know which keyword or statement to be used to select
    interval values this between statement giving syntax error that can not be used in where for for all entries
    between RESULT_PACKAGE-FISCPER
            AND
             FISCVARNT = RESULT_PACKAGE-FISCVARNT AND
             PLANT = RESULT_PACKAGE-PLANT AND
             STOR_LOC = RESULT_PACKAGE-STOR_LOC and
          /BIC/MATERIAL = RESULT_PACKAGE-/BIC/MATERIAL .
        SORT it_/BIC/AZOSLS00 BY FISCPER FISCVARNT PLANT STOR_LOC
        /BIC/MATERIAL .
        LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.
          READ TABLE it_/BIC/AZOSLS00 INTO wa_/BIC/AZOSLS00 WITH KEY
    below dont know what statement i need to use in read statement for interval of fiscal periods
    giving error that >= can not be used
         FISCPER >=  <result_fields>-/BIC/ZFISCPERF
    FISCPER = <result_fields>-FISCPER
             FISCVARNT = <result_fields>-FISCVARNT
             PLANT = <result_fields>-PLANT
             STOR_LOC = <result_fields>-STOR_LOC
          /BIC/MATERIAL = <result_fields>-/BIC/MATERIAL
           BINARY SEARCH.
          BREAK-POINT.
          IF sy-subrc = 0.
    below for each record there will be 12 records in read so sume of 12 records quantity i need to pass to result again dont know what to say here
    sum statement giving error
                <result_fields>-/BIC/ZLSTSLS12 =
                 sum(wa_/BIC/AZOSLS00-BILL_QTY).
              ENDIF.
        ENDLOOP.
    friends please help me in this.
    Thanks
    Chandra.

    Hiii,
    If you only want to store last  12 months data in Target ODS .
    Then Create filter in DTP and write routine in filter for calmonth or fiscal period.
    Refer the below link to create filter routine :
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80b2db87-639b-2e10-a8b9-c1ac0a44a7a6?QuickLink=index&…
    Regards,
    Akshay

  • How to Re-open a Closed sales order on which delivery is booked & returned

    Dear All,
    The scenerio is as such a Sales Order has been made and based on it a delivery note is made. After sometime the user reliazes that the delivery note has been wrongly made and he reverses the delivery by making a Return entry. Now as the delivery has been made the corresponding sales order has been closed and as Return has been booked, delivery note is also closed.
    Now the user wants that he makes a new delivery based on the same sales order but how can this be achieved as the sales order is already closed or how can the sales order be cancelled now.
    If we make a new sales order then in mothly sales order report it would be seen that two sales order are there and total monthly sales order value would be wrong.
    What is the best way to handle such situations.
    Regards,
    Kawish

    I agree that this is ridiculous.
    I wish SAP was there when I needed to tell any customers about this....

  • CALL TRANSACTION at Sales Order SAVE

    Dear All,
    I want to update and then Close the Service Order, when the Sales Order Line Item rejected.
    I have used the BDC - CALL TRANSACTION on IW32 for Closing the service Order. I have written that in one of the BADI on Sales Order SAVE in VA02.
    Now, the problem I am facing is, BDC is successful; but, at the last COMMIT in Sales Order old data is rewritten in the Service Order and evn if it shoing the Status CLSD, it is in changable Mode.
    So, please suggest me the way to overcome this.
    1. Service Order Data (OPERATIONS COMPONENTS) should not be overwritten.
    2. Once Closed, Service Order should be in non-chnagable Mode only.
    Please help me in this topic ASAP.
    Thnaks in advance.
    Kind Regards,
    Prasad

    hi,
    Youcan use TAP, TAN for sub it Level pricing anf at main item level pricing you can use TAQ,TANN.
    AND CHECK IN TAP AND TAQ  That is there structure scope and application  in the BOM section is configured.
    and configure the sub item  sales item category as
    for pricing at sub item level
    sales document type-item category group(lump)-usage-higher item category[TAP]- TAN
    pricing at main item level
    sales document type-item category group(lump)-usage-higher item category[TAQ]- TANN
    you will get this in sales order
    go to Or  add the main material 1 you will get material 2 and material 3 as a subitem to item
    and check the pricing whether it applies to main item or sub item
    gajanan
    Edited by: Rudrag on Feb 10, 2010 8:48 AM

  • CURRENT YEAR PREVIOUS TWO MONTHS SALES+MDX

    QUERY TO GET CURRENT YEAR LAST TWO MONTH SALES DYNAMICALLY IN MDX

    assuming you are looking for data with the latest two months and taking adventure works DW 2008  as sample DB
    try this
    select [Measures].[Internet Sales Amount]
    on 0,
     {Tail(nonempty(descendants([Date].[Calendar].[Calendar
    Year],[Date].[Month of Year]))).item(0),
     Tail(nonempty(descendants([Date].[Calendar].[Calendar
    Year],[Date].[Month of Year]))).item(0).prevmember} 
    on 1
     from [Adventure Works]

  • Problem in blocking that amount in the sales order through routein

    Dear Experts,
    We are facing a problem in Routine,
    We have developed a Z rebate module in that we are saving the accrual value for a perticular customer in "Z" Table.
    We are having a senerio of adjusting that perticular accrued amount in the next month sales order as a discount  at the item level. In table  itself we fix this much amount as to flow to sales order for a Perticular material (EX- for 100001 material 5 rs per TON).
    We have devaloped 901 routine that will go to "z" table and check any accrued amount is there then depending on the quantity ordered it will take accrual amount (simultanusly it will block the respective amount in the "z" table) and it will come and update in sales order pricing. Once we save sales order then it will reduse the perticular amount in from "z" table.
    Now we are facing a problem, when we create a sales order first time depending on quantity routine will pull the value from "z" table and it will block respective amount in the "z" table. but before saving the sales order if you change the quantity again (EX- from 100 qty to 200 qty) then the routine is not pulling any value because the amount is already blocked. 
    Can any one tell me how check in run time this was the earlier quantity and this is changes quantity Or is there any logic to block that perticular amount.
    Regards
    Nagesh

    HI Sree
    Could you please justify your post stating
    "Now we are facing a problem, when we create a sales order first time depending on quantity routine will pull the value from "z" table and it will block respective amount in the "z" table. but before saving the sales order if you change the quantity again (EX- from 100 qty to 200 qty) then the routine is not pulling any value because the amount is already blocked. "
    Your discount is based on qty, so when you are adding new item means order qty increased, so discount is applicable.
    Or please put your requirement clearly

  • Add mode in Sales order.

    Hi,
    When ever a Sales order is open from Sales A/R we are getting in add mode instead of find mode.
    If u like to look into last record in sales order we are getting an error "changes will cause data to be deleted"
    please provide ur suggestions.
    Vinod.

    Most likely you have a formatted search on the window that is set to refresh regulary... Thats a common problem

  • Monthly sales ordr in alv

    hi,       i am facing a problem in creation of sales order for a particular sales organization where in i need the sales orders raised by customers of the sales organization in a report which shows the sales order number,material data in it,quantity,cost,but my requirement to display the sales month wise for all customers .for example what r the sales orders raised in january by all customers of  sales org should come under jan month,like what r the orders raised by customers in febraury in january month like this i need for a particular financial year ,my problem is i am unable to split the sales based on months,i am able to get all months sales order with out classification under one set.....if

    HI RAJ,
    this is sample code it may help u,
    u do like this pass ktab to alv u got list by monthly.
    but first field 'erdat' b/c we use this field i at end of.
    types : begin of ty_vbak ,
           erdat type erdat,
          vbeln type vbeln_va,
          end of ty_vbak.
    data : itab    type table of ty_vbak,
           ktab    type table of ty_vbak,
           wa_itab type ty_vbak,
           ty_wa_itaB TYPE TY_VBAK,
           TEMP(2) TYPE C.
    select vbeln erdat from vbak into CORRESPONDING FIELDS OF table itab
    where vbeln > 100.
    sort itab by erdat.
    LOOP AT ITAB INTO WA_ITAB.
    APPEND WA_ITAB TO KTAB.
    AT END OF ERDAT+4(2).
    CLEAR WA_ITAB.
    APPEND WA_ITAB TO KTAB.
    ENDAT.
    ENDLOOP.
    regards,
    chandu.

  • Planning based on Six month sales

    Hi Frnds,
    Currently we are using Flexibe planning method where we enter the 4 months projection quanity and then run the mrp at the start of every month.
    Now my company needs a planning based on the last six months sales, where the system should automatically pick up the billing qty of the last months of the products and then on that basis Mrp run should take place.
    Is there any standard procedure available for this in sap???
    Regards
    Rajesh

    Hi Rajesh,
    I think you need to check it by implementing Forcast process from SAP.
    Regards,
    Hiren

  • Enhancement on Sales Order SAVE

    Dear All,
    I want to update and then Close the Service Order, when the Sales Order Line Item rejected.
    I have used the BDC - CALL TRANSACTION on IW32 for Closing the service Order. I have written that in one of the BADI on Sales Order SAVE in VA02.
    Now, the problem I am facing is, BDC is successful; but, at the last COMMIT in Sales Order old data is rewritten in the Service Order and evn if it shoing the Status CLSD, it is in changable Mode.
    So, please suggest me the way to overcome this.
    1. Service Order Data (OPERATIONS COMPONENTS) should not be overwritten.
    2. Once Closed, Service Order should be in non-chnagable Mode only.
    Please help me in this topic ASAP.
    Thnaks in advance.
    Kind Regards,
    Prasad

    Can anyone gives something about this?
    Thanks a lot.
    Best Regards,
    Prasad

Maybe you are looking for

  • The product version and database version are not compatible

    The following simple program gets an exception {The product version and database version are not compatible} its very hard to proceed from here. Does anybody know what cause this?   Best Regards Jan Isacsson using System.Collections.ObjectModel; usin

  • Grid in Spaces gone (dark; no blue rectangles)

    Please see attached link to screenshot of my Spaces grid, or to be more precise: lack thereof (grid that is). I have 16 spaces, but the grid has disappeared. The grid appears as is in the screenshot, regardless of how many spaces I use. How do I get

  • Calculating the planned delivery time in calendar days or working days

    Hi, It seems that there is a way to calculate the planned delivery time in calendar days instead of working days. When I use the "Planned delivery time calculation" (WPDTC), in Evaluation Options, I got the message : "Note that follow-on applications

  • Has anyone else seen this error code and know a remedy?

    Exit Code: 6 Please see specific errors and warnings below for troubleshooting. For example,  ERROR: DF015, DW063 ... WARNING: DF012, DW029 ... -------------------------------------- Summary -------------------------------------- - 0 fatal error(s),

  • Uninstallation of applications in cloud

    I'm new to creative cloud and I installed the application Lightroom but I dont like to work with it and uninstalled it as a normal program but in my cloud panel it showing that the application is installed. I prefer my photoshop to work being use to