How to calculate  extended quantity in BOM IMPLOSION QUERY

Hi guys,
I have given an assignment to create BOM  item where used report, For this purpose I am using an BOM implosion API  (PACKAGE.PROCEDURE = BOMPIINQ.IMPLODER_USEREXIT)
I am calling this API like this-
declare
  V_SEQUENCE_ID    number;
  v_err_msg        VARCHAR2(80);
  v_err_code       NUMBER;
  V_DATE           VARCHAR2 (30);
begin
delete BOM_SMALL_IMPL_TEMP;
-- V_SEQUENCE_ID:=142354;
SELECT BOM_IMPLOSION_TEMP_S.NEXTVAL INTO V_SEQUENCE_ID FROM SYS.DUAL;
SELECT TO_CHAR (SYSDATE, 'YYYY/MM/DD HH24:MI') INTO V_DATE FROM DUAL;
BOMPIINQ.IMPLODER_USEREXIT (
        SEQUENCE_ID => V_SEQUENCE_ID,        
        ENG_MFG_FLAG => 1,                   
        ORG_ID => :org_id,             
        IMPL_FLAG => 1,                    
        DISPLAY_OPTION => 1,                    
        LEVELS_TO_IMPLODE => 10,             
        ITEM_ID =>:item_id,           --34077520002
        IMPL_DATE => V_DATE,
        unit_number_from =>null,
          unit_number_to=>null,               
        ERR_MSG => v_err_msg,
        ERR_CODE =>v_err_code,
        organization_option =>1,
        organization_hierarchy =>null,
        serial_number_from =>null,
          serial_number_to =>null
end;
Now I query the table BOM_SMALL_IMPL_TEMP and it shows the data as per the structure of the item where used.
NOW ALL I WANT IS I WANT TO CALCULATE EXTENDED QUANTITY  (PARENT-QTY * ITS_CHILD_QTY)
CURRENTLY IT SHOWS ONLY COMPONENT QUANTITY. HOW CAN I CALCULATE EXTENDED QUANTITY LIKE WE DO IN BOM EXPLOSION?
Can any one help me on this?
Thanks,
Himanshu Gupta

Thanks , Yes it works but need to work out.
I have used rather calling API and then query using this-
select t1.*,
DECODE(T1.PART,T1.PART,(SELECT DISTINCT SEGMENT1 FROM MSI WHERE INVENTORY_ITEM_ID = T1.PART)) LOWEST_ITEM,
DECODE(T1.PART,T1.PART,(SELECT DISTINCT DESCRIPTION FROM MSI WHERE INVENTORY_ITEM_ID = T1.PART)) LOWEST_ITEM_DESC,
t2.segment1 PARENT_ITEM,
T2.DESCRIPTION PARENT_DESCRIPTION,
T2.ITEM_TYPE PARENT_ITEM_TYPE,
DECODE(T2.ORGANIZATION_ID, 125, 'MU1', 126, 'MU2') ORG_CODE,
T3.ITEM_COST,
T1.QTY*T3.ITEM_COST EXTENDED_COST
from
(select t.*
         from (WITH t AS (SELECT distinct SYS_CONNECT_BY_PATH(a.parent_item_id, '\') || '\' || a.current_item_id || '\' as path,
                                          a.component_quantity qty_per_assembly
                            FROM BOM_SMALL_IMPL_TEMP1 a,
                                 mtl_system_items_b      b
                           where a.parent_item_id = b.inventory_item_id
                             and b.organization_id = a.organization_id
                           START WITH b.item_type IN ('SA','FG MFG')
                          --CONNECT BY  a.current_item_id = PRIOR a.parent_item_id
                          CONNECT BY nocycle a.parent_item_id = PRIOR
                                     a.current_item_id)
                SELECT root_part, part, SUM(qty) AS qty
                  FROM (SELECT SUBSTR(t1.path,
                                      2,
                                      INSTR(t1.path,'\', 1, 2) -
                                      INSTR(t1.path, '\', 1, 1) - 1) as ROOT_PART,
                               SUBSTR(t1.path,
                                      INSTR(t1.path, '\', -1, 2) + 1,
                                      INSTR(t1.path,'\', -1, 1) -
                                      INSTR(t1.path, '\', -1, 2) - 1) as PART,
                               (SELECT EXP(SUM(LN(t2.qty_per_assembly)))
                                  FROM t t2
                                 WHERE t1.path LIKE t2.path || '%') AS qty
                          FROM t t1
                         GROUP BY t1.path)
                 GROUP BY root_part, part) t
               where t.part = :lt_part
       ) t1,
      mtl_system_items_b t2, CST_ITEM_COSTS T3
where t1.root_part = t2.inventory_item_id
AND T1.PART = T3.INVENTORY_ITEM_ID
AND T2.ORGANIZATION_ID = T3
.ORGANIZATION_ID
   --and t2.item_type = 'FG MFG'
   and t2.organization_id = :lt_org;
and now it is running perfectly

Similar Messages

  • Ck11n:how to calculate the Quantity?

    Dear all.
    I use the tcode ck11n to create material cost estimate with quality structure.
    And input the parameter like below:
    Material = 600000-000000-0012
    plant = 1000
    Costing Variant = PPC1
    Costing Lot Size = 1
    After press return,the sap show the Itemization for material like below:
    20.11.2008                            Dynamic List Display                                   1
    Itemization for material 600000-000000-0012 in plant 1000
    Material             600000-000000-0012
    Plant                1000              
    Costing Variant      PPC1               Standard Cost Est. (Mat.)
    Costing Version       1
    Costing Date from-to 01.12.2008 - 31.12.9999
    Lot Size             1                  KARCarton
    Cost Base            1                  KARCarton
    Cost of Goods Manufactured
    ItmNo
    ItemCat
    Resource
    Cost Eleme
    Total
    Fixed
    Currncy
    Quantity
    Un
    1
    E
    J0103033   WC1      A03
    1001
    14,400.00
    7,200.00
    CNY
    3,600
    CAR
    2
    E
    J0103033   WC1      A01
    1001
    25,200.00
    10,800.00
    CNY
    3,600
    CAR
    3
    E
    J0103033   WC1      A02
    1001
    14,400.00
    7,200.00
    CNY
    3,600
    CAR
    4
    E
    J0103033   WC1      A04
    1001
    14,400.00
    7,200.00
    CNY
    3,600
    CAR
    5
    E
    J0103033   WC1      A05
    1001
    14,400.00
    7,200.00
    CNY
    3,600
    CAR
    6
    M
    1000 600000-000000-0013
    40000002
    9.00
    0.00
    CNY
    3
    CAR
    7
    G
    CC_AT01    41000001
    41000001
    2.25
    0.00
    CNY
    82,811.25
    39,600.00
    CNY
    At the first line,the Resource was "J0103033   WC1      A03",and the Quantity was "3600".
    I don't know why the Quantity was "3600" or where the Quantity come from?
    So I need someone tell me how to calculate the Quantity?
    Thank you so much.
    Regards
    Yoda

    Hi,
    Pl note the Item Category, " M "- Material - The 3 quantity has been picked up from BOM correctly.
    You are referring to Quantity 3600, which is against item category - E. Item category " E" means Internal activity allocation i.e the date flows through assignment to Routing. Check the Work center, Cost center & Activity types  J0103033 WC1 A03 1001.
    Now i think it is clear.
    Cheers !
    Siva
    Cost of Goods Manufactured
    ItmNo ItemCat Resource  Cost Eleme Total Fixed Currncy Quantity Un 
    1 E  J0103033 WC1 A03 1001  14,400.00  7,200.00  CNY  3,600  CAR
    2 E  J0103033 WC1 A01 1001  25,200.00  10,800.00  CNY  3,600  CAR
    3 E  J0103033 WC1 A02 1001  14,400.00  7,200.00  CNY  3,600  CAR
    4 E  J0103033 WC1 A04 1001  14,400.00  7,200.00  CNY  3,600  CAR
    5 E  J0103033 WC1 A05 1001  14,400.00  7,200.00  CNY  3,600  CAR
    6 M  1000 600000-000000-0013 40000002  9.00  0.00  CNY  3  CAR
    7 G  CC_AT01 41000001  41000001  2.25  0.00  CNY

  • How to get Initial quantity in BOM

    Hi Friends ,
                     My requirement is to display the initial quantity and changed quantity of BOM , i am getting changed quantity but i am unable to display initial quantity in my report.I have searched all the BOM tables but initial quantity is not there in tables .
    please help.
    Regards,
    Sravani.

    Hi ,
    Change document tables means CDHDR and CDPOS you need to check if the history of the field you are looking for is activated with change logs then you can find the old values  ...also can you please check why do you want the value as for transaction data it is current value which matters not the history ...
    Pleas explain the field and where it comes in transaction so that we  can provide you exact way to get the history ..Also remember it must not be a calculated field to get from the table ...
    Thanks,
    Anjaneya

  • How to calculate ACTUAL QUANTITY for a given PM order

    hello all,
    i have  an ALV report requirement like below...
    (for given Pm order AUFK-AUFNR)
    i need to display
    material no       material desc     requirement quantity  Units of measure     Actual quantity
    these fields i have taken from RESB table (matnr from RESB ,maktx from MAKT, bdmng from RESB, units of measure from RESB ),
    now my question is from where do i get actual quantity ....
    in which table does this actual quantity will be stored....
    thankq....

    Check with field RESB-ENMNG as mentioned by Custodio.
    He meant this field only by saying
    If so, it's also in RESB-DENMNG.
    I guess.
    This will only give you the quantity withdrawn.
    But for Actual Consumption Based on date you can  use AUFM ( this table gives the Material Movements carried out for Prod. Order ).

  • How to calculate the monthly variances in the query

    Hi Gurus;
    I need to design a query which calculates the variance of costs with respect to the previous month. I want to select a fiscal period range and only show the variances for these selected periods. However when I enter a range the calculations for the first period dont work. Also If I add the fiscal period characteristic over the structure the formulas are not calculated for the previous period.
    Need help?
    How can I calculate the variance of costs with respect to previous months and display them monthly?
    Thanx a lot in advance,
    Duygu Sile

    Hello Duygu,
    restrict the original cost keyfigure with a variable which is based on fiscal period (this will be actual cost). And then create a new keyfigure(copy of original keyfigure) and use same variable but in detail of restriction use -1 for offset( this will be previous). And then define a new formula and subtract actual from previous or opposite)
    Sarhan.

  • How to calculate multiple aggregation in a single query

    how to find firstname ,lastname for max and min salary from employees table group by department in a single query?
    Edited by: Gnanasekar on Jan 10, 2012 6:36 AM

    check this query
    select ENAME,SAL
    from EMP
    where SAL in(select max(SAL)
                       from EMP
                      group by DEPTNO)
    or SAL in(select min(SAL)
                 from EMP
                  group by DEPTNO)Hope this will help you..
    You should ask this question at sql/plsql forum
    If someone's response is helpful or correct, please mark it accordingly.

  • How to calculate the summery values in the query

    Hi,
    I have facing a typical problem , I can able to get the values for the detailed one
    plant   material   qyt
    a          x          100
                y           50
    b           z            50
    result               200
    when I am removed the drilldown for material and plant b nothing is coming.
    palnt          qty
    a               -
    result        -
    here I am getting blank values . Since qty is calculated key figure .I have tried different options to like aggregation but I haven't succedd to get that .
    is there any apporoch to summiered values .
    Thanks in advacne .
    Thanks,
    Vijay

    Hello Duygu,
    restrict the original cost keyfigure with a variable which is based on fiscal period (this will be actual cost). And then create a new keyfigure(copy of original keyfigure) and use same variable but in detail of restriction use -1 for offset( this will be previous). And then define a new formula and subtract actual from previous or opposite)
    Sarhan.

  • How to calculate the quota base quantity in quota arrangement?

    Hi all,
    As we all know, when a new supplier is added in the quota arrangment, we take the help of quota base qunatity so that the new supplier does not get any unfair advantage over the existing suppliers. Would you please help me on how to calculate the quota base quantity or on what basis the quota base quantity is calculated?*
    Regards,
    Ranjan

    Dear,
    Quota arrangement divides the total requirements generated over a period of time among the sources of supplied by assigning a quota.
    Quota u2013 quota is equal to a number and its represents the proportionate of requirements. Total quota of all the vendors is equal to 100% of requirements.
    This quota arrangement is also specific to material and plant level.
    Quota rating = quota allocate quantity + quota base quantity / quota.
    Quota based quantity used only when a new vendor introduced.
    In the as on date situation, the minimum quota ratings will considered as preferred vendor.
    The 2 vendors has 2 same quota rating, the vendor who is having the highest quota will considered first.
    In the running quota, a new source of supply is included. (In situation of short supply) including a new source not means to reduce the quota for existing.
    Regards,
    Syed Hussain.

  • How to get calculated component quantity for BOM like in CS12

    Hi All,
    Please let me know how to get the calculated component quantity of BOM similar to the field in CS12.
    Regards
    Mahesh

    hi,
       [http://www.sap-topjobs.com/SpecialPP/overviewdoc1.pdf]

  • How SAP calculate the outstanding PO quantity and amount.

    how SAP calculate the outstanding PO quantity and amount.

    Hi Arun Raj,
    APO does not calculate the open qty.
    Only the open qty of the PO is ciffed to APO from R/3.
    Regards,
    Ashok

  • Zero quantity in BOM

    Hi,
    I been through many thread for BOM component quantity zero, but i need suggestion for my specific case.
    some stock materials they treat as consumables (those have high price items used in shop floor)so they want category as consumables in BOM and want to enter specific material number with zero quantity.
    i can create "C" category by avoiding back flush option for them but how can we give zero as quantity.
    Any suggestions specific to consumables in BOM?
    Thanks in advance.

    SAP has been very backward in not recognizing the need for quantity zero in the BOM.  Every other system I have been exposed to over a 30+ year career in Materials Management allows this capability.  Oracle allows it.  Baan allows it.  APICS classes speak of the need for it.  Only SAP seems to not "feel the need".  I think this is because somebody at SAP 30 years ago said that because you can't divide by zero, we (the programmers) can't figure out how to calculate certain things.  Well in 30 years, I figure they could have written the code necessary to ignore calculations for costing and other things whenever you bump into quantity zero.  What, maybe ten lines of code would cover that?
    Reasons Why You Need Qty 0 in BOMs
    1.  A/R Materials (As Required):  Lubricants or Adhesives required to build a product are not rationed out by the drop, or by the bottle, but left to the assembler to determine the appropriate quantity based on SOE instructions.  On the drawings, Engineers will call out A/R (as required) in the qty box.
    2.  Variable qty items:  Shims or trimmer balance weights are issued as one each, but cannot be determined until the assembly of the product occurs.  As appropriate, differing quantities are issued to the product to fit the need for the specific machine being built.
    3.  REF Materials.  Quite often, assembly drawings will need to show the mating interface with other parts of the machine which are not actually part of the assembly.  In this case, we would show the interface as u201CREFu201D on one assembly, but as quantity u201C1u201D on another assembly.
    4.  Tooling:  Tooling needs to be tracked and linked to the assemblies that it is used on.  But it does not get consumed on a one-for-one basis with the assembly.  So we want to use SAP where-used capability by linking each tool within each BOM where it is relevant, but show the quantity as u201C0u201D.  On the drawing tooling is called out as REF.
    5.  Must Choose Optional Choices:  On u201Cassemble-to-orderu201D products, one of several different choices may be needed for various parts of the machine configuration.  These u201Cmust chooseu201D options are items where the machine will not be functional without one of the available choices (such as three choices of tires on a car.  The way these options are handled on the drawings is by showing them with Alpha characters in the quantity field where you u201Cmust chooseu201D one of the u201CAu201D items, one of the u201CBu201D items, and one of the u201CCu201D items to have a fully configured, workable machine.  On the BOMs, we call out all the choices as qty 0, with a note to refer to the customer sales order for which choice has been made.
    6.  May Choose Optional Choices:   On u201Cassemble-to-orderu201D products, in the case where an option is a u201Cmay chooseu201D option you may either order or the option or not; the machine will operate fine either way.  In this case the option would show on the drawing with an u201C*u201D in the quantity field and on the SAP BOM, you would call out quantity u201C0u201D with a note to refer to the customer sales order for which choice has been made.
    7.  Acceptable Substitute Items:  In some cases two interchangeable part numbers may be acceptable to use in the product.  For example, two manufacturers make RF drivers that are fully compatible and work fine in our machine.  But Field Service required the use of two distinct part numbers for reliability tracking, so the drawings allow for either part A or part B to be used.  Depending on the current cost/reliability/availability of the two parts, we will designate one item as quantity u201C1u201D in the SAP BOM and the other item as quantity u201C0u201D.  On the drawing, you call out one item as quantity u201C1u201D and the other as quantity u201C*u201D with a note explaining the ability to substitute one item for the other as desired.
    8.  JIT KIT support:  In order to efficiently procure and build product, we may create documents that are u201Csetsu201D of material that can be procured on a single PO.  So we end up with one set of drawings depicting way the machine is built and resides in the field for the next X years, and another group of drawings defining sets of material in special packaging aiding in efficient build of the product.  On both groups of drawings the quantity would be u201C1u201D (or whatever qty is needed on the machine) but in the SAP BOMs, only the JITKIT BOM would have a quantity >0.  The manufacturing BOMs would call out the u201Csetu201D as qty 1 but all the individual pieces of the set would be called out as qty u201C0u201D.  In that way when you look at the where-use of a component in one of the sets, you would be able to determine what assembly drawings the item appears on, and also which drawing is the u201Cactiveu201D driver of the material.
    9.  Request to move certain items to later in the build process:  Assembly drawings usually show the assembly in the finished state, as the assembly will look out in the field being used by the customer.  But internally in the factory we often desire the assembly to be built to an unfinished level with some pieces missing to allow for easier testing of the full product.  Or we may choose not to put the final cosmetic touches on a machine until close to the shipping point in order to avoid scratching or denting of exterior surfaces.  For example, a modulator assembly will be built with recyclable in-house panels and only have the finished panels swapped out for the recyclable tooling panels at the clean, pack, and ship operation.  Other assemblies will have access panels omitted altogether to allow for easy access for machine tuning in final test.  These missing panels would be added at clean, pack, and ship.  So in the SAP BOMs, we change the quantity from u201C1u201D to u201C0u201D in the assembly BOM, and create separate BOMs showing quantity u201C1u201D with the clean, pack, and ship items that complete the assembly built days or weeks earlier.
    Edited by: Jim Bathgate on Nov 22, 2010 5:13 PM

  • How to calculate the unit for RATE?

    Hey All,
    I am not sure if there is something standard for this or not.
    I am calculating the 'Rate' by using 'Value/Amount' and 'Quantity' as follows -
    Rate == Value /  Quantity
    I need to calculate the unit for the rate as below -
    Rate unit == Value unit (Currency) /  Quantity unit (Base_uom) 
    (for example -
    if value is 1000 USD and quantity is 10 TO then Rate should come out as 100 USD / TO)
    Could anyone please suggest how to calculate the unit in this case?
    Many Thanks!
    Tanu

    Hi,
    Go through the below link it may give some idea
    http://help.sap.com/saphelp_nw04/Helpdata/EN/19/1d7abc80ca4817a72009998cdeebe0/content.htm
    Regards,
    Marasa.

  • How to show the quantity in decimal in MIGO

    Dear expert,
    How to show the quantity in decimal in MIGO?? for example in material BOM the quantity is 12.480 but the quantity in MIGO is 13. it's automatically rounded.
    what should I do to show the decimal point in MIGO?
    Thanks
    Pauline

    Hi,
        Please check in su3 -
    defaults (Tab) -
    Decimal Notation.
        Change the decimal notation and logoff and login to apply the changes.
        I think it may help you.
    Regards
    Sreedhar Reddy

  • How to maintain decimal places in BOM Qty & what is the essence of base qty

    Hello PP members
    How to maintain decimal places in BOM Qty & what is the essence of base quantity in BOM ?
    Thank You

    ur first question is not understood, You can have maximum of 3 decimals in BOM item qty.
    Base qty is the qty which is refered to all the BOM items.
    example -
    Product X, base qty 1
    Raw material 1 - componen t qty= 1
    Raw material 2 - Component qty= 5
    This means To produce Product with qty1, it needs raw material 1 qty 1  and raw material 2 qty 5.
    This means To produce Product with qty10, it needs raw material 1 qty 10  and raw material 2 qty 50.
    This is the meaning of Base qty..it is the referece qty refered to all the components.
    About the decimal places
    let us say  example 2
    To produce Product with qty1, it needs raw material 1 qty 1  and raw material 2 qty .0001.
    When you enter this in SAP for the raw materialm 2 system will give error message that you  need to enter the qty with maximum 3 decimal places, hence you need to enter as below
    Product with qty10, it needs raw material 1 qty 10  and raw material 2 qty .001.
    This is how you need to adjsut the base qty and component qty with decimalplaces moer than 3,
    pl come back

  • How to see changes in all BOM" s under plant for a period ?

    Hi Gurus,
    i want to see the list BOM's which was changed with in period and the details of changes like Quanity and user names who have done the change.
    Regards,
    mahesh.

    HI Mangalraj,
    Thank You For the response, My Client Is asking For a report Where We can Get details Of BOM list under a plant which have Gone Under changes with in a specific Period. Plant level Of .
    Ex; in the plant 1111 we have some  200 no of  BOM s . some users have changed 30 different BOM in a Month. how can i get list of BOMs which gone under Change (Header and Item level) changes.
    i have taken  Plant wise BOM no and passed it to STPO and get the details , but in STKO the Fields are showing as CHANGEDBY, CHANGEDON,but i am not able find the changes happen.
    EX:  base quantity  of header material was changed from 1 to 2 by a abcd user in 01.01.2014.
    by using STKO we can see the user name and changed date but i am not able find the change details.
    Please help me how can i develop a report to extract data of BOM changes based on input of plant and date range.
    Thanks in Advance...........
    Regards,
    Mahesh.

Maybe you are looking for

  • I am using a mac book air 11. i made click in amazon and took me to a different place (wikimedia or something like this)

    When i made click in amazon, it showed me the below screen. I delete History. I did everything possible but always take me to this screen every time i make click in amazon. Any help is welcome. Thanks    C

  • Low resolution warning?

    I have the Nikon D80 and have it set to fine and large file format and can't seem to enlarge bigger than an 8 x 12. Is Aperture possibly compressing the files somehow, or changing the mega pixels when I export the photo?

  • Wlan problem

    well i know that i'm not the only one, but i'm facing loads of problem with my WLAN connection. Is there a solution for this problem, my actual ios is 6.1.1

  • Now too late to even 'Reserve' for 6/24??

    Well, maybe I was greedy while trying for hours to 'Pre-Order', passing on the default to 'Reserve' for 6/24. Am I out of luck until a week or so later now? :o( Make a reservation. We were unable to complete set up online. To finish creating your acc

  • CS5.5 Rendering everything blue when queued from Prem Pro

    My project is a custom 800x600 / 29.97 canvas using Quicktime Animation as the codec. Export> Media from Premiere Pro CS5.5. Using "Match Sequence Settings". If I Export from Premiere Pro, it renders fine. But if I Queue the project into Adobe Media