Where Used List

Of

Raw Materials



Target readers

Sap ABAP Consultants, SAP Functional Consultants



Keywords

SAP ABAP, SAP SD.



Table of Contents

  1. Introduction 
  2. Requirement
    • Report Screens & Output

  3. Selection Logic

  4. BOM explosion

  5. Display Report Output



1. Introduction

The Raw Material Where Used List is a report which was conceptualized from the requirements arising out of many clients wherein it is needed to find out all the finished products or semi-finished products, in which a particular raw material is used.

In Standard SAP system, transaction CS15 is available for the same but CS15 can be used for reporting the data only for one material at a time.

Standard SAP system doesn’t provide any transaction which can be executed for a selection of materials or for an entire plant.

After reading this document, one can create a report which will be used for multiple materials or entire plant to find out all the finished products or semi-finished products.

This document provides a conceptual understanding for functional as well as for technical.


2. Requirement

The business requirement is to generate a list of finished or semi-finished goods in which a particular raw material has been used along with the quantity used. This report is reading the bill of materials (BOM) for the finished or semi-finished products to generate the report. Addition thing is, the multi-level BOM is read for the materials as well.


In this section, a sample of report screens and report output is shown.

    • Selection Screen

            Selection Screen.PNG

    • Report Output

        Report Output.png

This report development has three different sections:


    • First part, the selection logic has to be implemented that talks about how all the relevant master data details(to be used for report) will be fetched.
    • The second part of the logic involves exploding the bill of materials for all finished or semi-finished goods to read the raw materials in there and their respective quantities.     
    • Third part of the logic to display report showing Where Used List of Raw Material.


3. Selection Logic

In this part of the program, a list of finished and semi-finished goods is prepared for which the BOM explosion will be done.


         This list is prepared using two sets of logic as given below:         

    • When a material code is entered on the selection screen by the User
    • Material code has not been entered on the selection screen and user wants to execute the report at a plant


        CASE I – Material Code entered on the selection screen

        

When a material code is entered on the selection screen by the User. Check if this material is a purchased material i.e. procurement type F. If yes, then follow the logic given in the below flow chart.

         Selection Logic.PNG

As per above logic, first BOM is selected from Table STPO for all the material numbers entered on selection screen as shown in snapshot below. If BOM is found, then material number and Plant is fetched for all BOM numbers from table MAST.

      STPO Query BOM Item.PNG

In the above Select Query on STPO table, all the BOM’s are collected into internal table it_material for further usage.

Once all the BOM’s are collected, then get all the material and Plants for these BOM’s from MAST table(Material to BOM Link).

       MAST Material to BOM.PNG

    

         CASE II – Material Code Not Entered On the selection screen


In case a material code is not entered on the selection screen and user wants to execute the report at a plant level, then read all active materials with procurement types E & X from table MARC to create a list of finished or semi-finished goods for the plant.

        

Procurement Type:

‘E’ = In-house production.

‘F’ = External procurement

‘X’ = Both procurement types


         MARC Select.PNG

As per logic, If material number is not entered, the get the material number and plant from table MARC for procurement type (BESKZ) = ‘E’ or ‘X’.

The materials collected into the internal tables are further used to get the BOM herarchy for the materials.

       MARC Select Query.PNG

4. BOM explosion (exploding the bill of materials)

This section of the development is used to find out the components of the finished good or semi-finished material along with respective quantities. It has to be ensured in this step that the raw materials at all levels of BOM (in case of multi-level BOMs) have been enlisted and the quantities have been calculated accordingly.


Logic as per below flow diagram should be followed. But there is another option of using Standard Function Module which is explained in below steps. We have given the overview of the logic in the flowchart which can be used but generally the standard function module mentioned below will be used.


         BOM Explosion Logic.PNG

All this logic can also be implemented using a standard SAP function module “CS_BOM_EXPL_MAT_V2”.


In order to find out the components of the finished good or semi-finished material, SAP standard function Module “CS_BOM_EXPL_MAT_V2″ is used.

Function BOM.PNG


The above FM is called in each loop pass for each material to retrieve the hierarchy levels of BOM for the materials.

To fetch the BOM level, few parameters which are required as input are:


               1.) Calculate scrap quantity (AUMGB) as Blank.

               2.) Application ID (CAPID) as ‘PP01’.

               3.) Validity date as (DATUV) as sy-datum.

               4.) EHNDL as ‘1’.

               5.) Required quantity (EMENG) as ‘Qty entered in selection screen’.

               6.) Multi-level explosion (MEHRA) as ‘X’.

               7.) Memory use (MMORY) as ‘1’.

               8.) Material (MTNRV) as ‘Material number’

               9.) Plant (WERKS) as ‘Plant’.


After this FM is called the hierarchy for BOM Levels is stored into a table.

After fetching the hierarchy of the BOM Levels for each material the quantities for the same materials in the hierarchy

should be summed up as shown in Snapshot below:


BOM Loop Logic.PNG

5. Display BOM Explosion Report

    

In the display section the output data is formatted into a report as per the requirements. Principally the report

should be formatted on the raw material code column. An error log also needs to be collected for all issues with

the master data.


Below is the snapshot showing the RAW MATERIAL Where Used List:

Final Raw Material List.PNG

Raw Material 599998 T has four levels with different finished goods such as 599994 TEST Level 4, 599995 TEST

Level 3, 599996 TEST Level 2, and 599997 TEST Level 1. Each Level has specified Quantity with it.


There is an Error Log which contains those records (materials) which have Procurement Type as ‘E’ or ‘X’ when

material is already entered in the Selection Screen.



To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply