<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Finding BOM header material from component item in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-bom-header-material-from-component-item/m-p/5054089#M1174750</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or you could use this function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: selpool like mc29s.
  data: eqpcat  like cscequi occurs 0.
  data: kndcat  like cscknd  occurs 0.
  data: matcat  like cscmat  occurs 0.
  data: prjcat  like cscprj  occurs 0.
  data: stdcat  like cscstd  occurs 0.
  data: tplcat  like csctpl  occurs 0.

  clear itab. refresh itab.
  call function 'CS_WHERE_USED_MAT'
       exporting
            datub                      = sy-datum
            datuv                      = sy-datum
            matnr                      = lv_matnr
            postp                      = ' '
            stlan                      = ' '
            werks                      = lv_werks
            stltp                      = ' '
       importing
            topmat                     = selpool  "Not Currently Used
       tables
            wultb                      = itab  "Contains the where-used records
            equicat                    = eqpcat  "Not Currently Used
            kndcat                     = kndcat  "Not Currently Used
            matcat                     = matcat  "Not Currently Used
            stdcat                     = stdcat  "Not Currently Used
            tplcat                     = tplcat  "Not Currently Used
            prjcat                     = prjcat  "Not Currently Used
       exceptions
            material_not_found         = 02
            no_where_used_rec_found    = 03
            no_where_used_rec_selected = 04
            no_where_used_rec_valid    = 05.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Jan 2009 19:09:36 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2009-01-15T19:09:36Z</dc:date>
    <item>
      <title>Finding BOM header material from component item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-bom-header-material-from-component-item/m-p/5054086#M1174747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I am given a material component of a BOM, how can I then get the BOM header material.  For instance Part 123 is the BOM header material and it contains one component which is part ABC.  If I know part ABC, how do I then pull in Part 123 into my program?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2009 18:20:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-bom-header-material-from-component-item/m-p/5054086#M1174747</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-15T18:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Finding BOM header material from component item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-bom-header-material-from-component-item/m-p/5054087#M1174748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , &lt;/P&gt;&lt;P&gt;  I have a conern regarding your requiremnet , as a material can be used in a number of BOM , so the material ABC can be in more than one BOM , so what exactly is your requirement to get all the materisl which have the material ABC as a component in the bom ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2009 19:01:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-bom-header-material-from-component-item/m-p/5054087#M1174748</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-15T19:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Finding BOM header material from component item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-bom-header-material-from-component-item/m-p/5054088#M1174749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's right, the component can be used in more than one BOM, so you have to take that into account. But any way, you would need to get the internal BOM number from STPO where you find your ABC material in field IDNRK.  Then use this internal BOM number and select against, the MAST table.  This MAST table will give you the parent material and plant.  So you may need to use STKO as well to get some of other field values to use to narrow your search against MAST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2009 19:05:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-bom-header-material-from-component-item/m-p/5054088#M1174749</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2009-01-15T19:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Finding BOM header material from component item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-bom-header-material-from-component-item/m-p/5054089#M1174750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or you could use this function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: selpool like mc29s.
  data: eqpcat  like cscequi occurs 0.
  data: kndcat  like cscknd  occurs 0.
  data: matcat  like cscmat  occurs 0.
  data: prjcat  like cscprj  occurs 0.
  data: stdcat  like cscstd  occurs 0.
  data: tplcat  like csctpl  occurs 0.

  clear itab. refresh itab.
  call function 'CS_WHERE_USED_MAT'
       exporting
            datub                      = sy-datum
            datuv                      = sy-datum
            matnr                      = lv_matnr
            postp                      = ' '
            stlan                      = ' '
            werks                      = lv_werks
            stltp                      = ' '
       importing
            topmat                     = selpool  "Not Currently Used
       tables
            wultb                      = itab  "Contains the where-used records
            equicat                    = eqpcat  "Not Currently Used
            kndcat                     = kndcat  "Not Currently Used
            matcat                     = matcat  "Not Currently Used
            stdcat                     = stdcat  "Not Currently Used
            tplcat                     = tplcat  "Not Currently Used
            prjcat                     = prjcat  "Not Currently Used
       exceptions
            material_not_found         = 02
            no_where_used_rec_found    = 03
            no_where_used_rec_selected = 04
            no_where_used_rec_valid    = 05.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2009 19:09:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-bom-header-material-from-component-item/m-p/5054089#M1174750</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2009-01-15T19:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Finding BOM header material from component item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-bom-header-material-from-component-item/m-p/5054090#M1174751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Give the material component in the field IDNRK ( component) in the table STPO&lt;/P&gt;&lt;P&gt;              BOM category ( STLTY) = M   and then you will get BOM ( STLNR ) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give this STLNR  to table MAST and find header material in matnr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single stlnr from stpo into stpo-stlnr where idnrk = p_component&lt;/P&gt;&lt;P&gt;                                                                          and stlty = 'M' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0&lt;/P&gt;&lt;P&gt;select single matnr from mast into mast-matnr where stlnr = stpo-stlnr.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mast-matnr is the bom header material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there are multiple BOM's for the given component, then you will have to specify more conditions in the where clause.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2009 19:11:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-bom-header-material-from-component-item/m-p/5054090#M1174751</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-15T19:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Finding BOM header material from component item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-bom-header-material-from-component-item/m-p/5054091#M1174752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much to all of you for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2009 20:04:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-bom-header-material-from-component-item/m-p/5054091#M1174752</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-15T20:04:08Z</dc:date>
    </item>
  </channel>
</rss>

