Query for BOM Allocations to Master Routes

I just acquired Query Building permissions and the involved transactions in SAP-PP.  I have access to the sandbox (QAS) to build them before they go into production.  I have a good technical background but never built a query in SAP.  I should be able to catch on fairly quick.
**I would like to create a query that reports which material numbers have BOM components that are/aren't allocated.  Is this possible where do I start?
**Are there any threads in this forum that show good query information in regards to production versions, master routes, BOMs, etc. that someone can point me to?

Hi Lucas,
Sorry for the late reply. I was travelling yesterday. Was able to create your query in quickviewer.
Table I used for Joining are as follows:
Mast: Material to BOM Link
STPO: BOM Item
PLMZ: Allocation of BOM to operation
PLPO: Task List - operation/activity
Join Condition:
MAST-STLNR to STPO-SLNR
STPO-STLTY to PLMZ-STLTY
STPO-STLNR to PLMZ-STLNR
STPO-STLKN to PLMZ-ZUONR
PLMZ-PLNTY to PLPO-PLNTY
PLMZ-PLNNR to PLPO-PLNNR
Selection Screen:
Material Number: MAST-MATNR
Plant: MAST-WERKS
List Fields:
Material Number: MAST-MATNR
Plant: MAST-WERKS
BOM Item Number: STPO-POSNR
BOM Component: STPO-IDNRK
Component Quantity: STPO-MENGE
Component Unit: STPO-MEINS
Operation Assignment: PLPO-VORNR
I guess this will help you in getting your query set. In case you need to change the field you can do as per your requirement. As told earlier once you are ok with Quickviewer you can convert it to SAP Query from SQ01 transaction.
Hope this helps you out.
Best regards,
Kiran

Similar Messages

  • Goods Issue for BOM material thru SD route

    Hi Experts,
    I have to carry out Goods issue of BOMB material (Main Material + Components) using Sales BOM. Currently I donot find any config setting that allows me to carry out goods issue thru SD route. Currently we are carrying out this transaction using IS-OIL TD route which is a standard functionality.
    Can experts guide me how I can carry out this transaction using SD route. What will be the setting required etc.
    Thanks in Advance,
    Casimer.

    Hello Francis,
    I did not understand why master of Configurable material is required. It is simple oil bom. The bom is maintained using CS01. The item category is set as required.
    Sales order / Delivery gets created. As the main item is not in stock, no sloc is entered for this line item only the valuation type is assigned. For the component, the sloc and the valuation is assigned. After entering these data in the delivery and clicking on Post goods button, system gives error message like not stock for main item etc.
    Actually the system shall make material to material transfer in the background from component to main item and issue main item thru mvt 601.
    Can u adivse on this.
    regards

  • Query for BOM

    Hi All,
    I need a query which displays for an spicific BOM child item
    all its parent items in the hierarchical structure
    For example: the Table ITT1 consists of following rows
    child_item  parent_item
    I1             P1
    I1             P2
    P1            P3
    P2            P4
    I1              P5
    the query I need should display
    child_item  parent_item1  parent_item2
    I1              P1                 P3
    I1              P2                 P4
    I1              P5

    Hi All,
    thank you for the quick answers, but I have already found the solution, how to display for an spisific item all it's parent items in all assembly levels.
    It can be done with recursive function calls:
    CREATE FUNCTION dbo.GetParentItems(@ChildItem nvarchar(20))
    RETURNS @retParentItems TABLE(ChildItem nvarchar(20), ParentItem nvarchar(20))
    AS 
    BEGIN
         DECLARE  @Item nvarchar(20), @ParentItem nvarchar(20)
         DECLARE RetrieveParentItems CURSOR STATIC LOCAL FOR
         SELECT Code, Father FROM ITT1 WHERE Code=@ChildItem
         OPEN RetrieveParentItems
         FETCH NEXT FROM RetrieveParentItems
         INTO @Item, @ParentItem
         WHILE (@@FETCH_STATUS = 0)
         BEGIN
              INSERT INTO @retParentItems
              SELECT * FROM dbo.GetParentItems(@ParentItem)
              INSERT INTO @retParentItems
              VALUES(@Item,@ParentItem)     
         --     set @Level = @Level + 1     
              FETCH NEXT FROM RetrieveParentItems
              INTO @Item, @ParentItem
         END
         CLOSE RetrieveParentItems
         DEALLOCATE RetrieveParentItems
         RETURN
    END
    GO

  • Query for BOM child items

    Dear Friends,
    This following query,if I will attach it at PO in Item Code with formatted search  , I get result as BOM child items as per project code, here project code is similar to item code.
    But my limitation is that my  item code is more than 8 character ,under accounting TAB BP project  ,project I can define it up to 8 character only.
    My requirement is that if I will put project name (which is 30 characteristic) as like as item code , shall I get child item list.
    If yes , suggest necessary changes in above query.
    Query :
    WITH RECUR ( CODE) AS
    SELECT ITT1.CODE FROM  ITT1 INNER JOIN OITT ON OITT.Code=ITT1.Father WHERE ITT1.Father=$[$157.1.1]
    UNION ALL
    SELECT ITT1.CODE
    FROM ITT1  INNER JOIN  OITT ON OITT.Code=ITT1.Father
    INNER JOIN RECUR ON   RECUR.CODE    =ITT1.Father
    SELECT CODE FROM RECUR inner join OITM on OITM.ItemCode=RECUR.CODE --and OITM.PlaningSys='M' and OITM.PrcrmntMtd='B'
    Thanxs & regards
    Mahesh.

    Dear Mahesh,
    I am not sure about your aim.
    You would like to put a formatted search in the project code field of the sales order in order to get the children of the itemcode of that line in the document. The child codes will become the name of the project.
    Your issue is the following:
    As the project code field in the sales order (field called: rdr1, project) is long 8 characters only and the sum of the children codes will be too long for this field.
    Am I correct?
    If I am not correct, can you please tell me step by step what you are trying to do?
    Thank you.
    Marcella Rivi
    SAP Business One Forums Team

  • Query for BOM Stock

    Hi Experts,
    I need a report in which i hit BOM Code and it returns BOM + Child Item Inventory Status.
    i.e.
    BOM Code = ABC
    Child Code = A, B, C
    When I select ABC in selection criteria then I can able to see BOM Code(ABC) + Child codes(A, B, C) inventory status.
    Any help will be appreciated.
    Regards,
    Ravi

    Hi Ravi,
    try this:
    Declare @Item As Nvarchar(20)
    Set @Item = (Select MAX(Code) from OITT I0 Where I0.Code = '[%0]')
    Select
    T1.Father as [Parent Code],
    (Select MAX(ItemName) from OITM Where ItemCode=T1.Father ) [Parent Name],
    T1.Code Child,
    (Select MAX(ItemName) from OITM Where ItemCode=T1.Code ) [Child Name],
    (Select Sum(onHand) from OITM Where ItemCode=T1.Code) [OnHand Qty]
    from ITT1 T1, OITT T0
    Where
    T0.Code = T1.Father and
    T0.Code=@Item For Browse
    Thanks,
    Neetu

  • Bom for component allocation in routing

    I have created Sales order Bom. When I create normal routing and go for component allocation then system asks for Bom creation.
    Why system is not considering  sales order bom in Normal routing for component allocation?

    Hi,
    Sales order BOM will not be valid for Production. Eventhough you have created the sale BOM, the system will consider only the Production BOM. So you need to create a Production order BOM also, when you want to create a routing or production order creation.
    Regards,
    V. Suresh

  • BDC report for BOM master

    can any body help me to do one bdc for
    BOM master?? i m doing this first time so i need some input
    thanks well in advance.
    points ll be rewarded...
    Message was edited by:
            soumya shekhar

    hi
    good
    When you try to create, you would find a pushbutton 'INSERT NEW LINES' or something simialr to enter your data in the next line. Say you're entering the Material inthe first row, its field position would be MARA-MATNR(01). Now when you click the Insert Pushbitton the cursor always is at positon 2. so you have to loop the remaining data to enter in MARA-MATNR(02). Yougenereally set a counter and pass that counter value (in this case the counter value is 2 always)
    The other case when you don't have a push button to Insert. Enter all the rows and then do a Page down. Now your cursor would sit back at position 2 again. Say if there are 20 rows in the first screen. You would keep incrementing the counter and then when it is 21 you do a pagedown and then reset the counter to 2. You loop the pagedown and in it you loop the counter.
    I have attached a BDC where I use the second case (no push button). Do a recording and then you would know all the answers by yourself.
    *& REPORT ZPP0122 *
    *& Module : PP |
    *& Application : The program loads the Material Assignment of Routings |
    *& |
    REPORT zpp0122 NO STANDARD PAGE HEADING
    MESSAGE-ID z0
    LINE-SIZE 132
    LINE-COUNT 65(2).
    Internal Tables *
    *Internal table for the Routing fields.
    DATA: BEGIN OF i_rout OCCURS 0,
    plnnr(8),
    plnal(2),
    matnr(18),
    werks(4),
    END OF i_rout.
    DATA:
    g_my_rec_in LIKE i_rout.
    Declare internal table for Call Transaction and BDC Session
    DATA: i_bdc_table LIKE bdcdata OCCURS 0 WITH HEADER LINE.
    Global Variables *
    DATA: g_counter(2) TYPE n,
    g_field_name(18) TYPE c,
    zc_yes TYPE syftype VALUE 'X'.
    Selection Screen *
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
    PARAMETERS: p_fname1 TYPE localfile .
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.
    PARAMETERS: p_rloc1 AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-005.
    PARAMETERS p_group(12) OBLIGATORY DEFAULT 'ZROUTING'.
    SELECTION-SCREEN END OF BLOCK c.
    SELECTION-SCREEN END OF BLOCK b.
    SELECTION-SCREEN END OF BLOCK a.
    **WRITE the report header
    TOP-OF-PAGE.
    INCLUDE zheading.
    Start of selection *
    START-OF-SELECTION.
    Load Input file
    PERFORM f_load_input_file.
    Create BDC records.
    PERFORM create_bdc_records .
    *& Form Create_BDC_records
    perform the BDC for the records in the internal table
    FORM create_bdc_records .
    IF NOT i_rout[] IS INITIAL.
    Open BDC session
    PERFORM open_bdc_session.
    LOOP AT i_rout.
    g_my_rec_in = i_rout.
    AT NEW plnnr.
    CLEAR i_bdc_table[].
    PERFORM insert_screen_header.
    ENDAT.
    CONCATENATE 'MAPL-PLNAL(' g_counter ')' INTO g_field_name.
    PERFORM bdc_field USING g_field_name i_rout-plnal.
    CONCATENATE 'MAPL-MATNR(' g_counter ')' INTO g_field_name.
    PERFORM bdc_field USING g_field_name i_rout-matnr.
    CONCATENATE 'MAPL-WERKS(' g_counter ')' INTO g_field_name.
    PERFORM bdc_field USING g_field_name i_rout-werks.
    PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
    g_counter = g_counter + 1.
    Page Down for further entries
    IF g_counter = 19.
    PERFORM bdc_field USING 'BDC_OKCODE' '=P+'.
    PERFORM bdc_dynpro USING 'SAPLCZDI' '1010'.
    g_counter = 2.
    ENDIF.
    AT END OF plnnr.
    PERFORM bdc_field USING 'BDC_OKCODE' '=BACK'.
    PERFORM bdc_dynpro USING 'SAPLCPDI' '1200'.
    PERFORM bdc_field USING 'BDC_OKCODE' '=BU'.
    PERFORM insert_bdc_new.
    ENDAT.
    ENDLOOP.
    CLEAR i_rout[].
    PERFORM close_bdc_session.
    Release the BDC sessions created
    PERFORM release_bdc.
    ENDIF.
    ENDFORM. " open_group
    *& Form bdc_dynpro_start
    Call the screen for the input of fields
    -->P_G_PROGRAM_1
    -->P_G_SCREEN
    FORM bdc_dynpro USING p_g_program_1
    p_g_screen.
    CLEAR i_bdc_table.
    i_bdc_table-program = p_g_program_1.
    i_bdc_table-dynpro = p_g_screen.
    i_bdc_table-dynbegin = 'X'.
    APPEND i_bdc_table.
    ENDFORM. " bdc_dynpro_start
    *& Form bdc_field
    Insert field *
    FORM bdc_field USING f_name f_value.
    IF f_value <> space.
    CLEAR i_bdc_table.
    i_bdc_table-fnam = f_name.
    i_bdc_table-fval = f_value.
    APPEND i_bdc_table.
    ENDIF.
    ENDFORM. "bdc_insert_field
    *& Form open_bdc_session
    Create the BDC session
    FORM open_bdc_session .
    Open BDC session and creat and update condition records
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    client = sy-mandt
    DEST = FILLER8
    group = p_group
    HOLDDATE = FILLER8
    keep = 'X'
    user = sy-uname
    RECORD = FILLER1
    PROG = SY-CPROG
    IMPORTING
    QID =
    EXCEPTIONS
    client_invalid = 1
    destination_invalid = 2
    group_invalid = 3
    group_is_locked = 4
    holddate_invalid = 5
    internal_error = 6
    queue_error = 7
    running = 8
    system_lock_error = 9
    user_invalid = 10
    OTHERS = 11
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM. " create_bdc_session
    *& Form insert_screen_header
    Header Data inserted
    FORM insert_screen_header .
    g_counter = 1.
    First screen
    PERFORM bdc_dynpro USING 'SAPLCPDI' '1010'.
    PERFORM bdc_field USING 'BDC_CURSOR' 'RC271-PLNNR'.
    PERFORM bdc_field USING 'BDC_OKCODE' '=ALUE'.
    PERFORM bdc_field USING 'RC271-PLNNR' g_my_rec_in-plnnr.
    PERFORM bdc_field USING 'RC27M-MATNR' ' '.
    PERFORM bdc_field USING 'RC27M-WERKS' ' '.
    PERFORM bdc_field USING 'RC271-PLNAL' ' '.
    *next screen
    PERFORM bdc_dynpro USING 'SAPLCPDI' '1200'.
    PERFORM bdc_field USING 'BDC_OKCODE' '=MTUE'.
    *next screen
    PERFORM bdc_dynpro USING 'SAPLCZDI' '1010'.
    ENDFORM. " insert_screen_header
    *& Form insert_bdc
    Insert the BDC for the transaction
    FORM insert_bdc_new .
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    tcode = 'CA02'
    POST_LOCAL = NOVBLOCAL
    PRINTING = NOPRINT
    SIMUBATCH = ' '
    CTUPARAMS = ' '
    TABLES
    dynprotab = i_bdc_table
    EXCEPTIONS
    internal_error = 1
    not_open = 2
    queue_error = 3
    tcode_invalid = 4
    printing_invalid = 5
    posting_invalid = 6
    OTHERS = 7
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    CLEAR i_bdc_table[].
    ENDFORM. " insert_bdc
    *& Form close_bdc_session
    Close the session
    FORM close_bdc_session .
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
    not_open = 1
    queue_error = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM. " close_bdc_session
    *& Form f_load_input_file
    Load the data file
    FORM f_load_input_file.
    The data file is from Presentation server
    IF p_rloc1 = zc_yes.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    filename = p_fname1
    filetype = 'DAT'
    TABLES
    data_tab = i_rout
    EXCEPTIONS
    conversion_error = 1
    file_open_error = 2
    file_read_error = 3
    invalid_type = 4
    no_batch = 5
    unknown_error = 6
    invalid_table_width = 7
    gui_refuse_filetransfer = 8
    customer_error = 9
    OTHERS = 10.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    EXIT.
    ENDIF.
    ENDIF.
    ENDFORM. " f_load_input_file
    *& Form release_bdc
    Release BDC session
    FORM release_bdc.
    SUBMIT rsbdcsub WITH mappe EQ p_group
    WITH von EQ sy-datum
    WITH bis EQ sy-datum
    WITH fehler EQ '.'
    EXPORTING LIST TO MEMORY
    AND RETURN.
    ENDFORM.
    reward point if helpful.
    thanks
    mrutyun^

  • Af:query for master detail

    Hi Experts,
    Can we have an af:query to show master detail data ?
    What we generally have is af:query showing records of 1 table. What i want is for the records that get populated from af:query in the master table, i want to show the records in the detail table of the row selected
    any idea ?
    thnks

    Thank you NewBee. It worked and am able to get the detail information from the master table. I am struggling with another implementation. I have 3 radio buttons in the global template which I am referencing in all my pages.
    The template has 3 radio buttons. Contacts, Plans and Users. The three queries are completely different from one another.
    On click of Contacts, I should display the respective af:query for Contacts, Plans and Users without displaying the resultant table. This query panel will be global to all the pages.
    I have tried setting it as follows:
    <af:panelGroupLayout layout="vertical"
    id="pt_pgl3"
    rendered="#{baseBean.searchContactsSelected == 'true'}"
    visible="#{baseBean.searchContactsSelected == 'true'}">
    <af:query id="qryId1" headerText="Search" disclosed="true"
    value="#{bindings.GloablSearchByContactsVOCriteriaQuery.queryDescriptor}"
    model="#{bindings.GloablSearchByContactsVOCriteriaQuery.queryModel}"
    queryListener="#{bindings.GloablSearchByContactsVOCriteriaQuery.processQuery}"
    queryOperationListener="#{bindings.GloablSearchByContactsVOCriteriaQuery.processQueryOperation}"
    resultComponentId="::contactSearch:md1"/>
    <f:subview id="contactSearch">
    <jsp:include page="/contactsSearchResults.jspx"/>
    </f:subview>
    <af:panelGroupLayout>
    I have tried various implementations to the best of my knowledge but its not rendering. Is it possible to navigate to a different jspx on click of Search button of af:query. This will give me an opportunity to display different pages based on the Search action and keeping the search on a global level.
    Hope I was clear in explaining the issue
    Thanks!

  • Changes documents for BOM and Routing

    How Can I find the change documents for a BOM and routing?

    Change Documents For BOM
    CS80 - Material BOM
    CV80 - Document Structure
    IB80 - Equipment BOM
    IB81 - Functional Location BOM
    CS81 - Standard BOM
    CS82 - Order BOM
    CS83 - WBS BOM
    Change Documents for Routings
    CA60 - Task List Changes
    CA61 - Routing
    CA62 - Reference Operation Set
    CA63 - Rate Routing
    CA64 - Reference Rate Routing
    Hope the above may help you.

  • Query for Billable item form MTL_SYSTEM_ITEMS_B for BOM billing item

    Hi All,
    I want to write query to get billing item from mtl_system_items_b for BOM ...Can anyone give me the idea for accessing the billing item..
    In BOM
    Routings - Resources(form) - Billing Item (Field) and Outside Processing Item (Field)LOV...i Want to know query to access these items..
    Thanks
    Raman Sharma
    Edited by: 929841 on Apr 24, 2012 6:06 AM

    Obtain FRD log file to find out why the trigger is fired twice.
    R12: Forms Runtime Diagnostics (FRD), Tracing And Logging For Forms In Oracle Applications (Doc ID 438652.1)
    Steps To Take FRD Trace in 11.5.10 & R12 (Doc ID 867943.1)
    R12: How To Create An FRD (Forms Runtime Diagnostic) Log Using Forms 10g (Doc ID 445166.1)
    How To Collect And Use Forms Trace (FRD) in Oracle Applications Release 12 (Doc ID 373548.1)
    Thanks,
    Hussein

  • How to create sql query for item master with operator LIKE with variables?

    hi all,
    How to create sql query for item master with
    operator LIKE(Contains,Start With,End With) with variables using query generator in SAP B1 ?
    Jeyakanthan

    Hi Jeyakanthan,
    here is an example (put the like statement into the where field)
    SELECT T0.CardCode, T0.CardName FROM OITM T0 WHERE T0.CardName Like '%%test%%'
    The %% sign is a wildcard. If you need start with write 'test%%' and otherwise ends with '%%test'. For contains you need '%%test%%'. You also could combinate this statements like 'test%%abc%%'. This means starts with test and contains abc.
    Regards Steffen

  • Query for Inventory Account getting from Item Master

    Hi,
    I want to get Inventory Account from Item Master with the use of query.
    I used below query for that.
    SELECT T0.[ItemCode], T0.[BalInvntAc] FROM OITW
    but it's give me the blank value for the Inventory Account.
    Thanks & Regards,
    Tushar Nathwai

    Hi Gordon,
    It's a Inventory - Finished Products (TRG)
    But it's also not displayed in other database so what could be the reason for that?
    Thanks & Regards,
    Tushar Nathwani

  • Query for item master data

    hi all,
    i want to create a query for items in the item master data that shows the changed field, the old value, the new value, user name and the date it was changed .
    can anyone help please.
    ciao

    thanks for the reply
    my clients internal auditors require that they have Exception Reports in SAP , i.e reports that can show changes made, date and by which user etc...
    1. changes made to item master data
    2. changes made to business partner master data
    3. changes made to invoices, purchase orders etc..
    this reports can be set in query form or xl reporter..
    i tried but couldent find the tables ....
    any sugestion will be appriciated..

  • Fields for Super BOM, Work Center & Super Routing for Variant Config

    hi! gurus,
    Please can you give me mandatory fields & values for Super BOM, Work Center & Super Routing for Variant Config
    thank you

    Hi,
    In the Super BOM you need to maintain the object dependencies.
    Workcenter fields are as usual for other production processes.
    Also you can use search option in the forum to view the threads posted in the past. There are many posts related to variant configuration.
    Regards,
    Senthilkumar

  • MDM custom repository for BOM & Routing

    Anyone has done Custom MDM repository for Routing?.  If yes then could you please provide some information or documents about how the custom repository structure looks like?.  
    I have dome custom MDM repository for BOM.
    Thanks

    Hello,
    For custom development you can take the underlying database model as your reference
    You can refer the MDM Console guide which is available on
    http://www.service.sap.com/installmdm71
    regards,
    Abhishek

Maybe you are looking for