<?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: Full Sample code for CS_BOM_EXPL_MAT_V2? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/full-sample-code-for-cs-bom-expl-mat-v2/m-p/3637598#M876078</link>
    <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;how to link the IT_MATCAT and IT_STB2 tables?&lt;/P&gt;&lt;P&gt;what is the difference between material BOM and sales order BOM?&lt;/P&gt;&lt;P&gt;The BOM which we are extracting from FM which BOM is this either Material or Sales order?&lt;BR /&gt;If this is material BOM how we can extract the sales order BOM from CSKB transaction? &lt;/P&gt;</description>
    <pubDate>Thu, 22 Oct 2020 11:37:07 GMT</pubDate>
    <dc:creator>former_member652369</dc:creator>
    <dc:date>2020-10-22T11:37:07Z</dc:date>
    <item>
      <title>Full Sample code for CS_BOM_EXPL_MAT_V2?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/full-sample-code-for-cs-bom-expl-mat-v2/m-p/3637593#M876073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I need to get BoM simulating the transaction CS03.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's the parameters that I enter to CS03 selection screen to get the BoM that I need:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Material        0000030            &lt;/P&gt;&lt;P&gt;Plant           0101 &lt;/P&gt;&lt;P&gt;BOM usage       1  Production      &lt;/P&gt;&lt;P&gt;Alternative BOM 1                  &lt;/P&gt;&lt;P&gt;Valid from           04.04.2008  (sy-datum)&lt;/P&gt;&lt;P&gt;Valid to             04.04.2008   (sy-datum)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I'm trying to get the same result by code. But the FM doesn't return me a result. What I'm doing wrong? I've tried all the possible values of CAPID and always the result is "error material not found". Then, when I commented the field capid the result is "Error, BoM not found"...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my full abap code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : it_stb    like stpox occurs 0 with header line,&lt;/P&gt;&lt;P&gt;       it_matcat  like cscmat occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'CS_BOM_EXPL_MAT_V2'&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     capid                 = 'SD01'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      datuv                 = sy-datum&lt;/P&gt;&lt;P&gt;      mehrs                 = 'X'&lt;/P&gt;&lt;P&gt;      mtnrv                 = '0000030'&lt;/P&gt;&lt;P&gt;      werks                 = '0101'&lt;/P&gt;&lt;P&gt;    tables&lt;/P&gt;&lt;P&gt;      stb                   = it_stb&lt;/P&gt;&lt;P&gt;      matcat                = it_matcat&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;      alt_not_found         = 1&lt;/P&gt;&lt;P&gt;      call_invalid          = 2&lt;/P&gt;&lt;P&gt;      material_not_found    = 3&lt;/P&gt;&lt;P&gt;      missing_authorization = 4&lt;/P&gt;&lt;P&gt;      no_bom_found          = 5&lt;/P&gt;&lt;P&gt;      no_plant_data         = 6&lt;/P&gt;&lt;P&gt;      no_suitable_bom_found = 7&lt;/P&gt;&lt;P&gt;      others                = 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  WRITE: 'SY-SUBRC = ', sy-subrc.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 09:48:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/full-sample-code-for-cs-bom-expl-mat-v2/m-p/3637593#M876073</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T09:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Full Sample code for CS_BOM_EXPL_MAT_V2?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/full-sample-code-for-cs-bom-expl-mat-v2/m-p/3637594#M876074</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;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : it_stb2    like stpox occurs 0 with header line,
       it_spma2x like it_spma2 occurs 0 with header line,
       it_matcat  like cscmat occurs 0 with header line,
       it_dwl1    like it_dwl occurs 0 with header line,
 call function 'CS_BOM_EXPL_MAT_V2'
    exporting
      capid                 = 'PP01'
      datuv                 = sy-datum
      mktls                 = 'X'
      mehrs                 = 'X'
      mmory                 = '1'
      mtnrv                 = it_spma2-matnr
      werks                 = werks
    tables
      stb                   = it_stb2
      matcat                = it_matcat
    exceptions
      alt_not_found         = 1
      call_invalid          = 2
      material_not_found    = 3
      missing_authorization = 4
      no_bom_found          = 5
      no_plant_data         = 6
      no_suitable_bom_found = 7
      others                = 8.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if usefull&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 09:55:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/full-sample-code-for-cs-bom-expl-mat-v2/m-p/3637594#M876074</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T09:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Full Sample code for CS_BOM_EXPL_MAT_V2?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/full-sample-code-for-cs-bom-expl-mat-v2/m-p/3637595#M876075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try following code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CONSTANTS: lc_mehrs LIKE csdata-xfeld VALUE 'X',&lt;/P&gt;&lt;P&gt;             lc_capid LIKE t159l-capid  VALUE 'Z001'.&lt;/P&gt;&lt;P&gt;             gc_c1    TYPE mast-stlal   VALUE '1',&lt;/P&gt;&lt;P&gt;             gc_2     TYPE mast-stlan   VALUE '2',&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Call Function to Explode the BOM till Last Level&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        capid                 = lc_capid&lt;/P&gt;&lt;P&gt;        datuv                 = gv_datum&lt;/P&gt;&lt;P&gt;        mehrs                 = lc_mehrs&lt;/P&gt;&lt;P&gt;        mtnrv                 = gwa_bom-matnr&lt;/P&gt;&lt;P&gt;        stlal                 = gc_c1&lt;/P&gt;&lt;P&gt;        stlan                 = gc_2&lt;/P&gt;&lt;P&gt;        werks                 = space&lt;/P&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;        stb                   = git_stpox&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        alt_not_found         = 1&lt;/P&gt;&lt;P&gt;        call_invalid          = 2&lt;/P&gt;&lt;P&gt;        material_not_found    = 3&lt;/P&gt;&lt;P&gt;        missing_authorization = 4&lt;/P&gt;&lt;P&gt;        no_bom_found          = 5&lt;/P&gt;&lt;P&gt;        no_plant_data         = 6&lt;/P&gt;&lt;P&gt;        no_suitable_bom_found = 7&lt;/P&gt;&lt;P&gt;        conversion_error      = 8&lt;/P&gt;&lt;P&gt;        OTHERS                = 9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also try to pass the value of material &amp;amp; plant in a variable of appropriate type instead of hard coding the values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 10:04:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/full-sample-code-for-cs-bom-expl-mat-v2/m-p/3637595#M876075</guid>
      <dc:creator>rahul_kamble2</dc:creator>
      <dc:date>2008-04-04T10:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Full Sample code for CS_BOM_EXPL_MAT_V2?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/full-sample-code-for-cs-bom-expl-mat-v2/m-p/3637596#M876076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;actually u are not passing fields &lt;STRONG&gt;stlal&lt;/STRONG&gt; and &lt;STRONG&gt;stlan&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see samlpe code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;now to explode BOM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at p_it_header into wa_header .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call function 'CS_BOM_EXPL_MAT_V2'&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        capid                 = c_capid&lt;/P&gt;&lt;P&gt;        datuv                 = sy-datum&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       mehrs                 = c_x&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        mtnrv                 = wa_header-matnr&lt;/P&gt;&lt;P&gt;        stlal                 = wa_header-stlal&lt;/P&gt;&lt;P&gt;        stlan                 = wa_header-stlan&lt;/P&gt;&lt;P&gt;        werks                 = wa_header-werks&lt;/P&gt;&lt;P&gt;      tables&lt;/P&gt;&lt;P&gt;        stb                   = p_it_final&lt;/P&gt;&lt;P&gt;      exceptions&lt;/P&gt;&lt;P&gt;        alt_not_found         = 1&lt;/P&gt;&lt;P&gt;        call_invalid          = 2&lt;/P&gt;&lt;P&gt;        material_not_found    = 3&lt;/P&gt;&lt;P&gt;        missing_authorization = 4&lt;/P&gt;&lt;P&gt;        no_bom_found          = 5&lt;/P&gt;&lt;P&gt;        no_plant_data         = 6&lt;/P&gt;&lt;P&gt;        no_suitable_bom_found = 7&lt;/P&gt;&lt;P&gt;        conversion_error      = 8&lt;/P&gt;&lt;P&gt;        others                = 9.&lt;/P&gt;&lt;P&gt;    if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      message id sy-msgid type sy-msgty number sy-msgno&lt;/P&gt;&lt;P&gt;              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLZ REWARD IF HELPFUL&lt;/P&gt;&lt;P&gt;VIVEK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vivek Gaur on Apr 4, 2008 12:06 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 10:04:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/full-sample-code-for-cs-bom-expl-mat-v2/m-p/3637596#M876076</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T10:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Full Sample code for CS_BOM_EXPL_MAT_V2?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/full-sample-code-for-cs-bom-expl-mat-v2/m-p/3637597#M876077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;    Refer&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=10408074&amp;amp;messageID=4280820" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=10408074&amp;amp;messageID=4280820&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 10:13:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/full-sample-code-for-cs-bom-expl-mat-v2/m-p/3637597#M876077</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T10:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Full Sample code for CS_BOM_EXPL_MAT_V2?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/full-sample-code-for-cs-bom-expl-mat-v2/m-p/3637598#M876078</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;how to link the IT_MATCAT and IT_STB2 tables?&lt;/P&gt;&lt;P&gt;what is the difference between material BOM and sales order BOM?&lt;/P&gt;&lt;P&gt;The BOM which we are extracting from FM which BOM is this either Material or Sales order?&lt;BR /&gt;If this is material BOM how we can extract the sales order BOM from CSKB transaction? &lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 11:37:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/full-sample-code-for-cs-bom-expl-mat-v2/m-p/3637598#M876078</guid>
      <dc:creator>former_member652369</dc:creator>
      <dc:date>2020-10-22T11:37:07Z</dc:date>
    </item>
  </channel>
</rss>

