Return a number for every sales order

Hai All,
             I have a sales order coming into a cube. Our model is in such a way that if we look at the records in the cube, there are more than one record for a sales order. I have to report on number of sales orders based on  period.
I want to create a key figure to return "1" for every sales order and "0" for the repeated sales order numbers. so that in the report if I am asked how many sales orders are created in a period, I can just sumup the 1s.
I would appreciate if any one could suggest a way for me. Can non-cumulative key figures help me?
Thanks.

Hi,
  to my knowledge, it's not possible with Bex reporting.
1.  we have DS 2LIS_11_VAHDR DS, if you are extracting this data you can extract to some ODS. which will give Sales Order Header details.
2. as i said through VBA coading, you can achive this.
3. by implementing one more key figure(to calculate the number of Sales Orders) in the cube, we can achive this.
all the best.
Regards,
Nagesh Ganisetti.

Similar Messages

  • How to Find Out The Production Order Number For The Sales Order Line Items

    Hi All,
    I want to know the number of production orders for each sales order line item. I know the sales order number .Can anyone tell me how the tables can be linked to get all the production order numbers for each sales order line item.

    I think it depends on your configuration. But check fields KDAUF and KDPOS in table AUFK.  or in table AFPO.
    Regards,
    Rich HEilman

  • How to get the delivery number for the sales order

    hi
    how to get the delivery number for the sales order

    Hi,
    1. IN VA03, enter the sales order and click on the document flow button. From there you can check the delivery document.
    2. In SE11, enter VBFA(Document flow) table and enter the sales order in VBELV field and in VBTYP_N field enter 'J' to specify that you want to check if there is already a delivery document for that sales order.
    Hope it helps...
    P.S. Please award points if it helps...

  • SQL to fetch contract number for a sales order

    Hello,
    I am using API's to create service contracts, all is working well except one scenario - when install based item switches ownership.
    I need some help crafting a query that will return the contract number, if one exists, for a particular sales order. I am trying to determine if a contract already exists so I can either create new contract header then add lines.... or add lines to existing.
    I have this query so far, however it will return the prior/old service contract and not the most recent if an IB item is being resold after refurbish:
    SELECT okh.id
    FROM okc_k_headers_b okh
    ,okc_k_lines_b okl
    ,okc_k_items oki
    ,csi_item_instances cii
    ,oe_order_lines_all oolv
    ,oe_order_headers_all oohv
    WHERE okh.id=okl.dnz_chr_id
    AND oki.cle_id = okl.id
    AND okh.sts_code <> 'TERMINATED'
    AND to_char(cii.instance_id) = oki.object1_id1
    AND oolv.line_id=cii.last_oe_order_line_id
    AND oohv.header_id=oolv.header_id
    AND okl.end_date >= trunc(sysdate)+vDuration
    AND oohv.order_number=vOrderNumber
    Thanks!
    Any help would be great.

    I found similar question here:
    Relation between Order Number & Contract Number
    But that query does not return contract number consistently for me. Meaning I know a contract exists related to a certain sales order yet query does not find it.
    I am new to contracts I appologise for my ignorance
    thanks
    Edited by: user7513372 on Jul 6, 2010 11:23 AM

  • PO number for B2B Sales Orders.

    Hello,
    B2B orders lines are in the status "PO Created".
    But while checking the PO number in the Supply TAB, PO number is blank and greyed out.
    Intrestingly we can see the PO line number.
    Any pointers?
    Thanks
    Radha.

    Hi Luko,
    Thanks for the notes.
    Note 746241.1 says the following
    When performing a back to back order for a lot controlled item and then an over-receipt of the original booked item within the tolerances, the status of the Sales Order is not changing from 'PO-Created' to 'Awaiting Shipping'. Reservations are not being transferred from PO to Sales order.
    It works fine if the quantity received is equal to the quantity ordered.
    we have receiving equal quantity as ordered.
    Please suggest.
    Thanks
    Radha.

  • New ADRNR  (address number ) created for Every Purchase Order

    Hi Friends,
    Whenever I create a Purchase Order, I can see that in EKKO there is a new address number updated which is unique for every PO. This address is copy of the vendor address but the address number is different. The effect of this is that my PO is blocked in GTS since the Flag for manipulated in the partner of the API.
    Now my question is why does the system create a new address number for every Purchase order. For some Purchase order this is not happening.
    Thanks for your help in advance.
    Regards,
    Vijay V

    Hi,
    Good to know this. But then how does GTS (SPL check) system identify this dynamically created address. Must this not be passed to the GTS system by writing it in the user exit or is there some other standard way of doing this.
    But we are not entering the address manually in these POs.
    Also some POs that are not for One time Vendor is also having an address entry in the EKKO table. SO it is not only for OTV POs.
    Regards,
    Vijay V
    Edited by: Vijay Venkataraman on Jan 13, 2011 4:35 PM
    Edited by: Vijay Venkataraman on Jan 13, 2011 4:41 PM

  • Single invoice for multiple sales orders

    Hi all,
    When delivery order is created based on Collective processing, Billing document is created based on delivery order for delivery based billing.
    But, is it possible to filter the line items in the Collective delivery order further for billing? Based on customer PO number, etc.
    That is, one Invoice for each Sales order or each customer PO number from the delivery document.
    Billing based on Sales order is one solution, which is not possible in the current Bussiness scenario.
    Could anyone suggest some other solution?
    Regards,
    Jennifer Smily.

    Hello Jennifer,
    if I understood well you have: more sales orders (everyone wiht its PO number), delivered togheter within one delivery.
    Then you bill the delivery, and you need to create one billing document for every sales order.
    Is it right my understanding ?
    If so you could simply customize the copy control (transaction VTFL) at header level setting field 'Assignment Number' and/or field 'Reference number' with 'A' or 'B'.
    In this way field VBRK-ZUONR and/or VBRK-XBLNR of billing document is filled with PO number or sales order number, and one billing document for every sales order will be created.
    Best regards,
    Ivano.

  • Single idoc generation for multiple sales orders

    Hi,
    Pls let me know how do we generate single idoc for multiple sales orders.
    Its not collecting idoc. As we know we can generate an idoc for one sales order correspondingly
    my requirement is to generate single idoc number for multiple sales orders.
    Do we need to write a program.

    Amar,
    To understand take HRMD_A04 as example. Root segment has Maximum 9999999999 defined.
    Segm.type       E1PLOGI
    Minimum number  1
    Maximum number  9999999999
    Parent segment
    Hier.level      2
    This means that this IDOC types has capability to hold multiple HR Master data objects. PFAL program creates this IDOC and it has facility to mention the Objects per process, check selection screen.
    I checked for INVOICE01/02 its not possible there. Hope this clarifies.

  • How I can get the Billing Type for the sales order and its items

    How I can get the Billing Type for the sales order and its items. I mean from which SAP tables and how?

    Hi,
    You need to use two tables.
    First use VBFA. Enter the sales order number in the field Predecessar and the value M in SubCt field. This will give all the billing document number for the sales order items.
    Then use the billing document numbers in table VBRK, where in you can get the billing document type.
    Regards,

  • Discount limit for the sales order

    Hello,
    We have material discount should not exceeed certain amount for a sales order. ex: if i rise the sales order for different materials with No.s of qty'S. total material discount should be less than 1000.
    if i rise ia sales order for single material discount should be less tahn 1000. ie; irrespective materail and qty, discount should not exceed more than 1000.
    if discount is less than 1000 material discount should be calculated as usual.
    Thanks & Regards,
    ramesh

    Hello,
    maximum condition  value is to calculate the discount based on the value we specify here.
    ex; If we specify value in maximum condition  value  in condition record the system calculates the dicount based the value
    we specifed in maximum condition  value . if value exceeds in sales order i wont calculates the discount for other or another sales order.
    My requirement is discount should calculate for every sales order but not exceeding certain limit say 1000.
    if any body gives relevent solution it would be very helpfull.
    Thanks
    ramesh

  • Equipement details history for the sales order.

    Hi,
    I want to find out the details of the equipment for a particular sales order.
    I have creatde a sales order, delivery and the billing. I used the serial number for my material.
    Now i have cancelled the billing and then reversed the PGI and then changed the serial number and then proceded with billing.
    Now in which table(s) can i find the details of the changed serial / equipment number for my sales order.
    Thanks and Regards,
    Raya.

    Hi Raya
    Your subject line and your question seem to differ so I am not sure I am understanading correctly...but if you are wanting to be able to see the change for the serial number and what the serial number used to be then...when you are in IQ09 go to enter your new serial number and execute from the detail screen go to extra and look at changes.
    Now if you are wanting to view the table of the sales order for the changes made...you can check the change log tables  cdpos and cdhdr
    You can also use transaction AUT10; put in transaction code VA02 and enter a date range to limit your search results
    Edited by: Kim Blair on Sep 7, 2011 9:24 PM
    Edited by: Kim Blair on Sep 7, 2011 9:35 PM

  • Maximum number of Invoices for a Sales order

    Dear All,
    How many invoices we can make for a Sales order?
    Is there any maximum limit for that?
    How many documents can be shown in Document flow?
    Please let me know.
    Regards,
    Mullairaja

    hi mullairaja
    if in the case for partial deliveries you could process any number of invoices but only till the number of partial deliveries in the customer master data > sales area > shipping > partial deliery per item .....
    if the case of the sales order  is processed and delivery and COMPLETE  picking ...and PGI with respect to that delivery document you could only process one invoice ......
    IF you complete the whole sales cycle ...you can see the whole document flow in va02 by clicking document flow in the left top corner.
    the document flow will be more if their are many partial deliveries.
    <removed_by_moderator>
    Please read the "Rules of Engagement"
    Regards,
    JAGAN N M 
    SAP SD
    Edited by: Juan Reyes on Mar 14, 2011 9:35 AM

  • Number for every record that is retrieved from (query)

    Hello
    I wish to put a number for every record that is retrieved
    from the record that is output by this query
    For example
    For the first recored/row
    Generated number, ksnumber, date
    1, gg111 11/05/05
    2, oo235 12/06/05
    the query returned 2 records 1 and 2 are the number that is
    generated with this code.
    In addition if there is a built in function, where in the
    code do I put it???
    <cfquery name="gelov datasource="kl90">
    SELECT
    FROM
    WHERE
    ORDER BY
    <cfswitch expression="#Form.orderBy#">
    <cfks value="KSNUMBER">
    KS.KS_NBR
    </cfks>
    <cfks value="CREATIONDATE">
    KS.KREATDAT
    </cfks>
    </cfswitch>
    </cfquery>
    <!---html report--->
    <cfswitch expression="#Form.outputFormat#">
    <cfks value="HTML">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Ctwye Kss Report</title>
    </head>
    <style type="text/css">
    table{
    font-family:Arial, Helvetica, sans-serif;
    font-size:10px;
    td{
    font-family:Arial, Helvetica, sans-serif;
    font-size:10px;
    th{
    font-family:Arial, Helvetica, sans-serif;
    font-size:10px;
    h2{
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
    h3{
    font-family:Arial, Helvetica, sans-serif;
    font-size:13px;
    </style>
    <body>
    <cfoutput>
    <table border="0" cellpadding="3" cellspacing="0">
    <tr>
    <td align="center">
    <h3>Ctwye Kss
    Report</h3><br><br></td>
    </tr>
    <tr>
    <td align="center">
    </h2>report returned #getCtwyeKss.RecordCount#
    records</h2></td>
    </tr>
    <tr>
    <td>
    <table border="1" cellpadding="2" cellspacing="0">
    <tr>
    <td width="160">Ks Number</td>
    <td>Creation Date</td>
    <!--- <td class="dataField">Address</td>
    <td class="dataField">Type</td>
    <td class="dataField">Description</td>--->
    </tr>
    <cfloop query="getCtwyeKss">
    <tr bgcolor="<cfif currentrow mod
    2>GHOSTWHITE<cfelse>WHITE</cfif>">
    <td>#KS_NBR#</td>
    <td>#dateformat(KREATDAT,"mm/dd/yyyy")#</td>
    </tr>
    </cfloop>
    </table>
    </td>
    </tr>
    </table>
    </BODY>
    </HTML>
    </cfoutput>
    </cfks>
    <cfks value="CSV">
    <CFHEADER NAME="Content-Disposition" VALUE="attachment;
    filename=ctwye.csv">
    <cfcontent type="application/msexcel">"Ks
    Number","Creation Date"
    <cfoutput
    query="getCtwyeKss">#ltrim(KS_NBR)#,"#dateformat(KREATDAT,"mm/dd/yyyy")#"
    <tr #IIF(getCtwyeKss.CurrentRow MOD
    2,DE(''),DE('backgroundColor="##999"'))#>
    <!---<tr bgcolor="<cfif currentrow mod
    2>##808080<cfelse>##ffffff</cfif>"> --->
    </cfoutput>
    </cfks>
    </cfswitch>

    <cfks> is not a Coldfusion tag. Use <cfcase>
    instead.
    The following code will print the row numbers
    <cfquery name="gelov" datasource="kl90">
    select ksnumber, date
    from yourTable
    </cfquery>
    <cfoutput query="gelov">
    #currentrow#, #ksnumber#, #date#<br>
    </cfoutput>

  • What's the name of FM for getting Sales Order Header / Item Status info

    Hello All:
    Do you know what's the name of Function Module for getting Sales Order Header / Item Status Overview ? Any sample code will be very much appreciated.
    Basically, I am trying to create a Webpage where user can enter the Sales Order document number and will return the Sales Order: Status Overview.
    Thanks,
    Dipankar Biswas

    Thanks everybody ! Appreciate for your prompt response. I was also looking for some sample code, and I did find some on. And here is one. I still have to try the code, but here is for all your reference:
    *& Report ZBAPI_SALESORDER_GETSTATUS *
    *& Read and Display the Sales Order Items and Status of the Order *
    REPORT zbapi_salesorder_getstatus NO STANDARD PAGE HEADING LINE-SIZE 200 LINE-COUNT 33(3).
    TABLES: vbap. "Sales Document Item Data.
    DATA: wa_bapireturn TYPE bapireturn,
    wa_bapisdstat TYPE bapisdstat,
    it_bapisdstat LIKE STANDARD TABLE OF wa_bapisdstat.
    TYPES: BEGIN OF ty_mat_name,
    matnr TYPE makt-matnr,
    maktx TYPE makt-maktx,
    END OF ty_mat_name.
    DATA: wa_mat_name TYPE ty_mat_name,
    it_mat_name LIKE TABLE OF wa_mat_name WITH KEY matnr .
    PARAMETERS: p_vbeln LIKE vbap-vbeln DEFAULT 5573.
    START-OF-SELECTION.
    SELECT matnr maktx FROM makt INTO TABLE it_mat_name.
    CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'
    EXPORTING
    salesdocument = p_vbeln
    IMPORTING
    return = wa_bapireturn
    TABLES
    statusinfo = it_bapisdstat.
    IF wa_bapireturn IS INITIAL. " Successful Execution.
    WRITE: / 'Document No: ' COLOR 1, 20 'PO Number : ', 40 'Status' , 50 'Delv.Stat',60 'Item No', 80 'Material', 90 'Material Description', 130 'Net Price' COLOR 2.
    ULINE.
    LOOP AT it_bapisdstat INTO wa_bapisdstat.
    WRITE: / wa_bapisdstat-doc_number. " Sales Document Number.
    READ TABLE it_mat_name INTO wa_mat_name WITH KEY matnr = wa_bapisdstat-material.
    WRITE: /20 wa_bapisdstat-purch_no, " Customer Purchase Order Number
    40 wa_bapisdstat-prc_stat_h, " Processing Status
    50 wa_bapisdstat-dlv_stat_h, " Delivery Status
    60 wa_bapisdstat-itm_number, " Item Number
    80 wa_bapisdstat-material, " Material
    90 wa_mat_name-maktx, " Material Description
    130(10) wa_bapisdstat-net_price. " Net Price
    CLEAR wa_bapisdstat.
    ENDLOOP.
    REFRESH it_bapisdstat[].
    ELSE.
    WRITE: wa_bapireturn-message.
    ENDIF.

  • Create directly an IDOC for a sales orders

    HI,
    I would like to know if it exists a program to create an output IDOC for a sales order directly as does the program
    RBDSEMAT for materail / product.
    With RBDSEMAT we give the product's numeber the message type and the logical system.
    Of course before was customizing all the ALE flow.
    But for sales orders (VA02 / VA01) I don't find any program which allow us to have the same function.
    Does this program / function exist? I want juste to give the sales order number  the logical system and the message type.
    Thanks you
    Henri

    Funtion Module IDOC_OUTPUT_ORDRSP is used by standard SAP when output determination is used. I think you can populate the control record and use this function module directly. This will return the IDoc data, but the IDoc will not exist on the Database.

Maybe you are looking for

  • How to get the current schema name

    Hi, Can anybody please tell me how to get the current schema name, there is some inbuilt function for this,but i am not getting that. Please help me. Thanks Jogesh

  • Web Service tutorial using NetBeans 5.5 fails on OS X Tiger

    I have tried doing this tutorial using NetBeans 5.5 with the Enterprise Pack and Visual Web extensions installed. I am able to get it to run fine on my WinXP machine configured with the same NetBeans 5.5 stuff as the Mac. I have tried it several time

  • What is drop box for

    I notice that there is a folder called "drop box" in my public folder. What is this used for? I use dropbox but this is different. Thanks

  • Loading from web a pdf file comes up with "expecting a dict object"

    uploaded a pdf file to a password protected site. Have done this many times and have successfully read and downloaded pdf file from web site. On this occasion file attempts to download for reading then stops with message "Expecting a dict file" This

  • Oracle BI Administration Tool

    Ola... Estou importando um arquivo excel para uma tabela no banco de dados, diretamente pelo banco e tudo ok... mas quando vou no Administration e dou um click com o botão direito para visualizar os dados me da a seguinte mensagem: "No Data" Alguem s