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

Similar Messages

  • Table Name for Sales Order Header Text.

    Hi.
    Whats the Table name for Sales Order Header Text???
    Reg,
    Amol

    Hi Amol,
    please Try to check the below link
    http://scn.sap.com/thread/1361272
    http://scn.sap.com/thread/416757
    https://scn.sap.com/thread/1909247
    https://scn.sap.com/thread/811915
    Regards,
    Gurunath

  • Table name for sales order with Customer info

    Hi Gurus,
    Could you please provide me table name for  sales order with customer no and customer name.
    I have list of sales order number (more than 1000 no's ) i need to identify customer number and customer name (ship to party and sold to party information). I am running this report every week. so i plan to create sqvi for this report.
    Thanks and regards,
    B.Deethya.

    Hello,
    Access Tables VBAK & VBAP.
    From the above tables you will get Solt to Party & Ship to Party Codes.
    For Customer names you have to pass the Customer Codes to Table - KNA1
    Hope this clarifies.
    Thanks,
    Jignesh Mehta

  • Lookup Table Name for Sale Order Types

    Hello,
    What's the Lookup table name that contains the "meaning" for the column ORDER_TYPE_ID in the OE_ORDER_HEADERS_ALL table?
    Thanks,
    Smita

    Thank you Srikanth!
    I was just checking into the OE_TRANSACTION_TYPES table and it was empty!?
    But OE_TRANSACTION_TYPES_TL did the trick!
    Thanks again!
    Smita:)

  • Whats the fieldname and table name for purchase order delivery date

    hi all,
        whats the fieldname and table name for purchase order delivery date
      thanks and regrads

    EKET-EINDT is the delivery date according to the schedule lines.
    for example the line item has 100 qty.
    it is sent in three schedules (40, 40, 20).
    Then EKET will have 3 records for one PO Line item.
    The final delievry data is the EKET-EINDT for the 3rd schedule line item.
    Regards,
    Ravi

  • TABLE/FIELD FOR SALES ORDER'S SHIP TO LOCATION

    Hi everyone,
    Does anyone tell me what is the related tables/fields for Sales Order's Ship To Location? Since I want to display the Ship To Location information in the Oracle Report in Oracle Apps R11i.
    I tried to use the following SQL select statement to retrieve the Ship to address:-
    -- SHIP TO LOCATION
    select a.address_id, c.customer_name, C.CUSTOMER_ID, A.SITE_USE_ID from ra_Site_uses_all a, ra_addresses_all b, ra_customers c
    where a.site_use_code = 'SHIP_TO' and
    a.status = 'A' and
         b.address_id = a.address_id and
         c.CUSTOMER_ID = b.CUSTOMER_ID and
         b.status = 'A' and
         c.customer_id in (select customer_id from ra_customers) and
         c.status = 'A' and
         c.customer_name like 'CLARION (H.K.)%'
    But I found that the data is BILL TO address. Can anyone help me? Thanks.

    Hi all, I managed to solve my problem. Here's the query in case someone need it. Thanks
    SELECT party.party_name "Send to" (SELECT party.party_name
    FROM hz_cust_site_uses_all bill_su,
    hz_cust_acct_sites_all bill_cas,
    hz_party_sites bill_ps,
    hz_locations bill_loc,
    hz_parties party,
    oe_order_headers_all h
    WHERE h.invoice_to_org_id = bill_su.site_use_id
    AND bill_su.cust_acct_site_id = bill_cas.cust_acct_site_id
    AND bill_cas.party_site_id = bill_ps.party_site_id
    AND bill_loc.location_id = bill_ps.location_id
    AND bill_cas.party_site_id = bill_ps.party_site_id
    AND bill_ps.party_id = party.party_id
    AND h.order_number = 'your_order_number') "Invoice to"
    FROM oe_order_headers_all h,
    hz_cust_site_uses_all ship_su,
    hz_cust_acct_sites_all ship_cas,
    hz_party_sites ship_ps,
    hz_locations ship_loc,
    hz_parties party
    WHERE h.ship_to_org_id = ship_su.site_use_id
    AND ship_cas.party_site_id = ship_ps.party_site_id
    AND ship_su.cust_acct_site_id = ship_cas.cust_acct_site_id
    AND ship_cas.party_site_id = ship_ps.party_site_id
    AND ship_ps.party_id = party.party_id
    AND ship_loc.location_id = ship_ps.location_id
    AND h.order_number = 'your_order_number';

  • Tables identification for sales order fields

    experts
    1)I am having an order and it may have multiple deliveries.
    in what way i need to fetch all the deliveries for that order?
    lips-vgbel = vbap-vbeln , lips-vgpos- posnr will this work ?  or something else i need to use to get all the deliveries for that order?
    2)and for that deliveries i will be having shippiments and how to get that?
    3) from which table i can see whether return order exists for the sales order ?
    4) how can we identity whether credit memo there for the sales order or not?
    5)where(table) can we find the atp qunatity field which is there in sales order scheduline line data tab?
    thank you for all the help

    Hi
    1)I am having an order and it may have multiple deliveries.
    in what way i need to fetch all the deliveries for that order?
    lips-vgbel = vbap-vbeln , lips-vgpos- posnr will this work ? or something else i need to use to get all the deliveries for that order?
    Goto VBFA table, give your sales order number as VBFA-VBELV and fetch VBFA-VBELN where VBTYP_N = J
    2)and for that deliveries i will be having shippiments and how to get that?
    Goto VBFA table, give your Delivery number as VBFA-VBELV and fetch VBFA-VBELN where VBTYP_N = 8.
    3) from which table i can see whether return order exists for the sales order ?
    Goto VBFA table, give your sales order number as VBFA-VBELV and fetch VBFA-VBELN where VBTYP_N = H.
    If sy-subrc = 0
      return order exists
    else not.
    4) how can we identity whether credit memo there for the sales order or not?
    Goto VBFA table, give your sales order number as VBFA-VBELV and fetch VBFA-VBELN where VBTYP_N = K.
    If sy-subrc = 0
       credit memo exists
    else not.
    Hope this is sufficient for your. Rest you can do R&D.

  • Badi name for Sales order download from R/3 to CRM

    Hi Guys,
    Can some one give me the badi name for below requirement.
    Requirement:
    We are downloading the orders from R/3 to CRM system.while downloading the Order history from R/3, top level  VC (Variant config data) is also comming to CRM.
    But we want to download only 73 top level VC's Out of 103 top level vc.we want to filter the 30 Top level VC's before starting the Intial load of Sales orders in CRM system.
    I need a badi name in the R/3 system, which filters the 30 top level VC's while orders going to CRM system.
    I will allot Max points for Perfect Solution.
    Regards,
    Sathya Reddy.

    Hi Roberto,
    I need a badi name,which helps to delete the unwanted Top level vc's while starting an Intial load of orders from R/3 to CRM.I don't want see the Unwanted 30 top level vc's after intial load in the CRM order.
    Hope you understand the requirement.
    Regards,
    Sathya Reddy.

  • Table name for purchase order delivery fields

    Hi Gurus,
    Can you please tell me the name of the tables and the joining condition for purchase order delivery details like Name, street , city, postal code, address detail and the joining condition?
    Regards
    MD. SAMY

    Hi MD. SAMY,
    1. Table EKPO has details lat line item level.
    2. You must make a simple ABAP program in the infosets (or functional area) that contain a line "addrnumber = ekpo-adrnr" while addrnumber is ADRC table field.
    3. Choose fields that you want in ADRC and put it into new fields (e.g. : DELI_NAME2 = adrc-name2., etc)
    4. The new field attribute must be maintained in the infosets (in EXSTRA).
    5. Now in the query you have those fields.
    Regards,
    Sameer

  • Finding batch job name for sales order change (billing block)

    hi,
    there is a tab known as billing block in the sales order.
    now a batch job ran which removed this billing block and released the sales order for delivery and PGI activities.
    we have the information regarding the date and time on which this batch job ran but the job name is unknown.
    also we tried in SM37 which gives no details.
    we have information regarding the user name of the batch job but name is unknown.
    help us in finding the batch job name with the above mentioned available data.
    it is a very high priority.
    thanks in advance
    Rahman

    Hi ,
    in SM37-->
         a)Set the Job start condition ( dates ) --You have information --YOu can keep them blank if you don't have the information. But it will fetch all the batch jobs of the user.
         b) user Name  -You have information
         c_ use '*'  in place of Job name
    Then this will fetch you the Batch Job name . Then Check step --> you can find the program name.
    You can check the Log for job details like when started and when completed.
    Regards,
    Lanka

  • Copy control and program name for Sales Order to Delivery

    Hi,
    Please provide the copy control and program name to split a single delivery into multiple invoices depending on the sales order it belonged to and to split a single sales order into multiple deliveries depending on the shipping type.
    Thanks in advance.

    Hi there,
    In VTFL, at item level, there is a field called "Data VBRK/VBRP". Routine 001 & 007 are for invoice split. Those may be relevant for your case.
    In VOFM, select data transfer --> billing docs in the menu bar. It will give you the requirement numbers & their description.
    Select the required routine num & click on Source text (note pad icon) on the above. It will give you the prog / include names.
    For eg for 001 its FV60C001, for 007 its FV60C007.
    Regards,
    Sivanand

  • Table name for Sales Org/Plant combination for a given material?

    Hi Experts,
    I hv to find out that, weather the given material(actually, item of a sales order) have not been extended to the Sales Organisation / Plant on the sales order? or not?
    So, in this context am looking A555 table......but, here I found 300 entries, where as MARA does hv tonns of materails!!
    (A152, A153 tables do not hv any entry).
    1 - So, am I lookimg the correct table? or is there any other good table?
    2 - Is there any alternative(like FM) to validate the given materail againmst above said condition?
    thanq

    MVKE is the best table, the Sales view displayed in MM03 is referenced from this table.
    data: t_mvke like mvke.
      SELECT *
             INTO TABLE t_mvke
             FROM mvke
             WHERE matnr = p_matnr
             AND   lvorm <> 'X'
             AND   dwerk = p_werks.
    Hope this helps, if not let us know your requirement.
    Thanks,
    Sudhir.

  • Table name for Internal order group and Profit center group

    Hello Friends,
    Could any one provide me the table for Internal order group and Profit center group.
    We are developing new customized report and user requested internal order group and Profit center group in the selection criteria.
    I have checked for this tables but found only these fields in structures.
    Thanks in advance,
    Ravi Kiran.

    Or use FM [G_SET_TREE_IMPORT|http://www.sdn.sap.com/irj/scn/advancedsearch?query=g_set_tree_import] to read the hierarchy/Group. (Read FM and FG documentation, you can also add break-point and call some S_ALRxxx transaction which use this FM for the objects you need).
    Regards,
    Raymond

  • VBBE and VBBS tables entries for Sales order

    Hi,
    I am trying to do an enhancement. I want to understand when does sales order entries hit tables vbbe and vbbs. on which values is it dependent.

    Hi,
    Let me explain you wahat i exactly wana do. May be that will help you to provide me with solution. When I create a new sales order irrespective of referring, in vbbe table i want to insert business document and item no as the sales order no and item no. which is bring created. so i need to change the values of the field values of vbbe table while sales order is generated but after sales order no is generated in the code.

  • 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

Maybe you are looking for

  • Lightroom Imports Photos Upside Down

    I just started using Lightroom to import my photos directly from my camera. It worked fine for the first few times, but now it is reading all of my photos upside-down. XP's Camera Wizard correctly reads the orientation from the camera, so I think thi

  • Error when trying to connect to BT Fon

    My laptop was connecting to my BT Homehub, wirelessly, without any problem. When I moved it to another location and tried to connect to a BTFon hotspot, although the Wireless Network Connection in the system tray showed an Excellent/Good connection,

  • No photos in the photo stream folder

    I don't see any photos on my iPad 2 in the Photo stream folder after I have started to photo app several times. When I disable the photo stream function, restart the iPad and activate photo stream again It works. But only for a moment until I change

  • An album I pre-ordered now shows up as purchased, but not in purchase

    I bought the Marshall Mathers LP 2 Deluxe version in pre-order, but now that it is released, it isn't shown in my purchase history.  However, the album displays the purchased icon where the price usually is.  At first I accidentally pre-ordered the w

  • I can't print an email that has information that I need

    How to print emails