How to determine via SQL who created the sales order

Hello I am trying to determine via SQL who created the Sales Order.  I'm looking at the ADOC table but having a hard time determining which record points to the sales order creation.

Hi Jimmy,
Try this:
select
     T0.[DocNum], T2.[DocDate], T2.[CardCode], T2.[CardName],
     T1.U_NAME as [User Name], T2.UpdateDate as [Cancelled Date]
from
     ORDR T0
     inner join OUSR T1 on T0.UserSign = T1.UserID
     inner join ADOC T2 on T0.DocNum = T2.DocNum
where
     T2.LogInstanc = (select min(LogInstanc) from ADOC T3 where T3.ObjType = 17 and T3.DocNum = T0.DocNum and T3.CANCELED = 'Y')
     and T2.CANCELED = 'Y'
     and T2.ObjType = 17
group by
     T0.DocNum, T2.DocDate, T2.CardCode, T2.CardName, T1.U_NAME, T2.UpdateDate
Kind Regards,
Owen

Similar Messages

  • Address number of the person who created the sales order.

    Hello Experts,
       I am currently making a report in which it has to send the output of the script as a email attachment to the person who created the sales order. For this i am using a standard include RVADOPFO but here we need to pass the address number and person number gor getting the rest of the details. So where i can find the address of the person who created the sales order. (I am able to get the name throuhg VBDKA-ERNAM, but i need address number of that person)
    Thanks & Regards,
    Uday S.

    Hi  Uday,
    check
    ADRC-NAME1 = VBAP-ERNAM
    in ADRC you will get the address of the SO created person in the field ADDRNUMBER  that you have to pass in the ADR6-ADDRNUMBER   you will get the mail address in the field ADR6-SMTP_ADDR
    hope it helps you
    Thanks!
    Edited by: Prasanth on Mar 12, 2009 3:15 PM

  • How to put the value in Header test while creating the sales order

    Hi ,
    I am creating the Sales order using the Idoc Orders05 .
    I have to pass the value in the header text 1. the value is a transaction id which is a string value.
    If anyone has an idea how to do this using the the Orders Idoc. it would be a great help
    Thanks
    Nikhil

    If you have access to idoc before calling the processing Function module, Adding header text segments E1EDKT1 and E1EDKT2 to the idoc will create the header text.
    Regards
    Sridhar

  • How to create the sales order using BAPI's ....?

    Hi Guru's,
    could you please provide how to create the sales order using BAPI's .....i need step by step process and please provide the details from scratch....basically  i don't have basic knowledge on this....please provide required inputs ....:)
    thanks in advance
    Srinivas......

    Hi Guru's thanks for your inouts and your valuble time...
    please find the program logic below...
    *& Report  ZAREPAS30
    REPORT  zarepas30.
    DATA : gs_vbeln                   TYPE  vbak-vbeln,
           gs_order_header_in         TYPE  bapisdhd1,
           gs_order_header_inx        TYPE  bapisdhd1x,
           gt_order_items_in          TYPE  STANDARD TABLE OF bapisditm,
           gwa_itab1                  TYPE  bapisditm,
           gt_order_items_inx         TYPE  STANDARD TABLE OF bapisditmx,
           gwa_itab2                  TYPE  bapisditmx,
           gt_order_partners          TYPE  STANDARD TABLE OF bapiparnr,
           gwa_itab3                  TYPE  bapiparnr,
           gt_return                  TYPE  STANDARD TABLE OF bapiret2,
           gwa_itab4                  TYPE  bapiret2.
    Sales document type
      PARAMETERS: p_auart TYPE auart OBLIGATORY.
    Sales organization
      PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    Distribution channel
      PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    Division.
      PARAMETERS: p_spart TYPE spart OBLIGATORY.
    Requested Delivery Date
      PARAMETERS: p_edatu  TYPE edatu OBLIGATORY.
    Sold-to
      PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    Ship-to
      PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    Material
      PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    Quantity.
      PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    Plant
      PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    Start-of-selection.
      START-OF-SELECTION.
    Header data
    Sales document type
      gs_order_header_in-doc_type = p_auart.
      gs_order_header_inx-doc_type = 'X'.
    Sales organization
      gs_order_header_in-sales_org = p_vkorg.
      gs_order_header_inx-sales_org = 'X'.
    Distribution channel
      gs_order_header_in-distr_chan  = p_vtweg.
      gs_order_header_inx-distr_chan = 'X'.
    Division
      gs_order_header_in-division = p_spart.
      gs_order_header_inx-division = 'X'.
    Reguested Delivery Date
      gs_order_header_in-req_date_h = p_edatu.
      gs_order_header_inx-req_date_h = 'X'.
      gs_order_header_inx-updateflag = 'I'.
    Partner data
    Sold to
      gwa_itab3-partn_role = 'AG'.
      gwa_itab3-partn_numb = p_sold.
      APPEND gwa_itab3 TO  gt_order_partners .
    ship to
      gwa_itab3-partn_role = 'WE'.
      gwa_itab3-partn_numb = p_ship.
      APPEND gwa_itab3 TO  gt_order_partners .
    ITEM DATA
      gwa_itab2-updateflag = 'I'.
    Line item number.
      gwa_itab1-itm_number = '000010'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    Line item number.
      gwa_itab1-itm_number = '000020'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
        order_header_in               = gs_order_header_in
        ORDER_HEADER_INX              = gs_order_header_inx
      IMPORTING
        SALESDOCUMENT                 = gs_vbeln
      tables
        RETURN                        = gt_return
        ORDER_ITEMS_IN                = gt_order_items_in
        ORDER_ITEMS_INX               = gt_order_items_inx
        order_partners                = gt_order_partners.
    Check the return table.
      LOOP AT gt_return into gwa_itab4 WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error occured while creating sales order '.
      ELSE.
    Commit the work.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        WRITE: / 'Document ', gs_vbeln, ' created'.
      ENDIF.

  • How to create the sales order using excell sheet thru BAPI's?

    Hi Guru's,
    In my excell sheet i had 11 sales order details ..now i wanted to create the sales order's sing BAPI's...?
    could please guide me step by step.....that would be greatly helpfull to me...
    Thanks in advance
    Srinivas....

    Hi,
    follow below steps.
    1. Get the excel data into internal table,  Build a internal table whcih fields are in bapi same order
    2. call the Bapi and pass the table data to the bapi
    3. after calling the  bapi,  call the commit bapi.
        then only it will careates.
    Regards
    Ganesh

  • Error while creating the sales order using Proxy

    Hi Folks,
    I am trying to create a Sales Order using Proxy via BAPI "BAPI_SALESORDER_CREATEFROMDAT2" :
    and i got this type of standard error message
    <Message>FB call: insufficient parameters</Message>
    few days back only i used the same bapi for creating the Sales Order and did it successfully...using the same parameters
    I don't have any clue about this type error .
    Kindly guide .
    Regards,

    Hi Nikhil,
    How refreshing the cache and restart the server will help ?
    basically i am testing the scenario at R/3 end only by generating XML template in SPROXY.
    My ECC 6.0 is on sp 12....I am not sure is it configuration related error or a bug ? as i have used the same code in ECC 6.0 with sp 09.
    regards,

  • Error in bappi creating the sales order

    Hi Xi team,
       i am creating a sales order via xi using the soap as sender adapter and rfc as receiving adpater. i am testing the scenatio using the altova xml spy. its writing the error as "Sales document type OR is not define".  But i could create the sale order by executing the bappi directly with the same set of records successfully. and the records are created. Please tell me wat might be the reason for the error.
    Thanks and Regards
    Karthikeyan

    Hello Karthik,
    What is BAPI you are using for creating Sales Order ?
    Try BAPI - 'BAPI_SALESORDER_CREATEFROMDAT2' to create a sales order .
    If you run into trouble using this BAPI with certain document types you can use the underlying RFC-enabled function module SD_SALESDOCUMENT_CREATE.
    Regards
    Gangaprasad

  • ERROR WHILE CREATING THE SALES ORDER

    Hi,
    When creating the sales order i am entering "mode of transport"in TSW details and while trying to save it im getting a message saying "Express document "update was terminated"" recieved from the author "Rahul". If i dont enter the TSW detail while creating i am able to save the order and later in change mode i can enter the mode of transport.
    When i check the inbox, it says "definately cannot transfer message to node SMTP due to connection error".
    This is hapenning for only one user.
    What could be the problem?
    Regards,
    Rahul.

    Hi Rahul,
    I think you need to enter the mode of transport in external details where it will take for further processing. TSW is different process.
    Thanks
    Pravin

  • Material Listing Error while creating the sales order

    Hi Guru's
    I have mantained a material in the lisitng for A002 combiantion for SO/DC/Pric. ref. material
    While creating the sales order is throwing an error as material is not listed so the transaction is not possible.
    I have done the basic invetingation on the folowing aspects
    1)checking the material in the listing
    2)Validity periods
    3)Material not blcoked
    4)Mateial is extened for the respective sales org
    Kindly help ASAP.
    Thanks & Regards
    Tarakaram

    Dear SAP SD 007
    I can confidently tell that an enhancement or an user exit has been applied in your scenario
    You have to check that
    Normally when creating a sales order with respect or referring billing documents the qty will be in editable mode and it is standard problem
    Your people has solved the standard problem by enhancement
    Usually OR--LF-PGI----F2 (SAY THE QTY IS 25 UNITS)
    Now you are creating returns order with reference to F2 in the return order type Re there is a standard issue that user can edit the qty to 30 from the original 25
    To solve this only your people have used userexit
    Line items and qty greyed out means definately there is some enhancement or user exit applied
    You have to check that
    Regards
    Raja

  • Error while creating the sales order with billing reference

    hi alll
    i am getting error while creating the sales order with billing reference.The line items are coming in grey.I am not able to change the items as well as the quantity field.Can u guide me
    cheers
    shalsa007........

    Dear SAP SD 007
    I can confidently tell that an enhancement or an user exit has been applied in your scenario
    You have to check that
    Normally when creating a sales order with respect or referring billing documents the qty will be in editable mode and it is standard problem
    Your people has solved the standard problem by enhancement
    Usually OR--LF-PGI----F2 (SAY THE QTY IS 25 UNITS)
    Now you are creating returns order with reference to F2 in the return order type Re there is a standard issue that user can edit the qty to 30 from the original 25
    To solve this only your people have used userexit
    Line items and qty greyed out means definately there is some enhancement or user exit applied
    You have to check that
    Regards
    Raja

  • How to delete a line item from the sales order

    Hi all,
    how to delete a line item from the sales order for which the production is already happened and it has been delivered. the production order status is DLV.
    Regards
    Kumar

    Hi
    U can do this in two ways one u can short close the order by entering Reason for rejection in VA02 at header level and if yr order is multiple line item order u can enter the reason for rejection in any of the line item which u don't want to deliver.
    This is called short close ( as the qty is not delivered fully).
    Thx.

  • Problem in when creating the sales order

    Hi to All,
    I am using the function module 'BAPI_SALESORDER_CREATEFROMDAT2' to create a sales order with quotation reference. When
    I executing the program the return table shows following issues
    1.Document 20000292 doesn't have document category but
    2.Sales document was not changed
    But , when i used to create the sales order manually( TC : VA01) with reference of '0020000292' it gives the sales order number.
    so,kindly suggest me.
    Thank you

    Hi,
       While using BAPI, you need to give some mandatory fields . So I think document catogary is missing in header structure.
    Thanks,
    Srikanth.A

  • Where can i see who deleted the sales order

    Where can i see who deleted the sales order?

    Hi Raja,
    Thnks for the reply.But I wanted to see Delivery Document which is not in the database as it has been deleted.
    As in this program , When I enter This Delivery Number , it says - No Changes carried out.
    Kindly provide me the program fo Delivery Document.
    Best Regards,
    Ankur

  • Error creating the sales order

    Hi,
    i am getting error saying ship to party 134 not defined for sales area when i am trying to create sales order
    help needed plzz
    thanks
    s

    Hi,
    Sales area consists of 1 sales organisation, 1 distribution channel and 1 division. If out of these 3 any one unit changes then, the sales area also changes. When you create a customer you specify the sales area for that customer. Customer has basically 4 basic partner functions-SP, SH, BP & PY.
    You are getting an error stating that the ship to party 134 not defined for sales area. First check whether your sold to party and ship to party are the same or not. If they are not same then, please check the sales area of the sold to party customer and the sales area of the ship to party customer. The sales area of both these customers should match with the sales area whcih you specify while creating the sales order.
    Also check the distribution channel of the material, the sold to party customer and the ship to party customer. The distribution channel should be the same.
    You have to assign the ship to party to the sold to party in XD02. Go to XD02, select your sold to party customer and select the sales area data. In sales area data go to 'partner functions' tab and assign the ship to party there. Enter the ship to party number.
    Reward points if solution helps.
    Regards,
    Allabaqsh G. Patil

  • To create the Sales Order based on PO IDOC.

    Hi Experts,
    The requirement is based on the generated PO IDoc, I have to create the Sales Order.
    Say Ex: Consider the Client 130. Here I have changed the PO 4500017195 by giving the Medium as EDI in the messages and saved the PO.
    As a result of that IDoc got generated at the port. Now using this IDoc I have to create the Sales Order in the same 130 client.
    Thanks in Advance.

    now read the same IDOC..configure it for inbound process code in WE20...or you can create  a report...call the created idoc using process code of SO...
    regards,
    madan

Maybe you are looking for

  • Can't open Skype in Surface Pro Tablet

    Skype works great on my desktop PC. But I have a problem with my Surface Pro Tablet. There is a Skype App and I can log on to my account. The Problem: There is a lot of stuff in the App that I don't care about, but I don't see where I can open the Sk

  • Lenovo 3000 H series computer boots up to a small blinking blue square on a black screen

    The computer powers on but after the Lenovo screen, the screen goes blank with a small blinking blue square on the left hand side and that's it? Anyone experienced this and know what could be the problem?  Message Edited by Bloome on 07-15-2009 12:39

  • Star with BOBJ

    Hi guys, my company just bought BOBJ license. Our bosses still don't know for what exactly it'll be used, nor when it'll be used. I'd like to start looking through this stuff since in our company nobody has experience with BOBJ and it's obvious that

  • Error in Workflow For Role Approval

    Hello , While i am approving the request i am getting the following error: Error processing your request, Request no: 2 in stage : ERM_STAGE What could be the cause for this error? Logs are pasted for your reference: 2009-08-19 14:31:40,244 [SAPEngin

  • Where did the 'sending mail' bar go?

    I remember at some point, when I sent a msg with an attachment, there used to be a bar which would fill on the bottom lefthand side of the window showing how much of the message had been sent. Once it would fill (indicating that 100% of the msg was s