Query for calculating raw material requirements for the remaining quantities in sale order.

Dear SAP Experts,
Clients requirement :
                                     Client wish to know the quantities of raw materials needs to run the production order inorder to complete the remaining quantities in sale order.
Need Clarification:
                              I"m using the below query for this requirement. I wish to know whether this query suits for my clients requirement or not. If its so, I need to know how to group by T4.[Code] (Raw material Name)   and need to get the sum of    T4.[Quantity]  (BOM quantity)      and  (T1.[OpenQty]*T4.[Quantity]) as TOTALQTY under each raw material group
SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode],T0.[CardName], T1.[ItemCode], T1.[Dscription], T1.[Quantity] as salesorderQty , T1.[OpenQty], T2.onhand, T4.[Code] as Raw material Name,T4.[Quantity] as BOMQTY,  (T1.[OpenQty]*T4.[Quantity]) as TOTALQTY FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry] INNER JOIN OITM T2 ON T1.[ItemCode] = T2.[ItemCode] INNER JOIN OITT T3 ON T2.[ItemCode] = T3.[Code] INNER JOIN ITT1 T4 ON T3.[Code] = T4.[Father] WHERE  T0.[DocStatus] ='o' 

You're posting in the Portuguese B1 space.
You might want to post in the English one: SAP Business One Application

Similar Messages

  • Query to check item no in all the rows in a sales order

    Dear All,
    Please assist me with a query which would be able to check the rows in a sales order to see if a particular item no is present. We are using SAP B1 2005 PL50
    Kind Regards,
    Monil.

    Hi !
    Try this !
    if @object_type = '17' and @transaction_type IN ('A', 'U')
    BEGIN
    if not exists (select t0.docentry from ORDR T0,RDR1 T1 where
    t0.Docentry = @list_of_cols_val_tab_del and
    t0.Docentry=T1.Docentry and
    T1.Itemcode in (select o1.itemcode from oitm o1) and T1.Itemcode = 'XXXXX'
    begin
    select @error = 1, @error_message = 'Add the item'
    end
    end
    Replace XXXXXX with your itemcode !

  • Calculation of Material staging time in Schedule line of Sales order

    Hi Experts,
         In a sales order for a material on GATP, there is time 23:57 coming as material staging time.
    Can any body explain how is this time calculated. 
    For the shipping point there is no working time maintained.

    Biswajit,
    Material staging time is calculated based on the GR time which u mention in the material master QM view.
    Please check the link, hope it will help.
    [Material Staging|http://help.sap.com/saphelp_47x200/helpdata/en/c6/f840fb4afa11d182b90000e829fbfe/frameset.htm]
    Thanks,
    Raja

  • Single PR for Total Raw Material ( RM) Demand

    Hi,
    Business requirement is to plan the raw material requirement qty yearly based on the FG demand for the year. But problem is RM planning will not be for the current year. RM based on FG demand is planned one year ahead. How to generate the PR without considering the current year demand of FG qty. If 'A' is a raw material which is used in manufacturing of FG B,C,D etc. Requirement is to generate one PR which equals to the total qty of 'A' raw material requirement for manufacturing B,C,D etc. Also, in PR the total qty of 'A' should display the drop down of how much qty is required for B,C,D etc.
    Thanks & Regards,
    Ramagiri.

    Hi,
    Try using Long Term Planning.
    In the planning scenario maintain 'Do not consider current stock'.
    Tarang

  • Standard report show the confirmed quantity in sales order

    Hello
    i'd like to know t-code for report show the confirmed quantity and the remaining quantity of sales order
    For example : i create sales order with quantity (1000) and the quantity of material in storage location 600 , so i want report display the confirmed quantity ( 600) and the remaining quantity (400)
    Thanks

    Search the forum before posting.  Check in VA05
    G. Lakshmipathi

  • User Exit in the change mode of Sales Order

    Dear Guru's
    In my requirement I want to stop the user from editing the status of Delivery block and Billing Block into the change view of Sales Order.
    I have 2 users for them whenever they may see the change mode of sales order they should see Delivery and Billing Block in gray
    that they should not be able to remove the block or change the block.
    But I have two other users also who can release and change the Blocks.
    Therefore I think mine is the User Exit case but I dont know which is the User Exit I have to give to the ABAPer
    Please suggest me the User Exit, Thanks in advance for answer and Suggestions.
    regards,
    Vojas

    Dear Vojas,
    As per me User exit will be used, as there are check about the users in your requirement. Please try with in MV45AFZZ, there are seceral user exit, I guess in  USEREXIT_READ_DOCUMENT may be used, ask your abaper to put a check on the current user and if the user which is not in your list of authorized one then change the Blocks in Display mode, or uneditable mode.
    Thanks,
    Raja

  • Break up of raw material cost for released finished materials

    Hi All,
    I have searched various threads before posting this question.
    Is there any standard report available to view the breakup of raw material cost for a release finished material.
    I have cost component split report but it shows everything in raw materials.... is there any report to show a break up of this raw materials cost.
    If there is no standard report can you please how I should develop a customized report.
    Thanks,
    Srini

    Dear Srinivas,
    You will get the cost breakup in the following report:
    CK84_99 - Itemization
    CK86_99 - Costed Multilevel BOM
    CK80_99 - Cost Components
    You will get the same information in CK13N
    From the standard SAP,  no report will show breakup for all the materials in single report at a time.
    We have developed the report through ABAP functionality
    Regards,
    Pavan Kumar Arvapally

  • Raw material issue for inspection from inspection lot

    Hello friends,
    My sample size is fixed i.e.75 gm for all  raw material quality testing. I have defined sampling procedure with sampling type "fixed sample". I want that this amount should be decreased from total lot quantity when i am posting it to unrestricted use. i.e. for 10 kg inspection lot quantity, 9.925 kg quantity should be posted .Now, system propose whole quantity for stock transfer from quality to unrestricted after usage decision.
    Waiting for reply!
    Thanks in advance!!

    Dear Kiran
    1)  System doesnot take decimal in samples. if your basic unit is KG and you procure 10kg material system will consider sample amount as 1 kg. it will not take 0.075kg as the sample.
    2) Other option is make the procurement in GMs but that  will be difficult for purchaser to handle
    3) or esle make use of this exit and do the posting based on that
    QEVA0009 - UD: Predefinition of quantity to be posted to sample stock 
    This will help
    Regards
    Gajesh

  • Quality info records: different pack configurations for same raw material

    how can i differentiate different pack configuration for same raw material in quality info records, as one might approved and the other not? that is, besides creating different material master for each packaging?
    thanks
    Alisa

    You need to use the MPN profile functionality that is a standard part of SAP.
    In Config under the purchasing define the MPN profile.  There are several options you can turn on/off including info records.
    You assign the MPN profile to your material. It now is considered by SAP to be an internal material number. 
    You then create a HERS material type for each separate manufacturer material number you have.  You only need the purchasing view for these materials.  You can also create purchasing text views, classification and some others if you wish.
    In the SAP approved vendors list (AVL), you then assign each manufacturer vendor(s) with the HERS material created.
    You create a Q-info record for each manufacturer/HERS material combination.
    Now, when you specify the internal material number in a PO, the system will tell you to order the MPN material.  When you do the drop down for the material now, it will show you the approved manufacturers allowed in the AVL for the ordering plant.
    When the 01 inspection lot is created you will have a vendor number as well as a manufacturer's number in the inspection lot.  The DMR can be done by the manufacturer or the vendor depending on how you set up the inspection plan. Q-info record will be used accordingly.
    Take a look at it and research it.  It's not hard to set up.
    FF

  • Raw material requirement needs to be updated

    Hi all,
    We are implementing PP and while configuring the WM/PP interface, I have the following requirement from my customer:
    After creating and releasing production order 1, it creates T.O. for raw material A in the warehouse with qty 10 (for example).
    After confirming the T.O. the raw material moves in the production staging area and is not used yet. Now if we have another Production order 2 using qty 15 of the same raw material, he wants the system to create a T.O. for for the delta qty 5(15-10) because we still have some previous raw material available.
    How can I do that?
    Thanks a lot
    Chaka

    Hy,
    You need to change your checking rule (T.Code OPJJ)
    remove tick from include reservation. or create new checking rule for that perticuller material.
                                            or
    If you want to do it temporary purpose then tick final issue for that material in earlier order but it mean that now there is no need of this material for this perticuller order.
    Regards,
    Dhaval
    Edited by: Dhaval Choksi on Jul 4, 2008 11:59 AM

  • Simulated raw material requirement

    Hi Experts,
                     Is it possible to do a simulated planning to get raw material requirement in a list form without creating planned orders ?
                     If we start from LTP, as per my understanding the moment we copy a planning scenario through MS64 or change through MS32, the plan is taken into operative version. As SAP recommends MS02 or MS01 only after that, the planned orders we are getting should be operative only. So how do we get a simulated requirement of raw materials? Please clarify.
    Regards

    Hi Mangalraj,
    Thanks for your prompt reply.
    In other words, can i say that if i have 2 or 3 planning alternatives to choose from on the basis of material analysis, I have to create separate planning scenarios for each of these and run MS01 one by one for each of these scenarios and then against each of these runs i have to do the material analysis and save it for comparison.
    Does it also mean that while  doing each MS01 run, i have to choose "delete and recreate planning data" till I arrive at the appropriate version to choose from ?
    And does it also mean that there is no way to know the material requirement for planning alternatives without doing any MRP run ?
    Regards

  • Can we create two POs for the same 3rd party Sales Order?

    Hi MM experts,
    Issue: Can we create two POs for the same 3rd party Sales Order
    In Third party purchase process, first sales order created with a spl. item category  and it creates the PR automatically with the Sales order material and Qty and this PR converted PO.
    They got a pur.req. for sale order on same item for same delevery date. They did not get any warning msg. saying that a PO was prviously placed against this sale order.
    How it is possible that we were able to place another PO? concern is that second PO was palced against SO which was already used & completed. they were able to place 2 POs for the same customer same delevery date. How it is possible?
    If anyone face the same issue, please let me know if you have any answer to this questions.
    Thanks in advance.
    Suresh.

    Suresh,
    It is hard for me to give you a definitive answer since you have created a customized solution.
    How it is possible that we were able to place another PO? concern is that second PO was palced against SO which was already used & completed. they were able to place 2 POs for the same customer same delevery date. How it is possible?
    Normally, the system will not do this.  A third party PR or PO will be 'account assigned' to the Sales order.  SAP standard 3rd party will not create additional purchase reqs unless there has been manual intervention.  Try searching for changes in the Sales order and changes in the original purchase order.  They may give you a clue.
    I believe the normal Item category for third party SO is TAS (I am working from memory here, I am not in front of a system).  I don't know what ZTAG does.  I confess I am not an SD expert.  You might also want to post your question in an SD forum.
    You mention two custom applications, ZMMPLAN and ZSTPMP.  These somehow have functionality that is used to help you convert your PRs to POs.  If I were in your position, I believe I would also look at these applications for clues to how they might be contributing to your problem.  And please don't send me details about these apps.  I will not comment on custom code in this forum.
    Sorry I can't be of more help.
    Rgds,
    DB49

  • I have PE11 I try PE12 When update for Camera raw is ok for my Nikon D610 ?

    I have PE11 I try PE12 When update for Camera raw is ok for my Nikon D610 ?

    Support for Nikon D610 is added is ACR 8.3 only. Hopefully it would be available for PSE12.
    If you want to use your Nikon D610 raw files with ACR in PSE11, you can instead use adobe camera raw convertor to convert your raw files to .DNG format.
    You can download ACR 8.3 convertor from http://labs.adobe.com/downloads/cameraraw8-3.html?PID=5157839

  • Tcode for displaying the changes made to sales order

    hi,
    i want to know is dere any tcode which displays how many times and by whom and what are the changes made to sales order.

    hiii
    use VA03 for display..
    also refer to following link
    Regarding 'display of changes in the sales order'.
    regards
    twinkal

  • Finding the original quanitity on sales order : Select Query on CDPOS ?

    Hello ABAPers,
      I have created a sales order and I changed the order quantity over many times using Va02. If i want to programatically determine the orginal quantity, on the sales order when it was created , how would i determine ?
    I thought, I would do a select query on CDPOS table and find out. But i found from se16 that for the Object ID - VERKBELEG and Object id = 00000XXXXX ( where XXXXX is sales order number), the VBEP and VBAP entries for Update mode shows no Old_vales and New_values.
    But if i click on environment>Changes> in Va02 for that particular Sales order, I see the old and new values list.
    Why is this not listed in CDPOS ? How do I progrmatically determine the original quanitity on Sales order ?
    Thanks
    SHK

    Hi Ferry,
      That FM did the trick. I ended up creating a FM myself to find the original qty and original unit. Somehow select qry on CDHDR and CDPOS, returned empty field for Old_value and new_value. Here is my FM below
    FUNCTION z_sw_originalqty_on_so.
    *"*"Local interface:
    *"  IMPORTING
    *"     VALUE(I_VBELN) TYPE  VBELN OPTIONAL
    *"     VALUE(I_POSNR) TYPE  POSNR OPTIONAL
    *"  EXPORTING
    *"     VALUE(I_ORIGINAL_QTY) TYPE  KWMENG
    *"     VALUE(I_ORIGINAL_UNIT) TYPE  VRKME
      DATA : i_editpos TYPE TABLE OF cdred INITIAL SIZE 1  .
      DATA : wa_editpos LIKE LINE OF i_editpos.
      DATA : wa_editpos1 LIKE LINE OF i_editpos.
      DATA : i_cdhdr   TYPE TABLE OF cdhdr INITIAL SIZE 1.
      DATA : i_cdpos   TYPE TABLE OF cdpos INITIAL SIZE 1.
      DATA : wa_cdhdr  LIKE LINE OF i_cdhdr.
      DATA : wa_cdpos  LIKE LINE OF i_cdpos.
      DATA : i_objid TYPE  cdhdr-objectid.
      DATA : delimiter(1) VALUE ' '.
      DATA : lv_org_qty(127)      TYPE c,
             lv_org_unit(127)      TYPE c.
      DATA : l_tabkey TYPE cdpos-tabkey.
      DATA : i_flag.
      CLEAR i_flag.
      CONCATENATE sy-mandt i_vbeln i_posnr '0001'  INTO l_tabkey.
      i_objid = i_vbeln .
      CALL FUNCTION 'CHANGEDOCUMENT_READ'
           EXPORTING
                objectclass                = 'VERKBELEG'
                objectid                   = i_objid
                tablekey                   = l_tabkey
                tablename                  = 'VBEP'
           TABLES
                editpos                    = i_editpos
           EXCEPTIONS
                no_position_found          = 1
                wrong_access_to_archive    = 2
                time_zone_conversion_error = 3
                OTHERS                     = 4.
      IF sy-subrc <> 0.
        SELECT SINGLE bmeng  INTO i_original_qty FROM vbep
                       WHERE vbeln = i_vbeln  AND
                             posnr = i_posnr.
        SELECT SINGLE vrkme INTO i_original_unit FROM vbep
                       WHERE vbeln = i_vbeln  AND
                             posnr = i_posnr.
      ENDIF.
      SORT i_editpos  BY udate utime tabname fname .
      LOOP AT i_editpos INTO wa_editpos.
        READ TABLE i_editpos INTO wa_editpos1
                 WITH KEY tabname = 'VBEP'
                          fname   = 'WMENG'
                          CHNGIND = 'U'.
        CLEAR : i_original_qty,i_original_unit.
        IF sy-subrc EQ 0.
          SHIFT wa_editpos1-f_old  LEFT DELETING LEADING space.
          SPLIT wa_editpos1-f_old AT delimiter INTO lv_org_qty lv_org_unit .
          i_original_qty  = lv_org_qty.
          i_original_unit = lv_org_unit.
          i_flag = 'X'.
          EXIT .
        ENDIF.
      ENDLOOP.
      sy-subrc = 4.
      IF sy-subrc <> 0 AND i_flag NE 'X'.
        SELECT SINGLE bmeng  INTO i_original_qty FROM vbep
                       WHERE vbeln = i_vbeln  AND
                             posnr = i_posnr.
        SELECT SINGLE vrkme INTO i_original_unit FROM vbep
                       WHERE vbeln = i_vbeln  AND
                             posnr = i_posnr.
      ENDIF.

Maybe you are looking for

  • Prob. Objects with same x,y,z coordinates appear at different positions

    Hello, I am having a problem where I have multiple objects with the same x,y,z coordinates but they appear at different positions on the screen. Could this have anything to do with scaling as I scale different types of objects differently. Also, I am

  • Muvo Slim Not playing fi

    My recently purchased Muvo Slim is no longer playing music files. It will play Audible files since I upgraded the firmware. When I try and sync the device with WMP0 the program locks. I've looked all over the KB to no avail. Actually, the whole KB is

  • OIM Catalog not show AD AppInstance

    In Oracle Identity Manager 11.1.2 with connector Microsoft Active Directory User Management Release 11.1.1 I installed this connector, and I created the Application Intance and this is not shown in the catalog. I already run scheduled task "Catalog S

  • Boris Title 3D -Can't Skew all of a sudden

    I previously had been able to skew text in Boris 3D. After a few weeks off, I re-opened it and tried again, but the text won't skew now. I have the text selected (I'm following a DVD tutorial) and have gone over it several times with no luck. I have

  • Weird glitch.

    I have just had Safari disappear on me without actually quitting it. The Menubar is gone, as are the previously opened windows. The icon in the Dock indicates it is still open, as does cmd tabbing. There are no miniaturised Safari windows in the Dock