How to right a logic to get sales order from agnetry in salesordercreateBAPI

I am working on a Agentry project where I need to get the Sales Order number from backend SAP, for any newly created SalesOrder. When the User creates a new Sales order, he gets a local order id on the client device. When the user transmits data, the Original Sales Order number should be fetched from the backend.
Kindly help me to create the JAVA coding for this task.
Regards,
Sumit Goyal
Tags edited by: Michael Appleby

Hello Surya,
There is no such direct way to get the data but you can follow the below process.
You can get this details by defining/designing a new Query.
To develop a new query
1. use SQ01 through infoset create query
2. Use SQVI direct query by giving table.
Purchase Requision :-
Use Table EBKN  for the same and give field VBELN as selection field. Input your sales order it will give you the purchase requisitions exist against the sales order at output level.
Purchase Order :-
Use Table EKKN  for the same and give field VBELN as selection field. Input your sales order it will give you the purchase orders exist against the sales order at output level.
Hope it will help.
Regards
AG.

Similar Messages

  • Get Sales Orders from R/3 to CRM

    Hi,
    I want to get a list of the latest 3 sales orders which were placed for a Business partner.
    The Sales orders are being created in R/3 and i want to be able to get this data into the CRM system.
    The CRM middleware is not configured to sync R/3 to CRM.
    How can i do this?
    Regards
    Shivani

    Hi Shivani,
    I am not sure whether I understood your question or not. But if you want to use standard MW to exchange the data then you need to do the following.
    I am assuming your R/3 and CRM are connected to each other ( check the same using tr. SM50 and test the connection from one system to other system)
    1> check the queues R3A* & CSA* are registered in transaction SMQR
    2> check the tr. SMQS for your destination system.
    3> check for the site R/3 - OLTP and check for the subscription ALL BUSINESS TRANSACTION (MESG) Subscripition. - > this is for data transfer from CRM to R/3.
    4> define the no. range for transactions and transaction types etc.
    then you can load the object SALESDOCUMENT using the transaction R3AS - put some filter for this adaptor object so that it will bring only those transaction which you want to.
    Reffer to the Best practice guide for further details. you can get this in site help.sap.com.
    Hope this will help.
    Thanks,
    Vikash.

  • Get Sales order from Billing document number

    Given Billing document number from VBRK-VBELN, how to get the Sales order number VBAK-VBELN?

    Please check table VBFA.
    Below code might give you some idea:
    PARAMETERS: P_VBELN TYPE VBELN OBLIGATORY.
    DATA: COMWA TYPE VBCO6.
    DATA: IT_VBFA TYPE TABLE OF VBFA,
          WA_VBFA TYPE VBFA.
    COMWA-VBELN = P_VBELN.
    CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
      EXPORTING
       BELEGTYP            = 'M'
       COMWA               = COMWA
      TABLES
        VBFA_TAB            = IT_VBFA
    EXCEPTIONS
       NO_VBFA             = 1
       NO_VBUK_FOUND       = 2
       OTHERS              = 3.
    LOOP AT IT_VBFA INTO WA_VBFA WHERE VBTYP_N = 'C'.
       WRITE:/ WA_VBFA-VBELN.
    ENDLOOP.
    Kind Regards
    Eswar

  • Get sales order from invoice

    hello all.
    i have two importent questions and i hope you can help me.
    1. is there any way to get the sales order that the invoice is based on, in the xml and not as remark ? (can be as data and i will add it to the xml).
    2. in sbo there is a option to print any document when it is added to the data base. i want to override this and disable this option using sdk for a specific form or client, how do i do that  please?
    thank you in advance.
    Alon

    Hello Alon,
    Answers:
    2. in sbo there is a option to print any document when it is added to the data base. i want to override this and disable this option using sdk for a specific form or client, how do i do that please?
    You can just turn this option off on specific documents (AdministrationSystem InitializationPrint Settings By Document tab).
    1. is there any way to get the sales order that the invoice is based on, in the xml and not as remark ? (can be as data and i will add it to the xml).
    Sure, you have to create a small addon, which locates the basis document of the invoice (eg delivery or sales order). If you have multiple sales orders as a basis document of the invoice, you has to save them by individually.
    You can find here a query which uses a special feature of SQL to track the sales document flow
    /people/janos.nagy/blog/2010/01/07/reqursive-queries-in-production-sales-analysis
    Regards
    János

  • How to get  sales order data in R/3. Any FM?

    Hi ,
    Is there any FM in R/3 to get sales order data.
    In CRM we use CRM_ORDER_READ to get the Header and Item details. Like wise FM in R/3 is required.
    Actually I have to test 'Usage' in sales tab of VA01/VA02/VA03.
    How to get the order details? what is the user exit for ORDER save?
    If any body knows please do let me know.
    Thanks and Regards
    Harish

    Hello Harish,
    Please use BAPI_BUSPROCESSND_GETDETAILMUL to read details of sales order. This works as a remote enabled counterpart of CRM_ORDER_READ.
    Similarly if you want to display sales order from R/3, use FM BAPI_BUSPROCESSND_DISPLAY.
    Regards
    Kaushal

  • How to get sales order number before saving in VA01 by using parameter

    Hi,
    Please let me know how to get sales order number in transaction VA01 before saving it by using parameter in SU3.
    I tried to set parameter in SU3 "AUN", but it is not working as required, means sales order number is not appearing before saving.
    can you please suggest how to do it?
    Thanks & Regards.
    Rahul Verulkar

    Hi,
    In case of Support project, we get the high severity issues from users and needs to be closed withn 2 hours... so what we do we get the requirement from user and checking the same in production from our id, but we can not save the sales order as we are not authorized to do the same, so in such cases it is required to get the sales order number before saving... where we can guide the users.... but actuallly it is not getting saved in the table until and unless u save it manually. It works like a material master... when u create material master, the material number appears in advance in material number field "MATNR"
    If it is possible can you please suggest step by step to work on parameter in SU3 for sales order number before saving.
    Thanks & regards,
    Rahul Verulkar

  • How to get sales order data in substitution of fi-docu from GM posting ?

    How to get sales order data in substitution of FI documents from goods movement posting?
    When I posting a material document with movement type "501E", the system will creating a FI document automatically. And I need to get the sales order data in the substitution of FI document.
    I tried to export the data of the material document in user-exit "MB_CF001 Updating of material document data upon posting", but this user-exit does not triggered in the posting process at all. what's the problem?
    Do you have better solution or idea for this? Please help me. Thank you!

    Hello Harish,
    Please use BAPI_BUSPROCESSND_GETDETAILMUL to read details of sales order. This works as a remote enabled counterpart of CRM_ORDER_READ.
    Similarly if you want to display sales order from R/3, use FM BAPI_BUSPROCESSND_DISPLAY.
    Regards
    Kaushal

  • How to get sales order data with GL tables

    I want to get sales order details from my GL query. I need to get item number, quantity and customer PO from there. Here is my query from GL.
    SELECT PH.po_header_id,
      I.GL_DATE,
      R.je_header_id JE_HEADER_ID,
      R.je_line_num JE_LINE_NUM,
      aeh.org_id ORG_ID ,
      I.invoice_num TRX_NUMBER_C ,
      ael.description COMMENTS ,
      ael.ACCOUNTED_CR ACCOUNTED_CR,
      ael.ACCOUNTED_DR ACCOUNTED_DR,
      ael.code_combination_id CODE_COMBINATION_ID,
      ael.currency_code CURRENCY_CODE,
      ael.entered_cr ENTERED_CR,
      ael.entered_dr ENTERED_DR,
      PH.segment1 PO_ORDER_NUMBER,
      GL.segment1 company,
      GL.segment2,
      GL.segment3,
      GL.segment4,
      GL.segment5 account
      ,ael.description
      ,PD.quantity_ordered, PD.amount_billed, D.quantity_invoiced,  D.unit_price
    FROM gl_import_references R, --ok
      gl_je_categories jc,
      ap_ae_lines_all AEL, --ok
      ap_ae_headers_all AEH, --ok
      ap_invoice_distributions_all D,
      ap_invoices_all I,
      ap_accounting_events_all AE,
      po_releases_all PR,
      po_headers_all PH,
      po_distributions_all PD,
      po_vendor_sites_all VS,
      gl_code_combinations GL
    WHERE 1=1
    AND jc.je_category_name       = aeh.ae_category
    AND PR.po_release_id(+)       = PD.po_release_id
    AND PH.po_header_id(+)        = PD.po_header_id
    AND PD.po_distribution_id(+)  = D.po_distribution_id
    AND ael.third_party_sub_id    = VS.vendor_site_id
    AND AE.accounting_event_id    = AEH.accounting_event_id
    AND I.invoice_id              = AE.source_id
    AND AE.source_table           = 'AP_INVOICES'
    AND AEH.ae_header_id          = AEL.ae_header_id
    AND DECODE(ael.source_table,'AP_INVOICE_DISTRIBUTIONS', AEL.source_id,NULL) = D.invoice_distribution_id(+)
    AND AEL.gl_sl_link_id         = R.gl_sl_link_id
    and ael.code_combination_id = GL.code_combination_id

    Then your query is completely wrong.
    Your query is looking at Purchase Order tables.
    If you want sales order data, you should be looking at OE tables (such as OE_ORDER_HEADERS_ALL, OE_ORDER_LINES_ALL etc.)
    Sandeep Gandhi

  • How to get sales order information in COPA datasource

    Hi All,
    I wish to get sales order information like Customer, Sales office, Sales group etc in COPA datasource. Presently all this information is not available and the fields display blank value. Can you please guide me through the steps to achieve this.
    Thanks in advance,
    Sananda

    Hi
    They actually create Generic extraction for COPA modules..especially all finance modules. Hope you are aware of  it and do you know the steps for COPA?
    Any check all the below links as well lot many threads for COPA available. pls chek that as well
    http://sap.seo-gym.com/copa.pdf
    http://searchsap.techtarget.com/answer/Steps-for-a-generic-extraction-of-FI-CO-COPA-and-LO-in-SAP-BW
    Problem with COPA extractor 1_CO_PA<...>
    Delta Mechanism : COPA extractor
    steps for FI-SL and CO-PA Extraction
    COPA extraction steps for BI 7.0
    This link would be help ful:
    http://www.sap-img.com/business/copa-extraction-steps.htm

  • Which table I can get sales order no from delivery numbar.

    Hi,
    I want sales order no from delivery no. right now I am using table VBFA where I am passing VBELN and POSNN and geting sales order no. but performance of select query is very poor bcouse I am not passing first two key fields in the select query.
    Is there any other tablefrom where we can get sales order no. from delivery no. so that performance of report can be improved.
    Thanks,

    hi,
    sales doc header ( table VBAK ) copy to Delivery header table( LIKP)
    sales doc item table ( VBAP) copy to Delivery item table( LIPS)
    you can see this in copy control VTLA ,
    now u want slaes doc no. from dilv doc. no.
    so go to t-code se11.....
    fill table LIKP u will get VBELN field for deliv doc no, & TERNR field for sales doc. no.
    so if u want to call sales doc no from dilv doc no.. u can use table LIKP in ur report.
    i hope it will help u.

  • How to restrict header text changes in sales order level

    Dear Experts,
    how to restrict header text changes in sales order level change mode
    thanks

    Hello Chandu,
    how to restrict header text changes in sales order level change mode
    In order to restrict changes to Sales Order Header Text, the appropriate User Exit would be USEREXIT_MOVE_FIELD_TO_TVCOM_H. With the help of ABAPer, you can include the simple logic on the basis of Header Text type such that whenever any changes are incurred on the Sales Order header text, updates would be prevented.
    Please try out this approach and let us know your latest observation on this issue.
    Regards,
    Sarthak

  • How to pack the More than one sales order delivery qty in one packing

    Hi Folks,
    How to pack the more than one sales order quantity combinely during packing?
    Thansk in advance and points wil be rewarded for the reply.
    Best Regards
    Srinivas

    Packing is done during Delivery.
    In Sales order also Packing function is available but as a Packing proposal.
    So actual packing is done in Delivery.
    When you process several sales orders together, the sales order items having same Ship-to-party, Shipping point, Route, Delivery due date & Incoterm are combined into one Delivery in the standard system.
    In the delivery overview screen,do the picking by subsequent function rom the menu bar, you will get a button "PACK", click on this system will take you to the packing screen.
    In the packing screen, give the packaging mterial number, select the materials to be packed, select the packaging material also and the click on the "PACK" button.

  • How settlement rule will be created for Sales order with cost object

    Dear Experts,
    We are using product cost by sales order with valuated stock. In addition we are not using COPA
    We also consume some materials at sales order level and at the end of month we want to do the result analysis and settlement for the same amount. In this case can any on explain how system will behave regarding settlement of sales order cost and what entries will get pass in the system.
    In our case we have done below activities...
    we have created sales order,
    All production order activities completed till final GRN including month end activities
    Material consumption against sales order
    Result analysis executed
    At the time of sales order settlement, system throwing error (Sender doesn't have valid receiver, please create settlement rule for sender object)
    Then i checked in sales order there sales order settlement rule not defined.
    I guess this settlement rule need be generated by system automatically. If not, please let me know the process of it.

    HI kishore
          the reason is that sale order always carry the revenue  and production order and production period carry the cost .
       cost you can settle to the Material and even management want  to be settle the cost to material only in production order OR period
    but in sales order  when u sell the product it carry the revenue not the cost and management want see and analysis based on profitability segment are profit center level .
    Prerequisites
    If CO-PA is active, the system generates a settlement rule when you create the sales order. The settlement rule determines whether data is settled to other objects or other areas in Controlling. In accordance with this settlement rule, the relevant data is settled to CO-PA.
    If CO-PA is not active, create a settlement rule. This settlement rule that you create manually normally contains a G/L account as a receiver (such as 399999). You can also settle costs and revenues or results analysis data to objects with revenue.
    You can also settle the cost of sales calculated in results analysis to a fixed asset or a cost center. To do this, you must add to the allocation structure the results analysis cost elements under which the cost of sales is updated to the order.
    The settlement rule includes a distribution rule for the sales order item. The distribution rule is made up of a settlement receiver, a settlement share, and a settlement type:
    The settlement receiver (such as profitability segment or G/L account) specifies the object to which the actual costs and revenue of the sales order item are settled. The settlement receiver can be proposed through the settlement profile.
    The settlement share defines the percentage or the equivalence numbers used to distribute the costs to the individual settlement receivers. The settlement share for sales order items is usually 100%. A settlement share of 100% is preset in the system.
    The settlement type specifies full settlement of the sales order item. This ensures that all the data on the sales order is available for results analysis.
    Settlement still takes place in each period. The revenues and the cost of sales are transferred to CO-PA by period, and the work in process and the reserves are transferred to FI.

  • How to make the status of a sales order complete of which PART DELIVERY

    How to make the status of a sales order complete of which PARTIAL DELIVERY has already done. <b>(Assigning rejection status not accepted)</b>

    Hi Gyana
    There is no document with me. But I can confidently say that because I am using this functionality.
    In my case I have created a Order Reason as "Short Closed". once you short close this order only the balance quantity gets rejected (provided you have already made previous delivery and PGI).
    Try it in one of your test clients if you have. Once it is short Closed it wont also show in the orders due for processing in Production.
    Also you can generate reports based on this if your customer wants to know how many order he has short closed, qty of item short closed etc.
    Try it.
    Rgds
    Sunil

  • How do know multiple  deliveries of a sales order

    could anyone tel me   how do know multiple deliveries of a sales order.
    Any  Table  or Tcode.

    Hi ,
    you can get details in the likp or lips table  ,
    vbfa can give you the detail of preceding document  .
    Regards
    Digvijay Rai

Maybe you are looking for

  • Status 56 -  IDOC with errors added

    Hi everyone,         I was configuring File to IDOC Scenario, in the receiving R/3 system, i am getting error as Status 56 -  IDOC with errors added "<b>EDI: Partner Profile not available</b>".         but i had already created Partner profile in WE2

  • SRM 7.0 PO not replicated to Backend ECC 6.0 Ehp 4

    Hi SRM Gurus, SRM 7.0  SP 8 - ECC 6.04 SAPKH60406 ECS RFx Response to PO - SRM Local PO is created and is in held status.  Purchaser gives the source of supply and Acc Assignment and order it. PO now is in Ordered status. Issue: this PO is not replic

  • Change default template for a given Theme

    Can we change the default template for a theme ? (if yes, how). I had selected theme 3 (business) during the creation of my application with 2 level tabs. After creating parent tabs and standard tabs and getting it working I changed the theme to them

  • RAW-support in future?

    Hi, does Apple give information, which cameras will be supported in future? Or does Apple somewhere has a feature request for this? As a Panasonic / Leica fan I would really appreciate RAW-support for e.g. LX2 / D-Lux 3, or L1 / Digilux 3. Thanks, Fr

  • Using ECC as BI

    Hello all, We Have 2 SAP ERP Servers ECC5 and ECC6 Can i use ECC 6 as BI server to Extract Data from ECC 5? If so What are steps i need to do First. waiting for suggestions. With Regards Sandy