Help me on sales order history,

hi all,
i need to develop a report on sales order history,
please help me, what are the related tables to get sales order history

the SAPGUII cannot help you on this.
you should refer to the ERP-SD forum at SAP ERP Sales and Distribution (SAP SD)

Similar Messages

  • Sales order history tabels

    Hi all
      I have report to show combination of current sales order quantity and previous order quantity,to get the that detail i want to get the sales order history data maintaining tabel,please help me i want to get the sales order history tables

    HI,
       There is one way to know the past documents. All the past docuemnts are completely processed. So, all you have to do is to check the status of the sales documents in VBUK table. Check the field RFSTK in VBUK. If this is set, then the sales document is completly processed.
    Select all the sales documents with RFSTK = 'A" or 'B' or 'C". C- completly processed, B- partially processed, and A- Not yet processed.
    I hope your problem is solved.
    Regards,
    Vara

  • How Demantra Sales Order history can be loaded to ASCP

    Hi Experts
    Please let me know the stpes to loade Sale order history (old data) into ASCP using Demantra module. As I want to make use of Demantra module to generate Forecast using previouse sales orders and then i want to put into EBS (ASCP module)
    Thanks in advance
    RSHYD

    hi sunaina
    Use T.code OVAH
    message no V4 ---083 change this from warning to error
    System will throw error message if user try to change the quantity
    Also I doubt after GRIN / Invoice, in va02, still quantity is in change mode, so ask your ABAPer for any userexit or enhancement
    After billing is over if the user can change the quanity or able to add ne wline item in sales order in VA02 mode that too has to be controlled by user exit
    Regards

  • Table name for sales order history

    hi guys,
                   I want to know the name of table which contains sales order history.
    regards
    neelesh

    Hi
    Use this code it will get all the details
    Sales Order Changed History Display
    Sales Order Changed History Display
    You can execute the report by :
    1.  Change Date
    2.  User Name
    3.  Sales Order Number
    Submitted by : SAP Basis, ABAP Programming and Other IMG Stuff
                   http://www.sap-img.com
    REPORT ZSDCHANGE LINE-SIZE 132 NO STANDARD PAGE HEADING
                     LINE-COUNT 065(001)
                     MESSAGE-ID VR.
    TABLES: DD04T,
            CDHDR,
            CDPOS,
            DD03L,
            DD41V,
            T685T,
            VBPA,
            TPART,
            KONVC,
            VBUK.
    DATA: BEGIN OF ICDHDR OCCURS 50.
            INCLUDE STRUCTURE CDHDR.
    DATA: END OF ICDHDR.
    SELECT-OPTIONS: XUDATE FOR ICDHDR-UDATE,
                    XNAME  FOR ICDHDR-USERNAME,
                    XVBELN FOR VBUK-VBELN.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
    PARAMETERS: SUDATE RADIOBUTTON GROUP R1,
                SNAME  RADIOBUTTON GROUP R1,
                SOBID  RADIOBUTTON GROUP R1.
    SELECTION-SCREEN END OF BLOCK BLK1.
    DATA: WFLAG,
          WCHANGENR LIKE CDHDR-CHANGENR,
          WUDATE LIKE CDHDR-UDATE,
          WNAME  LIKE CDHDR-USERNAME,
          WVBELN LIKE VBUK-VBELN,
          WDEC1 TYPE P DECIMALS 3,
          WDEC2 TYPE P DECIMALS 3,
          WDEC3 TYPE P DECIMALS 3,
          WDEC4 TYPE P DECIMALS 3.
    DATA: UTEXT(16) VALUE 'has been changed',
          ITEXT(16) VALUE 'has been created',
          DTEXT(16) VALUE 'has been deleted'.
    DATA: BEGIN OF ICDSHW OCCURS 50.
            INCLUDE STRUCTURE CDSHW.
    DATA: END OF ICDSHW.
    DATA: BEGIN OF ITAB OCCURS 10.
            INCLUDE STRUCTURE CDSHW.
    DATA:   UDATE LIKE CDHDR-UDATE,
            USERNAME LIKE CDHDR-USERNAME,
            CHANGENR LIKE CDHDR-CHANGENR,
            VBELN(10),
            POSNR(6),
            ETENR(4),
            INDTEXT(200),
      END OF ITAB.
    SELECT * FROM VBUK WHERE VBELN IN XVBELN.
      CLEAR CDHDR.
      CLEAR CDPOS.
      CDHDR-OBJECTCLAS = 'VERKBELEG'.
      CDHDR-OBJECTID   = VBUK-VBELN.
      PERFORM READHEADER.
      PERFORM READPOS.
      LOOP AT ITAB.
        CASE ITAB-TABNAME.
          WHEN 'VBPA'.
            IF ITAB-FNAME = 'KUNNR' OR
               ITAB-FNAME = 'LIFNR' OR
               ITAB-FNAME = 'PARNR' OR
               ITAB-FNAME = 'PERNR' OR
               ITAB-FNAME IS INITIAL.
             MOVE ITAB-TABKEY TO VBPA.
             SELECT SINGLE * FROM TPART WHERE SPRAS = SY-LANGU
                                       AND   PARVW = VBPA-PARVW.
             IF SY-SUBRC = 0.
               REPLACE '&' WITH TPART-VTEXT INTO ITAB-INDTEXT.
             ENDIF.
           ENDIF.
         WHEN 'VBAP'.
           IF ITAB-FNAME IS INITIAL.
             REPLACE '&' WITH 'Item' INTO ITAB-INDTEXT.
           ENDIF.
         WHEN 'KONVC'.
           MOVE ITAB-TABKEY TO KONVC.
           SELECT SINGLE * FROM T685T WHERE SPRAS = SY-LANGU
                                     AND   KVEWE = 'A'
                                     AND   KAPPL = 'V'
                                     AND   KSCHL = KONVC-KSCHL.
           IF SY-SUBRC = 0.
             REPLACE '&' WITH T685T-VTEXT INTO ITAB-INDTEXT.
           ENDIF.
         ENDCASE.
         IF ITAB-INDTEXT(1) EQ '&'.
           REPLACE '&' WITH ITAB-FTEXT(40) INTO ITAB-INDTEXT.
         ENDIF.
         IF ITAB-CHNGIND = 'I'.
           REPLACE '%' WITH ITEXT INTO ITAB-INDTEXT.
         ELSEIF ITAB-CHNGIND = 'U'.
           REPLACE '%' WITH UTEXT INTO ITAB-INDTEXT.
         ELSE.
           REPLACE '%' WITH DTEXT INTO ITAB-INDTEXT.
         ENDIF.
         CONDENSE ITAB-INDTEXT.
         MODIFY ITAB.
       ENDLOOP.
    ENDSELECT.
    IF SUDATE = 'X'.
      SORT ITAB BY UDATE VBELN POSNR ETENR.
    ELSEIF SOBID = 'X'.
      SORT ITAB BY VBELN POSNR ETENR UDATE.
    ELSE.
      SORT ITAB BY USERNAME VBELN POSNR ETENR UDATE.
    ENDIF.
    LOOP AT ITAB.
      CLEAR WFLAG.
      IF SUDATE = 'X'.
        IF WUDATE NE ITAB-UDATE.
          SKIP.
          WRITE:/001 ITAB-UDATE,
                 023 ITAB-USERNAME,
                 037(10) ITAB-VBELN.
          WFLAG = 'X'.
          WUDATE = ITAB-UDATE.
          WCHANGENR = ITAB-CHANGENR.
        ENDIF.
      ELSEIF SOBID NE 'X'.
        IF WVBELN NE ITAB-VBELN.
          SKIP.
          WRITE:/001 ITAB-VBELN.
          WVBELN = ITAB-VBELN.
        ENDIF.
      ELSE.
        IF WNAME NE ITAB-USERNAME.
          SKIP.
          WRITE:/001 ITAB-USERNAME.
          WNAME = ITAB-USERNAME.
        ENDIF.
      ENDIF.
      IF WCHANGENR NE ITAB-CHANGENR.
        WRITE:/023 ITAB-USERNAME,
               037(10) ITAB-VBELN.
           WFLAG = 'X'.
           WCHANGENR = ITAB-CHANGENR.
        ENDIF.
        IF WFLAG = 'X'.
          WRITE: 013 ITAB-CHNGIND,
                 049 ITAB-POSNR,
                 057 ITAB-ETENR,
                 065 ITAB-INDTEXT(60).
        ELSE.
          WRITE: /013 ITAB-CHNGIND,
                  049 ITAB-POSNR,
                  057 ITAB-ETENR,
                  065 ITAB-INDTEXT(60).
        ENDIF.
      WRITE:/065 ITAB-F_OLD.
      WRITE:/065 ITAB-F_NEW.
    ENDLOOP.
    FORM READHEADER.
      CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
           EXPORTING
                DATE_OF_CHANGE    = CDHDR-UDATE
                OBJECTCLASS       = CDHDR-OBJECTCLAS
                OBJECTID          = CDHDR-OBJECTID
                TIME_OF_CHANGE    = CDHDR-UTIME
                USERNAME          = CDHDR-USERNAME
           TABLES
                I_CDHDR           = ICDHDR
           EXCEPTIONS
                NO_POSITION_FOUND = 1
                OTHERS            = 2.
      CASE SY-SUBRC.
        WHEN '0000'.
        WHEN '0001'.
          MESSAGE S311.
          LEAVE.
        WHEN '0002'.
          MESSAGE S311.
          LEAVE.
      ENDCASE.
    ENDFORM.
    FORM READPOS.
      LOOP AT ICDHDR.
        CHECK ICDHDR-UDATE
                            IN XUDATE.
        CHECK ICDHDR-USERNAME
                              IN XNAME.
        CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
             EXPORTING
                  CHANGENUMBER      = ICDHDR-CHANGENR
                  TABLEKEY          = CDPOS-TABKEY
                  TABLENAME         = CDPOS-TABNAME
             IMPORTING
                  HEADER            = CDHDR
             TABLES
                  EDITPOS           = ICDSHW
             EXCEPTIONS
                  NO_POSITION_FOUND = 1
                  OTHERS            = 2.
        CASE SY-SUBRC.
          WHEN '0000'.
            LOOP AT ICDSHW.
              CHECK ICDSHW-CHNGIND NE 'E'.
              CLEAR ITAB.
              MOVE-CORRESPONDING ICDHDR TO ITAB.
              MOVE-CORRESPONDING ICDSHW TO ITAB.
              CASE ITAB-TABNAME.
                WHEN 'KONVC'.
                  MOVE ICDHDR-OBJECTID TO ITAB-VBELN.
                  MOVE ICDSHW-TABKEY(6) TO ITAB-POSNR.
                WHEN OTHERS.
                  MOVE ICDSHW-TABKEY+3(10)  TO ITAB-VBELN.
                  MOVE ICDSHW-TABKEY+13(6)  TO ITAB-POSNR.
                  MOVE ICDSHW-TABKEY+19(4)  TO ITAB-ETENR.
              ENDCASE.
              MOVE '& %' TO ITAB-INDTEXT.
              APPEND ITAB.
              CLEAR ITAB.
            ENDLOOP.
          WHEN OTHERS.
            MESSAGE S311.
            LEAVE.
        ENDCASE.
      ENDLOOP.
    ENDFORM.
    TOP-OF-PAGE.
    WRITE:/ SY-DATUM,SY-UZEIT,
           50 'SALES ORDER CHANGE HISTORY',
          120 'Page', SY-PAGNO.
    WRITE: / SY-REPID,
             60 'SALES ORDERS STATISTICS'.
    SKIP.
    ULINE.
    IF SUDATE = 'X'.
      WRITE:/001 'Change Date',
             013 'Time',
             023 'User Name',
             037 'Sale Order',
             049 'Line',
             057 'Sch No',
             065 'Changes'.
    ELSEIF SOBID = 'X'.
      WRITE:/001 'Sale Order',
             013 'Line',
             021 'Sch No',
             029 'Change Date',
             041 'Time',
             051 'User Name',
             065 'Comment'.
    ELSE.
      WRITE:/001 'User Name',
             015 'Time',
             025 'Change Date',
             037 'Sale Order',
             049 'Line',
             057 'Sch No',
             065 'Changes'.
    ENDIF.
    ULINE.
    *--- End of Program
    Regards
    Shiva

  • Question about table of Sales Order History?

    Dear All,
    In SAP B1 SP01, when I click "Tools" --> "Change log", it will display what is the different between previous version.
    May I know which table is for sales order history?
    From Samson

    Table is ADOC, objtype is 17
    select * from adoc where objtype = 17 and docentry = XX
    where XX is docentry of sales order

  • Sales Order History

    Hi,
    I have created a report for Sales History in which i need to display all records from inquiry to payment.
    My problem is i cannot display those records which directly start from sales order not from inquiry.
    I am displaying quotation based on inquiry and sales order based on quotation.
    How to display directly sales order without quotation number??
    Can u help me with the logic??
    Thanks,
    Mrudula
    FORM DATA_RETRIEVAL.
    *&----------------------CUSTOMER NO----------------------------------------------*
    select  KUNNR
           " VBELN
           into corresponding fields of table IT_SALES from
            VBAK
           where BUKRS_VF IN S_BUKRS AND ERDAT in S_ERDAT AND KUNNR IN S_KUNNR AND VKORG IN S_VKORG.
           "AND VBTYP = 'A'.
    *&----------------------INVOICE NO----------------------------------------------*
    LOOP AT IT_SALES INTO IT_ITAB.
        SELECT VBELN
           FROM  VBAK INTO
          (IT_ITAB-VBELN)
        WHERE
          VBTYP = 'A' AND
          KUNNR = IT_ITAB-KUNNR.
          MODIFY IT_SALES INDEX sy-tabix FROM IT_ITAB
                TRANSPORTING VBELN.
          ENDSELECT.
    ENDLOOP.
    *&---------------------QUOTATION NO-----------------------------------------------*
      LOOP AT IT_SALES INTO IT_ITAB.
        SELECT VBELN
           FROM  VBAK INTO
          (IT_ITAB-VBELN1)
        WHERE
           VGBEL = IT_ITAB-VBELN and
          VBTYP = 'B' AND KUNNR = IT_ITAB-KUNNR.
          MODIFY IT_SALES INDEX sy-tabix FROM IT_ITAB
                TRANSPORTING VBELN1.
          ENDSELECT.
    ENDLOOP.
    *&----------------------SALES ORDER NO----------------------------------------------*
    LOOP AT it_SALES INTO IT_ITAB.
    SELECT VBELN
            FROM  vbaK   INTO
          (iT_ITAB-VBELN2)
        WHERE
          VKORG IN S_VKORG and KUNNR = IT_ITAB-KUNNR AND VGBEL = IT_ITAB-VBELN1  AND
          vBtyp = 'C'.
         MODIFY it_SALES INDEX sy-tabix FROM IT_ITAB
                TRANSPORTING VBELN2.
    ENDSELECT.
    ENDLOOP.

    I might consider starting with sales order documents, then retrieving any prior documents based upon the prior (originating and reference) document entries in VBAP (and NEVER by reading VBFA backward).  But I would almost never start a sales report from VBAK; that's the wrong place.  Read SAP NOTE 185530 on how to do efficient SD reporting.

  • Query help needed for Sales order panel user field query.

    I have a user defined form field on sales order row level called = U_DEPFEEAMT
    1, I would like this field to get the value from a field on this sales order row level multiplied by what is in point 2 below. The details of field in point 1 is :
    Form=139, item=38, pane=1, column=10002117, and row=1
    2. The contents in field 1 should be multiplied  by a value coming from another user field linked to OITM master item.
    The details of user field attached to OITM is :
    OITM.U_DepositFeeON
    Appreciate your help.
    Thank you.

    Try this one:
    SELECT T0.U_DepositFeeON*$[$38.10002117.number\]
    FROM dbo.OITM T0
    WHERE T0.ItemCode = $[$38.1.0\]
    Thanks,
    Gordon

  • Help needed in sales order/ quality management

    In standard sap it is possible to assign an inspection to the delivery type. But client wants a non standard sap inspection to be done at time of order. is it possible? If it is please do help me in customizing this. Thank you in advance.
    M. Ali

    hi,
    Please try table VBFA with fields VBELV = <sales order> and VBTYP_N = 'J' (Shipping/Delivery).
    and also try this also
    if you know delivery number for order ,then you could use FM VTTP_READ
    if you need delivery number from sales order then use VBAP-VGBEL
    pass delivery number to FM or pass the value to VTTP Table
    thanks,
    <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

  • Blocked Sales Order History Report

    Dear Friends,
    Is there any standard report available in SD to list who removed blocks in sales order and similarly in credit management for credit limits.
    Thanks & Regards,

    Hi Pawan,
    SAP has provided approx. 1500 standard reports. If the required report is not available in the Easy Access, you use the Tcode- SARP and then select the related report tree. eg., to view the credit limits of your customers.,
    T Code - SARP
    Select FIAR
    click on Display on the application tool bar
    open the credit management section in the tree
    open the Brief Overview
    Double click on the Credit limit Overview
    Give the customer number ranges for whom you want the report and the CControl Area
    and then execute.
    Hope this helps you.
    Ravi Sankar

  • Help with deleted sales orders

    Hi everyone,
    I have an issue with sales order deletion.  We load BW nightly.  If a sales order is created one day and deleted the next day we get a record for a positive qty and a record for a negative qty, this is ok.  The problem is when the record is created and deleted the same day, this creates a negative qty amount that does not have a positive amount to cancel out and in turn throws our sales qty's off.  Can anyone help?
    Thank you,
    Aaron Blasi

    Hi AVR,
    Thanks for the reply.  What I am trying to figure out is why the extractor sends only the negative amount record when the sales order is created and deleted the same day.  What happened to the positive amount record?  does anyone know why or has anyone come accross this issue.
    Thanks,
    Aaron

  • I need help on Complete Sales Order Cycle using Business One

    Hai,
       Actually I am crating an external application using Business one DI API, Now I need a Complete Cycle of Sales Order Cycle from Sales Order Creation to Goods issues, goods receipt ,invoice generation , pick and pack etc
       Anybody Please help me out on generating a Complete Sales Order Cycle using Business One GUI or theory by using Business One
      Please help me out in this regard
      with regards
    Somaraju

    Somaraju,
    You may want to look at the Sample Code example that is part of the 2005A Business One SDK that shows and external Business One interface written in VB.Net that shows how to create a Sales Order/Invoice in SAP Business One.  This example can be found at: Start > Programs > SAP Business One > SDK > Samples > COM DI > 05. OrderAndInvoice.  For complete training on the processes you are asking about from within the SAP Business One product, you can reveiw the SAP Business One eLearning product training if you are and SAP Business One partner in the areas that you have outlined at service.sap.com/smb.
    Hope that helps,
    Eddy

  • Help on Indent Sales Order Creation - Missing Items in Purchase Requisition

    Hi Experts,
    We have Indent Sales setup where when we create Indent Sales Orders it will also create Purchase Requisitions. But we have encountered a lot of of missing items in the Purchase Requisition that are in Indent Sales. Have you encountered this kind of behavior? What are the usual suspects (configuration-wise) for this scenario?
    Thanks for your Help!

    hi,
    please check the SCHEDULE LINES for those PR is getting generated and also for not generating.
    PLEASE CHECK THE SCHEDULE LINE CATEGORY CONTROL FEATURES on the same
    hope this clears your issue
    balajia

  • Sales order history table

    Hello,
    i m getting confused can any one tell me in which
    table the changes made in sales order  are stored.

    Hi Gouri,
    Changes to a lot of SAP documents are stored in table CDHDR and table CDPOS. This include changes such as: change data in Material Master, changes to Purchase Req (PR), Purch Orders, Contracts, Sales Orders.
    CDHDR - Change Document Header.
    CDPOS - Change Document Items.
    Hope it helps u!
    Regards,
    Mamta

  • Sales Order History Report using CHANGEDOCUMENT_READ_POSITIONS

    I have used  FM CHANGEDOCUMENT_READ_POSITIONS
    to retrieve all the changes made on Sales Order item.
    Can anyone tell me if i wanna retrieve deleted item and with the value. How can be done?

    How to activate Achieving in SD module???
    Yeah, i can get the item...but without the item net price value (old value + new value )
    If i deleted an SO item with 10.00 net price...then how to get back the 10.00 net price...?
    any idea??

  • Help! losing sales orders in the order list from cumulative value VK13

    Hi Experts,
    Now we are facing a problem that when user going to check for which orders the condition record was used, the T-Code is VK13.
    Path: VK13 -> Display the condition record -> additional data -> Extra -> Cumulative values -> First Sales orders
    they found some orders are missing in that list, but in previous system, the list was included all the order numbers which used this condition record, so it's confusing for them to tracking the utility of this condition record.
    Can anyone share your idea on it such as 1. whether user exit exists there, what the user exit name? 2. whether configuration should be changed, which configuration should be modified, your idea will be highly appreciated!

    Sorry for confusing, the thing is only the first 3 orders of individual month will be displayed. No issue now

Maybe you are looking for