Skip to Content
0
Jan 17, 2012 at 07:37 AM

Update the BOM

916 Views

HI ABAP Guru's,

How to Update the BOM Using Below function Modules.

CSAP_MAT_BOM_OPEN CSAP_BOM_ITEM_MAINTAIN CSAP_MAT_BOM_CLOSE.

My Requremnet is For any components contains Issued storage location's .. I need to delete that storage location.

But it is not updating see the below code.

Can you please give me the Proper Reason why it is not get updated .

Afetr Maintain BOM I have tried with COMMIT statemnet also but helpless.

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 <> 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 <> 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.

Thanks in advance,

<<Thread unlocked, Urgency normalized>>

Edited by: kishan P on Jan 17, 2012 1:38 PM

Edited by: kishan P on Jan 17, 2012 5:47 PM