Get Sales Order price from delivery

Hi Folks, I need your help.
I have a smart form to print a ticket that shows the total amount to be paid. Iu2019m using the FM GN_INVOICE_CREATE to simulate the prices and sum the items (Table xvbrp), passing the material and quantity.
The problem here is when some conditions of discounts are included manually as price conditions in the sales order this function has no considerer those and I get the wrong amount or the amount without those conditions.
After this issue a decided to change the FM to RV_INVOICE_CREATE (Table xvbrp), which is the FM used by the transaction VF01, this function works perfect but a Post good issue is required to obtain the prices.
I need a FM to get these prices from the delivery, taking in consideration sales order conditions automatic and manual for the delivery item and delivery quantity. The purpose of this is to print a ticket with the amount to be paid by the customer, before the invoice is created.
Thank in advance.
Alexis Ramirez

I solved the issue using the FM RV_INVOICE_CREATE.
CALL FUNCTION 'RV_INVOICE_CREATE'
  EXPORTING
    invoice_type   = rv60a-fkart
    invoice_date   = sy-datum
    pricing_date   = rv60a-prsdt
    delivery_date  = rv60a-fbuda
    select_date    = rv60a-seldat
    i_analyze_mode = 'X'
    vbsk_i         = vbsk
    id_no_enqueue  = 'X'
  IMPORTING
    vbsk_e         = vbsk
    od_bad_data    = lv_bad_data
    det_rebate     = rebate_determined
  TABLES
    xkomfk         = w_xkomfk
    xthead         = w_xthead
    xvbfs          = w_xvbfs
    xvbss          = w_xvbss
    xvbrk          = w_xvbrk
    xvbrp          = w_xvbrp
    xvbpa          = w_xvbpa
    xkomv          = w_xkomv.
I get the price from the table xvbrp.
Thanks,
Alexis

Similar Messages

  • 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 get master sales order number from delivery number

    Hi All,
    I need logic for getting master sales order number from available Delivery number.
    Note: There can be many SO's in diffrent levels.
    Finally i need to pick up master sales order no.
    Thanks in advance.
    Thanks,
    Deep.

    Hi,
    I have a outbound delivery[VL03N] 'X' in my system .
    Then for getting sales order no i am writing below code:
      SELECT single vbelv vbeln
             from vbfa
             INTO (vbelv, vbeln)
             where vbeln   EQ p_vbeln AND
                   vbtyp_n EQ 'J'.
    Then vbelv i need to pick up master sales order no.
        SELECT vbelv vbeln
               from vbfa
               INTO TABLE i_so
               where vbeln   EQ l_vbelv AND
                     vbtyp_n EQ 'C'.
    If i write code as above it is giving four sales orders which one of them is master sales order no!
    Thanks,
    Deep.

  • How to trace sales order number from delivery number, when batch is split

    Hi All,
    I have created a Sales Order and a Outbound Delivery against the sales order.
    While creating the Outbound delivery, I have split the qty in two batches.
    Now when I go in table LIPS, and search on the basis of the Delivery number, I get two rows, one for each batch. But here the sales order LIPS-VGBEL, and Sales order item no (LIPS-VGPOS) is updated only for the 1st batch line item, but is not updated for the second batch line item.
    Please help me so that on the basis of the delivery number, i will be able to find record from tables for sales order for both the line items (i.e. for each batch).
    Immediate help would be appreciated.
    Thanks in Advance.
    Ankush

    Hi,
    I have created delivery against sales order.
    While picking (during delivery PGI), I selected two batches to suffice the delivery qty. Please refer the example quoted below.
    Sales order (SO1) - Material (Mat1) - qty (15 ea)
    Delivery against sales order (Del1) - batch split: batch1 - 10 ea
                                                                         batch2 - 5 ea
    In table LIPS: when I enter delivery number as "Del1" and execute, I get 2 records:
       del no.     Item No.      Material   Qty       Batch no       Sales Order no     Sales Order Item no
    1. DEL1       10              Mat1        10 ea    batch1          SO1                    10
    2. DEL1       20              Mat1         5 ea     batch2         ______                 ____
    Thus in the 2nd record, the Sales order no.(LIPS-VGBEL) and sales order item no. (LIPS-VGPOS) does not get updated.
    I have to develop a report to display the Sales Order number and sales order line item number for each batch of the Delivery for the same item number. Please guide me to know how I can get the same.
    Hope this clarifies the issue faced.
    Regards,
    Ankush

  • How to get purchase order number from delivery number?

    hi all,
    how to get purchase order number and item if i have only delivery.
    and in same way how to get po number and item if i know only batch number.
    kindly give me some solution i need this urgently.
    thanks in advance.

    Check the logic below:
    * Selecting the Sales Documents from VBFA for corresponding Invoice
        SELECT vbelv
                     posnv
          FROM vbfa
          INTO TABLE gt_itab3
         WHERE vbeln EQ gt_itab5-vbeln
           AND posnn EQ gt_itab5-posnr
           AND vbtyp_n EQ 'J'.
        IF sy-subrc EQ zero.
          SORT gt_itab3 BY vbelv posnv.
        ENDIF.
      ENDIF.
      IF NOT gt_itab3 IS INITIAL.
    * Selecting the Purchase Orders from VBFA for corresponding Sales Documents
        SELECT vbeln
               posnn
          FROM vbfa
          INTO TABLE gt_itab4
       FOR ALL ENTRIES IN gt_itab3
         WHERE vbelv EQ gt_itab3-vbelv
           AND posnv EQ gt_itab3-posnv
           AND vbtyp_n EQ 'V'.
        IF sy-subrc EQ 0.
          SORT gt_itab4 BY vbeln posnn.
        ENDIF.
      ENDIF.
    Batch number will be there in delivery item.
    Regards
    Kannaiah

  • Function module to get order data from delivery

    hi ,
    is there any function module to which i can pass the delivery number and get the order number (s) and other data .
    basically i want the order currency.
    pls help.
    <removed by moderator>
    Edited by: Mike Pokraka on Aug 21, 2008 9:44 AM

    Hi Surendra,
    If your requirement is just to retreive the Order number for a given delivery then you can go with following:
    Just go to LIPS table, there you can get the Order Number and ITEM from VGBEL and VGPOS fields for given Delivery Number VBELN.
    You can also do the same by using VBFA table.
    Also have a look to the following thread:
    Re: Getting sales order number against Delivery Number
    Hope this will help.
    Regards,
    Nitin.

  • Fetch Sales order & item from Prod ord to TR Header text when staging mat

    Hello
    We have a need to see Sales order and item number in TR header text when selecting TR to be processed in transaction LB10.
    TR´s are created via transaction LP10. Is there any solution to get Sales order number from Production order to be automatically pasted to TR header text field when generating TR?
    SO & item is always available in Production order General data.
    Thanks for answers!
    -A
    Edited by: A_R_FIN on Feb 5, 2010 8:34 AM

    Hi,
    I hope the below link will help you.
    Help needed with BAPI_SALESORDER_CREATEFROMDAT1 parameters
    Thanks,
    Khushboo.

  • 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 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.

  • 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

  • Implications of changing credit check from sales order level to delivery

    Currently the credit check is availbale at the sales order level in the system and if I want to change the credit management settings so that credit check will be available at the delivery level.
    What are the implications of changing credit check from sales order level to delivery

    >
    Mangesh Desai wrote:
    > Currently the credit check is availbale at the sales order level in the system and if I want to change the credit management settings so that credit check will be available at the delivery level.
    >
    >
    > What are the implications of changing credit check from sales order level to delivery
    Hi,
    No Implications simple credit check will not happen order level it will happen delivery level .
    *system will not conceded at order level open order will not be calculated
    Best Regards,
    venkataswamy.

  • Applying Price list for sales order created from Internal Requisition

    I am using 12.0.5. I have created a price list and applicable discount. I am creating Internal Requisitions and Importing them into Order Management as Sales Order using "Create Internal Order" and "Import Request". But when the sales orders are created, the pricing flag is "Freeze Price" and to apply the price list, I have to change the pricing flag of each line and re-price order/ line. Is this a way around this such that Sales orders created from Internal Requisitions pick up the correct discounted selling pricing automatically after import?

    Hi Ravichandran,
    When the Internal Sales Orders are created via Order Import program, the pricing flag will be "Freeze Price" because the value of CALCULATE_PRICE_FLAG will be set to 'N' in the OE interface line table by the Create Internal Orders program. This is the standard functionality of the Oracle.
    However, if your requirement is to re-price the line (automatic application of discounts at the time of booking) after the SO is created then to avoid the manual repricing steps, you can write a custom program to update the CALCULATE_PRICE_FLAG to 'Y' for the OE Line records present in the interface tables itself. You need to make sure that this update happens before the Order Import program. You can create a Request Set to acheive this, for example...
    XXX Create Internal Orders (Custom Request Set)
    - Create Internal Order (Standard Oracle Program)
    - XXX Update PriceFlag for ISO (Custom Program to update the price flag)
    First run the above request set & then run standard Order Import program. So when SO is being booked, CALCULATE_PRICE_FLAG will be 'Y' i.e., Calculate Price, the required discounts will be pulled & the line will be re-priced automatically.
    I hope this is what you wanted to achieve. Let me know if you have any questions.
    Regards,
    Hemanth

  • What's the name of FM for getting Sales Order Header / Item Status info

    Hello All:
    Do you know what's the name of Function Module for getting Sales Order Header / Item Status Overview ? Any sample code will be very much appreciated.
    Basically, I am trying to create a Webpage where user can enter the Sales Order document number and will return the Sales Order: Status Overview.
    Thanks,
    Dipankar Biswas

    Thanks everybody ! Appreciate for your prompt response. I was also looking for some sample code, and I did find some on. And here is one. I still have to try the code, but here is for all your reference:
    *& Report ZBAPI_SALESORDER_GETSTATUS *
    *& Read and Display the Sales Order Items and Status of the Order *
    REPORT zbapi_salesorder_getstatus NO STANDARD PAGE HEADING LINE-SIZE 200 LINE-COUNT 33(3).
    TABLES: vbap. "Sales Document Item Data.
    DATA: wa_bapireturn TYPE bapireturn,
    wa_bapisdstat TYPE bapisdstat,
    it_bapisdstat LIKE STANDARD TABLE OF wa_bapisdstat.
    TYPES: BEGIN OF ty_mat_name,
    matnr TYPE makt-matnr,
    maktx TYPE makt-maktx,
    END OF ty_mat_name.
    DATA: wa_mat_name TYPE ty_mat_name,
    it_mat_name LIKE TABLE OF wa_mat_name WITH KEY matnr .
    PARAMETERS: p_vbeln LIKE vbap-vbeln DEFAULT 5573.
    START-OF-SELECTION.
    SELECT matnr maktx FROM makt INTO TABLE it_mat_name.
    CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'
    EXPORTING
    salesdocument = p_vbeln
    IMPORTING
    return = wa_bapireturn
    TABLES
    statusinfo = it_bapisdstat.
    IF wa_bapireturn IS INITIAL. " Successful Execution.
    WRITE: / 'Document No: ' COLOR 1, 20 'PO Number : ', 40 'Status' , 50 'Delv.Stat',60 'Item No', 80 'Material', 90 'Material Description', 130 'Net Price' COLOR 2.
    ULINE.
    LOOP AT it_bapisdstat INTO wa_bapisdstat.
    WRITE: / wa_bapisdstat-doc_number. " Sales Document Number.
    READ TABLE it_mat_name INTO wa_mat_name WITH KEY matnr = wa_bapisdstat-material.
    WRITE: /20 wa_bapisdstat-purch_no, " Customer Purchase Order Number
    40 wa_bapisdstat-prc_stat_h, " Processing Status
    50 wa_bapisdstat-dlv_stat_h, " Delivery Status
    60 wa_bapisdstat-itm_number, " Item Number
    80 wa_bapisdstat-material, " Material
    90 wa_mat_name-maktx, " Material Description
    130(10) wa_bapisdstat-net_price. " Net Price
    CLEAR wa_bapisdstat.
    ENDLOOP.
    REFRESH it_bapisdstat[].
    ELSE.
    WRITE: wa_bapireturn-message.
    ENDIF.

  • 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

  • SD consolidating multiple sales orders onto a delivery

    Dear SD gurus,  I have a situation where I am trying to consolidaqte multiple sales orders onto a delivery.  I have read the documentation and have created sales orders with the same: ship to party, incoterms ect.  I have also selected the 'combine orders' check box in the customer master record.  I am generating the deliveries using VL10A - but I am still getting one delivery for each order.  Is there anything else I need to do?

    Hi Jacqueline,
    Basically, all fields which are copied to the header of the delivery (tableLIKP) via the routines of the copy control lead to a delivery split. Furthermore, some fields are copied to the header by all means and are relevant for the split there.
    Split fields that cannot be changed are:
    VSTEL Shipping point
    KUNNR Goods recipient
    ROUTE Route
    The following split-relevant fields can be affected via the copy control,however, they should not be filled differently from the defaults since they are necessary for the control of the shipping process:
    VKORG Sales organization
    AUTLF Full delivery indicator
    VSBED Shipping condition
    FKARV Billing type (customer billing document)
    LIFSK Delivery block
    STAFO Update group for statistics
    STWAE Statistics currency
    KKBER Credit control area
    KNKLI Account number of the customer with the credit limit default
    GRUPP Customer credit group
    SBGRP Processor group for credit management
    CTLPC Credit management: Risk category
    CMWAE Currency key of the credit control area
    WAERK Currency of the sales document
    INCO1 Incoterms 1
    INCO2 Incoterms 2
    KZAZU Indicator order combination
    KDGRP Customer group
    PERFK Invoicing dates (calendar identification)
    Hope this helps
    thanks

Maybe you are looking for

  • How to display CPU and memory utilization from ST06 in a report

    Hi, I want to display CPU Utilization and Memory utilization and File sys details from ST06 transaction in a report. Is there any function module or any other method to do that. Please advice. Thanks, Sandeep.

  • SAP CRM 7.0 Java AS

    Dears, i have install SAP CRM for Apab and CRM for Java... My Problem when we try to login using SAP GUI on crm java the error message appeare as following : <servername>:SAPdp05 Not reached Connection Error 161 connection refused;; The service is ru

  • 2013 AE.ac loud fan noise normal?

    My new 2013 802.11ac Airport Extreme base station is constantly making a lot of noise due to the fan running, this is with an ambient temperature of 26C. The old 2012 802.11n has been happily working all summer with temperatures as high as 30C, never

  • 'Gift this app' - no show

    Purchased an app under 'Gift this app'. Receipt rec'd but recipient never received the app. Any troubleshooting direction?

  • How can I rotate a clip?

    I imported a .MOV clip and it is sideways - is there a way I can rotate it???? Thanks!