cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a function to show all raw materials used in BOMs at one plant?

0 Kudos

I am looking for a master list of all raw materials used across all of the BOMs in my plant for organization purposes. What is the best way to go about this?

jerryjanda
Community Manager
Community Manager
0 Kudos

Hi, Peter:

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers (if you haven't already), as it provides tips for preparing questions that draw responses from our members.

Should you wish, you can revise your question by selecting Actions, then Edit (although once someone answers your question, you'll lose the ability to edit the question -- but if that happens, you can leave more details in a comment).

Finally, if you're hoping to connect with readers, please consider adding a picture to your profile. Here's how you do it: https://www.youtube.com/watch?v=F5JdUbyjfMA&list=PLpQebylHrdh5s3gwy-h6RtymfDpoz3vDS. By personalizing your profile with a photo of you, you encourage readers to respond.

Kind regards,

--Jerry

Accepted Solutions (0)

Answers (1)

Answers (1)

Abinathsiva
Active Contributor
0 Kudos

Hi,

try the function module given below

      LOOP AT it_mast_t INTO wa_mast_t.
          CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
            EXPORTING
              capid                 = 'PP01'
              datuv                 = sy-datum
              mktls                 = 'X'
              mehrs                 = 'X'
              mmory                 = '1'
              mtnrv                 = wa_mast_t-matnr
              werks                 = wa_mast_t-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.

          IF it_stb2[] IS NOT INITIAL.
            LOOP AT it_stb2 INTO wa_stb2.
              CLEAR wa_mast_f.
              MOVE-CORRESPONDING wa_stb2 TO wa_mast_f.
              IF wa_mast_t-stlnr EQ wa_mast_f-stlnr.
                MOVE : wa_mast_t-matnr TO wa_mast_f-matnr.
              ENDIF.
              APPEND wa_mast_f TO it_mast_f.
              ENDLOOP.
          ENDIF.
          SORT it_mast_f.
        ENDLOOP.