<?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: bom tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723054#M1108933</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;STPO          BOM Item Details&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;STPU          BOM Sub Items (designators)&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;STKO         BOM Header Details&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MAST         BOM Group to Material&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Oct 2008 04:23:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-31T04:23:03Z</dc:date>
    <item>
      <title>bom tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723051#M1108930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi from sales i taken material number, and i put that material number in trcode : cs12 i will get the purchase order material data , in wish table this was stored. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can u help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;search before further posting&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2008 04:12:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723051#M1108930</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-31T04:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: bom tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723052#M1108931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check tables : STKO and STPO.&lt;/P&gt;&lt;P&gt;Check FM: CSAP_MAT_BOM_READ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Navneeth K.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2008 04:14:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723052#M1108931</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-31T04:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: bom tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723053#M1108932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check these tables .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KONV, OIC_KONV, JKONV, COMPHDR, AFKO, VSAFKO_CN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2008 04:19:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723053#M1108932</guid>
      <dc:creator>former_member125931</dc:creator>
      <dc:date>2008-10-31T04:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: bom tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723054#M1108933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;STPO          BOM Item Details&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;STPU          BOM Sub Items (designators)&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;STKO         BOM Header Details&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MAST         BOM Group to Material&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2008 04:23:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723054#M1108933</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-31T04:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: bom tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723055#M1108934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , &lt;/P&gt;&lt;P&gt;        For Fetching the BOM Details you can go like this which would fetch you the BOM DETAILS ... &lt;/P&gt;&lt;P&gt;Your First Selection is From AFKO which is the Production order header table ... From Afko you will get the following fields &lt;/P&gt;&lt;P&gt;AFKO-PLNBEZ&lt;/P&gt;&lt;P&gt;AFKO-STLNR &lt;/P&gt;&lt;P&gt;Then go to MAST from the details of AFKO .&lt;/P&gt;&lt;P&gt;In MAST you have to pass the MATNR AND WERKS AND STLAN AND STLNR &lt;/P&gt;&lt;P&gt;STLAN will give you the Bom is of which kind whether is a Production Bom or Sales Bom or its a Universal Bom  . 1 is for Production Bom and 5 is for Sales Bom.... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then Goto STPO from these details from MAST ..&lt;/P&gt;&lt;P&gt; You will get the BOM Components .... &lt;/P&gt;&lt;P&gt;Hope this will help you &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES OF BOM : &lt;/P&gt;&lt;P&gt;STPO BOM Item Details &lt;/P&gt;&lt;P&gt;STPU BOM Sub Items (designators) &lt;/P&gt;&lt;P&gt;STKO BOM Header Details &lt;/P&gt;&lt;P&gt;MAST BOM Group to Material&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2008 04:37:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723055#M1108934</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-31T04:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: bom tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723056#M1108935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   Finding table name and field name is not a big problem just press f1 on the field and select technical settings there you will get the table name and fieldname where that particular field is stored..&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;'ThiruKumaran. R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2008 04:58:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723056#M1108935</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-31T04:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: bom tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723057#M1108936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;

This is Fm code...Make necessary modifications and use it.
This will give you the multilevel bom....without Qty...Add the qty logic in the routine get_below_comp 


TYPES:BEGIN OF ty_push,
      matnr TYPE mara-matnr,
      END OF ty_push.
TYPES:BEGIN OF ty_store,
      pmatnr TYPE mara-matnr,
      cmatnr TYPE mara-matnr,
      END OF ty_store.
TYPES:BEGIN OF ty_push2,
      pmatnr TYPE mara-matnr,
      cmatnr TYPE mara-matnr,
      pmaktx TYPE makt-maktx,
      cmaktx TYPE makt-maktx,
      END OF ty_push2.

DATA:t_push        TYPE STANDARD TABLE OF ty_push    INITIAL SIZE 0.
DATA:t_push_temp   TYPE STANDARD TABLE OF ty_push    INITIAL SIZE 0.
DATA:t_sb_push     TYPE STANDARD TABLE OF ty_push2   INITIAL SIZE 0.
DATA:t_makt        TYPE STANDARD TABLE OF makt       INITIAL SIZE 0.
DATA:t_stpo        TYPE STANDARD TABLE OF stpo_api02 INITIAL SIZE 0.
DATA:T_STPU	   TYPE STANDARD TABLE OF STPU_API01 INITIAL SIZE 0.

DATA:wa_matnr   TYPE ty_push.
DATA:wa_push    TYPE ty_push.
DATA:wa_tmp     TYPE ty_push.
DATA:wa_sb_push TYPE ty_push2.
DATA:wa_makt    TYPE makt.
DATA:wa_stpo    TYPE stpo_api02.
DATA:wa_return  TYPE bapireturn1.
data:wa_stpu    type STPU_API01.


DATA:g_plant TYPE marc-werks.
DATA:g_usage TYPE stlan.
data:g_lines type sy-tfill.



*Initializle Global itabs and work areas.
  PERFORM   init_globals.

  MOVE   plant       TO g_plant.
  MOVE   bom_usage   TO g_usage.

*Select Parts from Masters
  SELECT mara~matnr   INTO wa_matnr
         FROM mara INNER JOIN marc
         ON mara~matnr EQ marc~matnr
         WHERE  matnr = 'Enter your material no here'
	 AND mara~mtart   EQ 'FERT'  "Finished Goods
         AND mara~lvorm     EQ space     "Deletion Indicator
         AND marc~werks     EQ g_plant   "Plant Data
         AND marc~lvorm     EQ space.    "Deletion Indicator

    CHECK sy-subrc   EQ 0.

    MOVE   wa_matnr-matnr   TO wa_push-matnr.
    APPEND   wa_push   TO t_push.
*Explode Bill of Material matrix
    PERFORM   get_below_comp.
  ENDSELECT.

  IF  t_sb_push[]   IS NOT INITIAL.
*Get Parent and Child Texts
    PERFORM   get_material_texts.
    IF t_makt[]   IS NOT INITIAL.
      SORT t_makt[]   BY matnr ASCENDING.
      LOOP AT   t_sb_push[] INTO wa_sb_push WHERE pmaktx EQ space.
        READ TABLE   t_makt[] INTO wa_makt WITH KEY matnr = wa_sb_push-pmatnr
                                         BINARY SEARCH
                                         TRANSPORTING maktx.
        CHECK   sy-subrc EQ 0.
        MOVE wa_makt-maktx   TO   wa_sb_push-pmaktx.
        MODIFY   t_sb_push[] FROM   wa_sb_push
                             TRANSPORTING   pmaktx
                                WHERE   pmatnr EQ   wa_sb_push-pmatnr.
        CLEAR wa_sb_push.
      ENDLOOP.
      LOOP AT t_sb_push[]   INTO wa_sb_push   WHERE cmaktx EQ space.
        READ TABLE t_makt[] INTO wa_makt   WITH KEY matnr = wa_sb_push-cmatnr
                                                BINARY SEARCH
                                                TRANSPORTING maktx.
        CHECK sy-subrc EQ 0.
        MOVE   wa_makt-maktx   TO wa_sb_push-cmaktx.
        MODIFY   t_sb_push[]   FROM wa_sb_push
                           TRANSPORTING cmaktx
                                WHERE cmatnr EQ wa_sb_push-cmatnr.
        CLEAR wa_sb_push.
      ENDLOOP.

    ENDIF.

    SORT t_sb_push[] BY pmatnr ASCENDING.


****t_sb_push[] holds the data

***********************************************************************************

form INIT_GLOBALS .

REFRESH: T_PUSH,
         T_PUSH_TEMP,
         T_SB_PUSH,
         T_MAKT,
         T_STPO.
CLEAR:   wa_matnr,
         WA_PUSH,
         WA_TMP,
         WA_SB_PUSH,
         WA_MAKT,
         WA_STPO,
         G_PLANT,
         G_USAGE.
endform.  

FORM get_material_texts .

  SELECT * FROM makt INTO TABLE t_makt  FOR ALL ENTRIES IN
  t_sb_push[] WHERE matnr = t_sb_push-pmatnr.

  SELECT * FROM makt APPENDING TABLE t_makt  FOR ALL ENTRIES IN
  t_sb_push[] WHERE matnr = t_sb_push-cmatnr.

ENDFORM.                    " GET_MATERIAL_TEXTS


FORM get_below_comp .

  DESCRIBE TABLE t_push[] lines g_lines.
  IF g_lines EQ 0.
    EXIT.
  ENDIF.

  LOOP AT t_push[] INTO wa_push.

    CALL FUNCTION 'CSAP_MAT_BOM_READ'
      EXPORTING
        material  = wa_push-matnr
        plant     = g_plant
        bom_usage = g_usage
      TABLES
        t_stpo    = t_stpo
        t_stpu    = t_stpu
      EXCEPTIONS
        error     = 1
        OTHERS    = 2.

    IF t_stpo[] IS NOT INITIAL.

      LOOP AT t_stpo INTO wa_stpo.

        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = wa_push-matnr
          IMPORTING
            output = wa_sb_push-pmatnr.

        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = wa_stpo-component
          IMPORTING
            output = wa_sb_push-cmatnr.

        APPEND wa_sb_push TO t_sb_push.

        MOVE wa_stpo-component TO wa_tmp-matnr.

        APPEND wa_tmp TO t_push_temp[].

      ENDLOOP.

      REFRESH t_stpo[].

    ENDIF.

  ENDLOOP.

  t_push[] = t_push_temp[].

  REFRESH t_push_temp[].

  PERFORM get_below_comp.                   "Recursive Call

ENDFORM.                    " GET_BELOW_COMP


&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2008 06:54:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723057#M1108936</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2008-10-31T06:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: bom tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723058#M1108937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could use the standard transaction CAVC_TEST. There you would get all the Function modules related to BOM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nidhi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2008 06:59:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723058#M1108937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-31T06:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: bom tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723059#M1108938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my qustion is answered thanks to all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 09:07:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bom-tables/m-p/4723059#M1108938</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T09:07:53Z</dc:date>
    </item>
  </channel>
</rss>

