Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

FM For Finding if Material BOM exits for BOM component.

Hi,

Is there any FM or BAPI to find out if there is any material BOM exists for the BOM component.

How is Indicator assembly get assighned..?

Any inputs would be appreciated.

Thanks,

Mark

Tags:
Former Member
replied

Sample program.


report zrich_0001 .

* Internal Tables
data: i_stpov like stpov occurs 0 with header line.

parameters: p_matnr type marc-matnr,
            p_werks type marc-werks.

start-of-selection.

perform where_used tables i_stpov
                   using p_matnr
                         p_werks.

loop at i_stpov.
  write:/ i_stpov-matnr, i_stpov-werks.
endloop.


************************************************************************
*  FORM WHERE_USED.
************************************************************************
form where_used tables itab
                using  matnr
                       werks.

  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                      = matnr
            postp                      = ' '
            stlan                      = ' '
            werks                      = werks
            stltp                      = ' '
       importing
            topmat                     = selpool  "Not Currently Used
       tables
            wultb                      = itab
            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.

endform.

Regards,

Rich Heilman

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question