Logic to fetch delivered and invoiced Qty using sales order and line no

Hi Experts,
I am creating a Sales Order report in which I need to Fetch the delivered Quantity and Invoiced Quantity fields.
I am currently going to VBFA table and pass SO and line item number and fetch all data. Then I perform addition/ subtraction to remove cancelled quantities. this is making the logic complicated.
Is there any standard Function module/ or table or BAPI which can fetch the Delivered and Invoiced quantities directly?
Regards,
Onkar B

Hi,
First pass the sales order number into "VBFA" table into the field "VBELV".
Execute or Press F8.
Get the document number of the delivery from "VBELN".
Pass the same delivery document numebr into "LIPS" table into the field "VBELN".
Execute.
Get the value of the delivery quantity from the field "LFIMG" in this table.
Next got the table "VBFA".
Pass the delivery document number into the field "VBELV".
Execute or Press F8.
Get the document number of the billing document from "VBELN".
Pass the same billing document numebr into "VBRP" table into the field "VBELN".
Execute.
Get the value of the invoiced quantity from the field "FKIMG" in this table.
Like this we have to get the delivery and invoice quantities.
Regards,
Krishna.

Similar Messages

  • Hide the cost and margin fields on Sales Orders and Invoices

    Hi all,
    I need to hide the cost and margin fields in Sales Orders and Invoices. We sell our products to our employees sometimes, hence we don't want them to know cost and margin information.
    Can this be done?
    Cheers

    Go to VOV7 & as per the Item category ,de - select the Check Box Determine Cost.
    Else remove the Condition Type VPRS & Margin Condition type from the Pricing Procedure
    Best Regards,
    Ankur

  • Opening and closing stock with sales order and with out sales order

    hello,
    any body please help me my client want to check opening stock and and closing stock in areport.
    material contains batch and some material with sales order and some are with out sales order. my client is asking this in a single layout. please tell me isthere any teport or bapi or function module to get this report.
    this is very uregent. and layout is requesting like opening stock, production stock, sales stock and closing stock.
    please guide me to get this report.
    Thanks & Regads
    Bhakta

    Transaction MB5B
    For sales order related use specila stock as E and use radio button indicator in stock type
    For stock w/o sales order, use special stock indiactor as "space' and stock type valuated stock.
    to get a perticular month,opening stock/closing stock enter the start date/end date as month start and end date.
    See the o/p which will give the stock as required by you

  • Cost Center and Profit Center in Sales Order and Deliveries.

    What are the different methods of determining cost centers and Profit centers in Sales orders ?
    Can Cost Center be determined independently in sales order or will be detrmined from Profit center ?

    Hi Sunil
    Profit Centres are used primarily in S&D (at billing stage it is transferred to FI) for registering revenue.
    Billing -
    Integration Points Module
    •Debit A/R - FI/ CO
    •Credit Revenue - FI/ CO
    •Updates G/ L - FI/ CO
    (Tax, discounts, surcharges, etc.)
    Return Delivery & Credit Memo -
    Integration Points Module
    •Increases Inventory - MM
    •Updates G/ L - FI
    •Credit Memo - FI
    •Adjustment to A/R - FI
    •Reduces Revenue - FI
    Profit Centers can be set-up to identify product lines, divisions, geographical regions, offices, production sites or by functions. Profit Centers are used for Internal Control purposes enabling management the ability to review areas of responsibility within their organization.
    The difference between a Cost Center and a Profit Center is that the Cost Center represents individual costs incurred during a given period and Profit Centers contain the balances of costs and revenues.
    Regards

  • Quantity and Price Totals on Sale Order and Delivery Order

    Dear ABAP Gurus,
    I want to add totals of line items (Quantity and Price) in sale order and delivery order screens. Can you please guide me how to do this. The price can be any from pricing procedure ie exclusive or inclusive price of sales tax.
    regards,
    RSA
    Moderator message : Requirements dumping not allowed, show the work you have already done, thread locked.
    Edited by: Vinod Kumar on Jan 28, 2012 9:23 PM

    Hi,
    Try this :
    IF @transaction_type in ('A','U') AND (@OBJECT_TYPE='22')
    BEGIN
    If exists (SELECT t3.docentry FROM OWOR T0  INNER JOIN WOR1 T1 ON T0.DocEntry = T1.DocEntry left join POR1 T2 on T2.[U_JONum] = T0.[OriginNum] and  T0.[ItemCode] =  t2.U_SubConItem] INNER JOIN OPOR T3 ON T2.DocEntry = T3.DocEntry WHERE T1.[PlannedQty] <> T2.[Quantity] and  T1.[ItemCode]  = 'subcon' and  T3.DocEntry = @list_of_cols_val_tab_del )
    Begin
    SET @error = 10
    SET @error_message = 'Not allowed to add more than planned'
    End
    End
    Thanks & Regards,
    Nagarajan

  • Wrong tax in delivery and invoice (different from sales order)

    Dear All experts/gurus,
    I am curretly facing a problem relate to big error in SBO 2004A SP00 PL 16. It is disgusting actually. the problem is I create Sales order (SO) with 0 % tax (tax code: 0tax). however after I create delivery from this SO,  the price including tax is different from price including tax in the sales order, it raised to be 20%, that is also happened in AR invoice meanwhile I never change the tax code and create 20% in the define tax group form.It is only happened in creation date on 16 february 2007,after that it is all okay, nothing happened. There is none allowed to change tax grup form.
    I am afraid there are bugs or something wrong that made it happened especially relate to technical/developper. I have check company settings, BP settings and other but find out nothing that made this wrong comes. pls help me to solve this situation. I appreciate your answers so much. tks
    Rgds,
    Message was edited by:
            steve andre

    Dear Eddy, Experts/Gurus,
    The problem has appeared again. It happened on 8 March 2007, all deliveries are subjected to have 20% tax meanwhile in column tax % of  define tax groups form is zero. The big problem is how to take back all the error AR invoices sent to customer sites.
    How to cancel the invoices with wrong tax without using credit memo? could I just use querry generator to delete all the taxes created by system ? I want to reprint it and send again to customers but I don't want to use credit memo, I consider to use DTW, but I am not so sure and I wanna ask what Gurus/Experts suggestions in this forum before do that. I appreciate your answer so much. TIA

  • Add DeliveyNotes and Invoice based on Sales Order

    i can manage to do it but..the Sales Order is not closed..why?
    when i try to do it manual, when it make Delivery..the respective Sales Order is Closed..
    below some of my code
    For Each FirstScanRow As DataRow In _oDataset.Tables(FIRSTSCAN_TABLE).Rows
                With oDeliveryNotes
                    Select Case iBasedDoc
                        Case 0
                            iBasedDoc = FirstScanRow("DocNum")
                        Case Is = CInt(FirstScanRow("DocNum"))
                            .Lines.Add()
                            isAddedHeader = False
                    End Select
                    ' make an Invoice and Sales Delivery Order
                    If isAddedHeader Then
                        .DocDate = Today.Date
                        .DocDueDate = Today.Date
                        .TaxDate = Today.Date
                        .CardCode = FirstScanRow("CardCode")
                    End If
                    .Lines.BaseLine = i
                    .Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
                    .Lines.BaseEntry = iBasedDoc
                    '.Lines.ItemCode = FirstScanRow("ItemCode")
                    '.Lines.Quantity = FirstScanRow("Quantity")
                    '.Lines.VatGroup = "ZO"
                    If FirstScanRow("IsUseBatch") Then
                        ' Add Batch
                        For x = 0 To FirstScanRow("Quantity") - 1
                            .Lines.BatchNumbers.BatchNumber = FirstScanRow("Scanned")
                            .Lines.BatchNumbers.Quantity = 1
                            .Lines.BatchNumbers.SetCurrentLine(x)
                            If x < FirstScanRow("Quantity") - 1 Then .Lines.BatchNumbers.Add()
                        Next
                    Else
                        ' Add Serial
                        For x = 0 To FirstScanRow("Quantity") - 1
                            .Lines.SerialNumbers.SystemSerialNumber = FirstScanRow("SysSerial")
                            .Lines.SerialNumbers.InternalSerialNumber = FirstScanRow("Scanned")
                            .Lines.SerialNumbers.SetCurrentLine(x)
                            If x < FirstScanRow("Quantity") - 1 Then .Lines.SerialNumbers.Add()
                        Next
                    End If
                End With
                i = i + 1
            Next
    any insight?
    thanks,
    erick
    Edited by: Erick Widya on May 13, 2008 10:52 AM

    Not sure if this will help or not, however some things I have in similar code that does appear to close the order are:
    1. Set the Reference1 field in the "header" to the order the delivery is based on
                            delivery.Reference1 = salesOrderDocumentId.ToString();
    2. I had to add all the additional expenses to the delivery too - you may not have any, so this may be mute.
    Robin

  • Shipped Weight and freight charges with Sales Order # and Invoice #

    Hi Gurus,
                  We have a report requirement where we have to provide Sales Order #, Invioice # , Material # and Shipped weight and Freight cahrges.
    Is there any way to combine all the info into one record. Please help.
    Warm Regards,
    Anil

    Hello Anil,
    Try to create a MultiProvider based on these data targets (Sales Cubes - Orders, Deliveries, Invoice).
    You can create a report on this multiprovider.
    Thanks
    Chandran

  • Update new material master weight and dimension in open sales orders and de

    Hi,
    Iu2019m maintaining gross weight, net weight, volume in material master. When the time of sales order entry in VA01 its calculating weight and dimensions based on material master and order quantity. And I create deliveries in VL01N.
    If I made a correction in the net and gross weight in material master after I created the sales order will the correct net and gross weight will pick up at the delivery creation.
    In other term is the VL01N net and gross weight is taking from which is available in SO or Material master.
    Is there any standard transaction to update already existing open sales order, delivery net and gross weight once it is corrected in material master?
    Please advice.
    Sam

    Is there any standard transaction to update
    No it is not possible to update the weight in existing sale order or delivery.  You have to change it manually or create a new sale order.   Weight in delivery will be fetched from sale order only and hence,  whatever delivery you create referencing a sale order, system will copy whatever is there.
    thanks
    G. Lakshmipathi

  • How to create an Invoice for the sales order using the T-Code VF01

    Hello Experts,
    How to create an Invoice for a sales order using the T-Code VF01?
    Thanks in advace,
    Suma

    hi,
    Make the following settings-
    1. Create sales document and billing type
    2. assign billing type in sales document type config VOV8
    3. Activate itemcategory as sales order related billing
    4. Maintain copy control header and item level between sales order and billing
    5. Maintain pricing procedure for sales order and billing
    6. Define Output procedure in case to print invoice
    Regards
    Goutham

  • How to know the excess stock with in a sales order and line item

    Hi,
          i am running an MRP against a sales order and sales order line item. the materials are getting planned based on the requirement. but due to some reasons the production orders are confirmed with out consumption of the actual required quantity of the  components. so the stock  is kept  ideal in the sales order  though it is not required further.
       do to some othere reasons also the excess stock of componenets exist. the PR or POs may also exist for the materials though they are not required further.
    i am in need of a report for the excess stock or excess PR or Purchase order for a sales order.
      please give me logic to find the excess things in that sales order and sales order line item. the Expensional message 26 is there in stock requirement list . but it does not give the excess quantity existing.
    regards
    madan

    hi rajesh,
      thanks for your reply. please tell me the logic to see when only partial quantity of sale sorder are delivered  and also when no delivery is made also.
    but manufactured and placed in stock.
    please tell me the tables to follow and logic of going ahead with them.
    regards
    madan

  • Availability check on storages in sales order and delivery documents

    Hi all,
    I'm verifying if it's possible to find a standard or a custom solution for this type of problem:
    I have a scenario in which there are more storages relevant for MRP (ex. 01, 02, 03, 04), and, in if I check availability in sales order or delivery (using checking rules "A" or "B") with setting which considering storages location inspection in availability check control, system check if there's stock available on all these storages.
    I'm trying to verify if it's possible to consider only some on these storages (ex. 01 and 03 only) in sales order and delivery documents availablity check.
    I know that in sales order storage location field is normally filled only using exit, but i don't know if it's possible to do, using a user exit, check availability considering only some storages and not all. At delivery level i have tried to use stock strategy, but this functionality don't have consequences on availability check, also if it's relevant during good issue phase.
    Any suggestion will be appreciated.
    Regards
    Gianpaolo

    Hi Gianpaolo,
    We had some issues with availability check on a Customer Site.
    I don't remember right now if we had to exclude storage locations from MRP to take them out from ATP, but I guess Shiva is 100% correct.
    At the end, what was done was to always "force" a unique storage location in the sales order item, which will be the storage location used for shipping of the delivery of course.
    If you use WM in your plant, then you will have no problem in having a unique storage location, so no problem.
    Anyway you are correct in your analysis, if the Storage location is not informed in the sales order item, then all the plant stock is taken in account for ATP.
    Best Regards,
    Franck
    Freelance Logistics SAP Consultant

  • Difference B/W Delivery plant  and item plant in Sales Order

    HI,
          May i know Difference between  Delivery plant and item plant in Sales order and what is the use of those fields.What is the process of raising sales order for different plants.
    Thnks&Rgds
    NAG
    Edited by: NAGA SUDHIR on Apr 3, 2009 6:10 AM

    HI G. Lakshmipathi,
                                   Thnks for the reply.Yes i am comparing (DWERK (at header level) and WERKS (at item level)) these two fields.
      Any how we can give only one plant in Customer Master, we are not maintaining Customer/mtrl regard (Not required in our company scenario) and we have extended MMR to different plants.
    So as per ur answer u went me to change only WERKS (at item level) while raising sales order for different plants.Is it enough?
    Thnks&Rgds
    NAG
    Edited by: NAGA SUDHIR on Apr 3, 2009 6:46 AM

  • Max.cond.base value - wrong line totals in Sales Order and Invoice

    Dear Experts,
        In my pricing procedure, I have set the field Max.cond.base value as 1 in VK12 (in additional data) for one of my condition type ZR16 . If Max.cond.base value is set as 1 for ZR16 condition type, the value for ZR16 will be considered only for the 1st quantity for that item. All subsequent quantities for that item will not be considered. This works fine in Sales Order and when I enter the same material in 2 line items with qty 1 each, only the first line item considers ZR16 value in total net value and the second line item does not consider the value of ZR16 in the total, which is correct.
        Problem arises when I create individual deliveries and individual invoices for each line item. Although the ZR16 value is not considered in the total for the second line item in the sales order the value is being considered in the invoice which is wrong. I tried various scenarios and found this issue arises only with domestic customer and not with overseas customer. Issue is that the line total value value calculated correctly in sales order is reflecting wrongly in Invoice when I use Max.cond.base value. I am confused if this is a pricing procedure related issue or copy control related. Please share your valuable inputs.
    Regards,
    Madhavan

    I tried various scenarios and found this issue arises only with domestic customer and not with overseas customer
    Compare the access sequence combination and condition record in both the above cases and check which one is differing and creating issue.
    the line total value value calculated correctly in sales order is reflecting wrongly in Invoice
    Again here also, compare the Analysis tab which should be self explanatory to find out the root cause of the issue.
    G. Lakshmipathi

  • Table For Open Sales Order And Customer Invoices

    Dear Gurus,
    Are there any table to know open Sales orders and pending invoices for Customers?
    Wishes,
    Abhishek

    Hi,
    Go to T code VA05 and select open sales order radio button. Put other input parameters like date range or sold to . Execute you shal get list of all open sales order.
    For pending invoices go to T code VL04 and you get list of all billing not yet created even though GI is done.
    These are standard SAP functionality and can be used rather than looking in a table level.
    Regards
    Vivek

Maybe you are looking for

  • Can I install Windows 7 Pro 64bit on my Machine?

    My MacPro 8 core with 6GB of RAM is running MAC OSX 10.5.8. How can I tell if I can run Windows 7 Pro via Boot camp? Is my Mac machine 32bit or 64bit? Thanks Chaz

  • Burn Folder

    A burn folder randomly appeared on my desktop. I'm not sure what it is used for. Should I delete it?

  • Primitive Variable Type Casting

    Dear all, as I was studying the SCJP Certification book, I notice the following: This case shows compilation error: byte a = 3; byte b = 8; byte c = a + b; This case shows no problem: byte c = 3 + 8; According to the book, 3 and 8 will be converted t

  • Selection Profile Additional Fields required

    I have an SNP planning book to view my resource capacities in, the selection profile is at "APO Resource" level. In the selected objects view it shows the resource and location codes only and no descriptions are available. I believe that this is work

  • User exit/BAdI to manipulate display (MRP) Exception messages

    Dear, I wonder if there is a user exit/BAdI or implicit enhancement with which I can manipulate the display (or not) of (MRP) Exception messages in MD04/MD07. In customizing of the Exception messages (table V458A) there is the indicator No exception