Report on deleted sales orders ( va02)

hi,
i got one requirement to write a program to display the list of deleted sales orders (through VA02 Tcode).
to my knowledge when a sales order is deleted through VA02 the order will be deleted from the database itself and will be deleted from all the SAP tables.
if that is correct, is there any possibility that we can create a Ztable and update the data before deletion or any other solution for the above requirement?
thanks in advance,
Rajani yeluri

hi rajani,
u will get deleted data from using tables CDHDR,CDPOS,CDRED and function module '  CHANGEDOCUMENT_READ'.
i am sending u some sample code, i hope it will helps u
DATA: it_editpos    LIKE cdred OCCURS 0 WITH HEADER LINE,
                                 "Change documents, display structure
      it_editpos1   LIKE cdred OCCURS 0 WITH HEADER LINE,
                                 "Change documents, display structure
      x_editpos1    LIKE cdred,  "Change documents, display structure
        x_editpos     LIKE it_editpos,
                                 "Change documents,display structure
*-----Calling FM to populate the structure 'EDITPOS'
  CLEAR it_editpos.
  CALL FUNCTION 'CHANGEDOCUMENT_READ'
       EXPORTING
          objectclass                = ' ' 
       TABLES
            editpos                    = it_editpos
       EXCEPTIONS
            no_position_found          = 1
            wrong_access_to_archive    = 2
            time_zone_conversion_error = 3
            OTHERS                     = 4.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
  CLEAR: x_editpos,
         it_editpos1.
  LOOP AT it_editpos
    INTO  x_editpos
    WHERE tcode = 'ME21N' OR  "Here u have 2 pass 'VA02'
          tcode = 'ME22N' OR
          tcode = 'ME23N'.
    APPEND x_editpos TO it_editpos1.
    CLEAR x_editpos.
  ENDLOOP.
now it_edipos1 has all CHANGENR numbers, so now u have to fetch data from F_NEW and F_OLD Fields
i hope this will helps u
Regards,
prasad

Similar Messages

  • How to view the cancelled/deleted sales order?

    Hi SAP Gurus
    I there any T.code/Table to view the cancelled or deleted sales order.
    I am not able to view the order even in VA03.
    Regards
    Giridhar

    Dear Sushmitha,
    T. Code: SE16
    Key-in -
    Table: CDHDR - Change Document Header.
    Table: CDPOS - Change Document Items.
    and "Enter". On to next page, Key-in
    Field: Change doc. object (OBJECTCLAS) as VERKBELEG
    Field: Transaction Code as VA02
    Field: Appl.obj.change, as D - Delete, and execute (F8).
    Then you will get object values (sales orders) and document numbers. Pass these two values along with objectclas: VERKBELEG) to table CDPOS to get more details about these deleted orders.
    Also, Go to -
    T. Code: SE38,
    and execute Report: RVSCD100.
    Enter Sales Document Number and Execute. This will provide information, who deleted the order.
    Best Regards,
    Amit

  • Delete sales order created more than three days ago

    Hi Experts,
    "Business has created lot of sales order  for prepayment. Only part of them are converted to deliveries, rest are stored in database.
    In Open sales orders report old orders are confusing, because of Country legislation the conditions of a sales order are valid during 3 working days. Therefore after 3 days not paid orders should be deleted."
    Kindly let me know if we have a standard fucntionality in SAP through which we can pull open sales order more than 3 days old and then can delete the same.
    If not can you help me in understanding the Logical Flow that is needed to meet the Business Requirement through a customized program.
    Looking forward to seeing your replies.

    Hi,
    As per your business requirement stated above I recommend not to delete any sales order instead use a Zprogram for sales order and mark them as "MARK FOR REJECTION".
    Doing this will solve your problem of getting unnecessary sales order in standrad report of Open sales order as in standard Rejected Sales order are not considred as in VA05 Report. and also keep record of the sales order created by you for future purpose.
    further to this as per your business requirement you have to mark line Item wise "Mark For Rejection.
    Here in coding you can give logic from Document creation date or Document Date + 3 Days if that is < system date then mark them for rejection.
    Hope this solves your purpose.

  • How to find out the deleted sales order

    hi,
    sap gurus,
    my core user has deleted one sales order
    its showing as sales order is ARCHIVED in the status when we go for VA02
    in SAP in which table the deleted sales order will be stored.
    so that i can
    regards,
    balaji.t

    Plz SEARCH in SCN before posting.
    You can get those details from CDHDR, CDPOS tables.
    Give OBJECTCLAS = VERKBELEG and CHNGIND = 'D' in CDPOS table.
    You will the List of all Deleted Sales Orders.

  • Information about the deleted sales order line item in idoc.

    Hi Experts,
    I am new to IDOC.We have the following idoc requirement,
    When a line item is deleted from the sales order(VA02) ,
    the outbound idoc getting triggered for the sales order has the information about the rest all line items other than the deleted line item.We now want the information about the deleted line item in the Idoc .
    Please help me in proceeding further.

    Hi,
    I am facing the same scenario of capturing the  deleted sales order line item in idoc.
    I am using ORDRSP message type , where in E1EDP01- ACTION contains value  "000" .
    And the Deletion line item is not been captured, is there any configuration setting required to
    capture the deleted line item in Idoc.
    Based on the posting in this thread i understand that there is an  indicator which has to be set .
    Please let me know what is that indicator and how to set it?
    Thanks
    Sathish

  • User exit in a delete sale order

    hi people,
    I would like to trigger a process when I delete manually and phisically a sale order (va02->delete). Do you know the user exit where i can write my code?
    thx in advance

    Include <b>MV45AFZZ</b> - FORM USEREXIT_DELETE_DOCUMENT.

  • Deleted Sales Orders Issue

    Hi,
    I have a typical issue with Sales Order deletion in R/3
    In R/3,the Sales Orders have been physically deleted due to which the sales orders are not available in the tables.
    In R/3 reports those Sales Orders are not reflected. But in BI, since they have already been loaded, they are showing in the results since the SOs at that time were loaded to BI. Once documents are deleted in R/3  those changes are not reflected  in to BI. This discrepency is not acceptable by the customer. Plz help in how to resolve the issue.
    Many Thanks
    Uday

    Hi Uday,
    It seems the same issue has been discussed sometimes back ,but no solutions were given.
    Deleted sales order items and delta direct
    As I said earlier,extractor will not capture those deleted items. Even enhancement may also not work for this case. Anyway,please check with OSS whether any solutions available for this problem .I convinced my users to go for the cancellation (not mark for deletion) of the items. 
    Below link will give you the info about why it is not a good practise to delete the item .
    deleted sales order
    All the best.
    Thanks.

  • Require to delete sales order

    Hello
    All the contributors,
    plz to give me a right solution, Req_urjent.
    Query:
    with PO against Sales order ( indvidual purchase order_ sales process.)
    with ref PO- raised sales order, and also delivery with PGI,
    but when raised a  sls order customer code entered wrongly of other customer code, here i followed vl09 reverse goods entry, and vl02n deleted delivery, but when deleting the sls order in va02 the sls order unable to delete and getting some message of cost management account issue.
    so know i want to raise with the same Purchase Order Number with right customer code,
    therefore requiring how to delete sales order. plz help out me.
    thanking for all.

    Hi there,
    You willnot be able to delete the sales order. You will only be able to reject the line items in the order. Once you enter the reason for rejection, the order line items are not further processed.
    Regards,
    Sivanand

  • Find deleted sales order

    hi all
    can any one help me finding out the deleted sales order
    what is the process for it.
    thanks
    sridhar

    HI,
    Try FTWB or SARA.
    or
    after deliting sales order its gone out of database, then also you can see the change history of who deleted the order and when. To do this (I'm on 3.1I), go to Sales Order --> Display --> put the number in and go to Environment --> Changes. Then Green check and it will tell you the history.
    After the record (order) gets deleted from the database, to get a list of records deleted you will need to run a report (user defined), with the query for VBAK table, for order type and the missing numbers. The date may also be required. Once you get this, you can find out when and who changed (deleted) the documents.

  • Deleted Sales Orders

    Hi,
        Business needs to get the data back for all the deleted sales orders for a period. Is there any way these data can be retrieved. When I put the sales orders number system says "Sales Document XYZ is not in the database or has been archived".
      Your views are much appreciated.
    Regards
    Raj

    Hi,
    There is only one option available by which you can track changes done for a particular sales order which has been deleted.
    thru VA02, go to an existing Sales order, click on tab ENVironment, changes.
    Here, you will find, the existing sales order number. Delete this number and enter the number of the sales order that was deleted & for whose details you intend to RETRIVE.
    You will get a change LOG, which will give u complete details of the changes done for that Sales order.
    Reward points if found useful.
    Regards,
    C. Ramakrishna

  • Finding Deleted Sales Orders

    Hi,
    Is it possible to find a deleted sales order in SAP?
    Thanks,
    Malini.

    Individually
    Even though the sales order is gone from the database, you can still see the change history of who deleted the order and when. ?To do this?go to Sales Order> Display>put the number in and go to Environment>Changes ?- then check and it will tell you the history. Hope this helps somewhat!
    As a List
    Though Sales orders are Deleted, they will be available in Change document tables CDHDR for header changes and CDPOS for item changes . Changes includes deletion also.
    So run a Logic based on these two tables.
    You shud get a report of all deleted sales order.
    Use the report in the following link to base your logic.
    http://www.sap-img.com/ab024.htm
    Hope this Helps
    VB

  • Log for deleted sales order

    Hi Gurus,
    Problem is: Some one has deleted some sales order from the system.
    Now we need to know who has deleted the sales order, can any one tell me how to find out the log for deleted sales order.
    Thanks,
    Abhishek.

    Hi,
    Check report RVSCD100.
    Thanks,
    Raja

  • Self Updating Report of Open Sales Orders (Maybe Crystal )

    I want a self updating report of Open Sales Order. I want it to refresh constantly. I know that it could be an alarm but it would be executed every # minutes and dont want to. Any ideas ? I dont know Crystal Reports enough but is it posible ?

    Hi ,
    If I were you , I will not be crazy looking at my sales order in every 1 minutes ..I would train my users to check at least 15 minutes.
    I understand what u are trying to do;you  want that customer will see the latest open SO created ..but 15 minutes is good enough time .
    I think you have to check if database size grows up big time ..so far no report has come to me from my clients for this set up .
    make sure you  are not saving an alert into database
    If you are using multiple alerts , I will atleast monitor my database for a while to see i encounter performance issue ..
    So far for one alert at every 15 minutes ..i think u should be fine ..
    Hope this helps
    Bishal

  • Report for viewing Sales order no against delivery date & actual GI date

    Hi Experts,
    Is there any report for viewing Sales order no against delivery date & *actual GI date*
    Because in VL06F , i can only able to get planned GI.
    Please guide regarding the same where i can get 'ACTUAL GI DATE ' against above combination .
    Regards,
    Sujit S.

    dear Hrishi,
    i followed your suggestion, but couldn't get desired results,
    here i can get planned GI date, where i wanted to get Actual GI date for complted deliveries,
    thanks for your valuable reply.
    @ G. Lakshmipathi ;-
    i think i will need to develop z-report for fetching the data from the tables
    VBAK (to get sale order reference) and
    LIKP (to get delivery and actual GI date)
    thanks for your reply,
    Regards,
    Sujit

  • Do we have standard report to show sale order stock with amount?

    Do we have standard report to show sale order stock with amount?
    I try to use MB5B and MBBS but they don't show value.
    MB5B show only qty
    MBBS no any report.
    Please kindly help.
    Thank you very much.

    Okay Thank you very much for your suggestion.
    I think I have to create a new ZProgram. T_T

Maybe you are looking for