<?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 Update the BOM in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-bom/m-p/8457216#M1650061</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI ABAP Guru's,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to Update the BOM Using Below function Modules.&lt;/P&gt;&lt;P&gt;CSAP_MAT_BOM_OPEN  CSAP_BOM_ITEM_MAINTAIN CSAP_MAT_BOM_CLOSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Requremnet is For any components contains Issued storage location's  .. I need to delete that storage location.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it is not updating see the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please give me the Proper Reason why it is not get updated .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Afetr Maintain BOM I have tried with COMMIT statemnet also but helpless.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;call function 'CONVERSION_EXIT_PDATE_OUTPUT'
      exporting
        input  = sy-datum
      importing
        output = date.

*Enquee Exceptions
    call function 'CALO_INIT_API'
      exceptions
        log_object_not_found     = 1
        log_sub_object_not_found = 2
        others                   = 3.
    if sy-subrc &amp;lt;&amp;gt; 0.
      message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.

*BOM Open
    call function 'CSAP_MAT_BOM_OPEN'
      exporting
        material   = 'matnr'
        plant      = 'werks'
        bom_usage  = '1'
                valid_from = date
      importing
        o_stko     = gt_stko
        fl_warning = fl_warning
      tables
        t_stpo     = gt_stpo
      exceptions
        error      = 1
        others     = 2.
    
    
    loop at gt_stpo.
      gt_stpo-issue_loc = '  '.

*change BOM Contents
      call function 'CSAP_BOM_ITEM_MAINTAIN'
        exporting
          i_stpo     = gt_stpo
        importing
               fl_warning = fl_warning
        exceptions
          error      = 1
          others     = 2.
      if sy-subrc &amp;lt;&amp;gt; 0.
      commit work.
    endloop.

*Close BOM
    call function 'CSAP_MAT_BOM_CLOSE'
      exporting
        fl_commit_and_wait = ' X'
      importing
        fl_warning         = fl_warning
      exceptions
        error              = 1
        others             = 2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;&amp;lt;Thread unlocked, Urgency normalized&amp;gt;&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Edited by: kishan P on Jan 17, 2012 1:38 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kishan P on Jan 17, 2012 5:47 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Jan 2012 07:37:29 GMT</pubDate>
    <dc:creator>former_member298409</dc:creator>
    <dc:date>2012-01-17T07:37:29Z</dc:date>
    <item>
      <title>Update the BOM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-bom/m-p/8457216#M1650061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI ABAP Guru's,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to Update the BOM Using Below function Modules.&lt;/P&gt;&lt;P&gt;CSAP_MAT_BOM_OPEN  CSAP_BOM_ITEM_MAINTAIN CSAP_MAT_BOM_CLOSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Requremnet is For any components contains Issued storage location's  .. I need to delete that storage location.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it is not updating see the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please give me the Proper Reason why it is not get updated .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Afetr Maintain BOM I have tried with COMMIT statemnet also but helpless.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;call function 'CONVERSION_EXIT_PDATE_OUTPUT'
      exporting
        input  = sy-datum
      importing
        output = date.

*Enquee Exceptions
    call function 'CALO_INIT_API'
      exceptions
        log_object_not_found     = 1
        log_sub_object_not_found = 2
        others                   = 3.
    if sy-subrc &amp;lt;&amp;gt; 0.
      message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.

*BOM Open
    call function 'CSAP_MAT_BOM_OPEN'
      exporting
        material   = 'matnr'
        plant      = 'werks'
        bom_usage  = '1'
                valid_from = date
      importing
        o_stko     = gt_stko
        fl_warning = fl_warning
      tables
        t_stpo     = gt_stpo
      exceptions
        error      = 1
        others     = 2.
    
    
    loop at gt_stpo.
      gt_stpo-issue_loc = '  '.

*change BOM Contents
      call function 'CSAP_BOM_ITEM_MAINTAIN'
        exporting
          i_stpo     = gt_stpo
        importing
               fl_warning = fl_warning
        exceptions
          error      = 1
          others     = 2.
      if sy-subrc &amp;lt;&amp;gt; 0.
      commit work.
    endloop.

*Close BOM
    call function 'CSAP_MAT_BOM_CLOSE'
      exporting
        fl_commit_and_wait = ' X'
      importing
        fl_warning         = fl_warning
      exceptions
        error              = 1
        others             = 2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;&amp;lt;Thread unlocked, Urgency normalized&amp;gt;&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Edited by: kishan P on Jan 17, 2012 1:38 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kishan P on Jan 17, 2012 5:47 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2012 07:37:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-bom/m-p/8457216#M1650061</guid>
      <dc:creator>former_member298409</dc:creator>
      <dc:date>2012-01-17T07:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Update the BOM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-bom/m-p/8457217#M1650062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you check the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; call function 'CALO_INIT_API'&lt;/P&gt;&lt;P&gt;        exceptions&lt;/P&gt;&lt;P&gt;             log_object_not_found     = 1&lt;/P&gt;&lt;P&gt;             log_sub_object_not_found = 2&lt;/P&gt;&lt;P&gt;             other_error              = 3&lt;/P&gt;&lt;P&gt;             others                   = 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data v_datun type CSAP_MBOM-DATUV.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   DATE_INTERNAL                  = SY-DATUM&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   DATE_EXTERNAL                  = v_datun.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Eröffnen der Stückliste für Änderungen&lt;/P&gt;&lt;P&gt;   call function 'CSAP_MAT_BOM_OPEN'&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;             material   = 'CG0012'&lt;/P&gt;&lt;P&gt;             plant      = '0002'&lt;/P&gt;&lt;P&gt;             bom_usage  = '1'&lt;/P&gt;&lt;P&gt;            valid_from =  v_datun&lt;/P&gt;&lt;P&gt;            ALTERNATIVE = '03'&lt;/P&gt;&lt;P&gt;        importing&lt;/P&gt;&lt;P&gt;             o_stko     = tstk2&lt;/P&gt;&lt;P&gt;             fl_warning = flg_warning&lt;/P&gt;&lt;P&gt;        tables&lt;/P&gt;&lt;P&gt;             t_stpo     = tstp2&lt;/P&gt;&lt;P&gt;        exceptions&lt;/P&gt;&lt;P&gt;             error      = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   clear: tdep2_data,&lt;/P&gt;&lt;P&gt;          tdep2_source,&lt;/P&gt;&lt;P&gt;          tdep2_descr,&lt;/P&gt;&lt;P&gt;          tdep2_order,&lt;/P&gt;&lt;P&gt;          tdep2_doc.&lt;/P&gt;&lt;P&gt;   refresh: tdep2_data,&lt;/P&gt;&lt;P&gt;            tdep2_source,&lt;/P&gt;&lt;P&gt;            tdep2_descr,&lt;/P&gt;&lt;P&gt;            tdep2_order,&lt;/P&gt;&lt;P&gt;            tdep2_doc.&lt;/P&gt;&lt;P&gt;data v_date type char10  .&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   DATE_INTERNAL                  = SY-DATUM&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   DATE_EXTERNAL                  = v_date&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DATE_INTERNAL_IS_INVALID       = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OTHERS                         = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   loop at tstp2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if tstp2-COMPONENT = '61065A'.&lt;/P&gt;&lt;P&gt;   tstp2-FLDELETE   = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     tstp2-CHANGED_BY = SY-UNAME.&lt;/P&gt;&lt;P&gt;        modify  tstp2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;clear   tstp2.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   perform item_maintain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   call function 'CSAP_MAT_BOM_CLOSE'&lt;/P&gt;&lt;P&gt;         importing&lt;/P&gt;&lt;P&gt;              fl_warning = flg_warning&lt;/P&gt;&lt;P&gt;         exceptions&lt;/P&gt;&lt;P&gt;              error   = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Unterroutine&lt;/P&gt;&lt;P&gt;   Form item_maintain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      call function 'CSAP_BOM_ITEM_MAINTAIN'&lt;/P&gt;&lt;P&gt;           exporting&lt;/P&gt;&lt;P&gt;           i_stpo            = tstp2&lt;/P&gt;&lt;P&gt;           importing&lt;/P&gt;&lt;P&gt;                fl_warning           = flg_warning&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          tables&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               t_dep_data   =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               t_dep_descr  =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               t_dep_order  =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               t_dep_source = tdep2_source&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               t_dep_doc    =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            exceptions&lt;/P&gt;&lt;P&gt;             error        =      1&lt;/P&gt;&lt;P&gt;             others            = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2012 12:48:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-bom/m-p/8457217#M1650062</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-17T12:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Update the BOM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-bom/m-p/8457218#M1650063</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;thank you for you reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is working for deletion of componenet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But my reqiremnet waas delete the Default storage location 's .. I hope this is not possible because i have chenged the stpo sturcrure value issu_loc = ''        .. but the FM:CSAP_BOM_ITEM_MAINTAIN gaing going back to stpo table and aging it is putting the storage location value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i am directlu updating data base table like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;update stpo set   lgort = ' '&lt;/P&gt;&lt;P&gt;                  where stlnr = gt_stko-bom_no and&lt;/P&gt;&lt;P&gt;                        idnrk = gt_stpo-component and&lt;/P&gt;&lt;P&gt;                        posnr = gt_stpo-item_no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any body tell me is there any another way to achive that.. i know directly updating the data base table is wrong way ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;kandulaw's&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2012 07:55:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-bom/m-p/8457218#M1650063</guid>
      <dc:creator>former_member298409</dc:creator>
      <dc:date>2012-01-19T07:55:40Z</dc:date>
    </item>
  </channel>
</rss>

