The purpose of this document is to explore the relationship materials management has with accounting in SAP. We will take three swipes at this relationship. First, at an overview level, we will consider a materials management workflow scenario. Next, we will dig deeper as we create documents to support that scenario, and consider the account postings made. Finally, we will consider configuration, and show how SAP automatically posted to various accounts.

A Materials Management Workflow Scenario

Lets consider the following map :

Starting from the top box, we see that a purchase requisition is created. This can be entered manually (as in the case if a secretary wants to order office supplies), or automatically via MRP (through Materials Requirements Planning, where material requirements are generated based on satisfying customer orders, production lines, and other needs). A purchase requisition would contain information about :

1. What is being requisitioned? material / service

2. How much? quantity

3. When is it needed? delivery date

4. Where will it be delivered? plant, storage location

5. How will it be used? item category

6. How will it be paid for? account assignment category - this may also state how the material/service will be used, as the account assignment may be a sales or production order(for example).

A P.Req. may have to go through a release procedure in order to be converted into a purchase order. At this point, suffice it to say that SAP has ensured that employees do not get to acquire materials just because they have nice smiles.

Next, it is up to purchasing to determine a vendor for this requisition. In SAP, the purchasing department has several options : source lists, purchasing info records (material-vendor records), quota arrangements, and vendor master records. A vendor may also be selected based on price quotations attained by the purchasing department.

A purchase order may now be created. Note : in the standard configuration, a purchase requisition is not required in order to create a purchase order. The same information entered in the purchase requisition is entered in a purchase order (note items 1 through 6), plus a purchase order would have a specified vendor.

Purchase order follow-up depends on the purchasing organization. In some organizations, confirmation of a received PO is required. The confirmation could then be a signal to the receiving dock to expect goods on a certain date. Follow-up might include further negotiation, such as price, quantity, or delivery date changes.

A goods receipt for the purchase order is now entered. In the standard configuration, a goods receipt does not require a PO, or any other type of order. With valuated materials, a goods receipt will now cause an account entry. This account entry will typically be against a stock (or production/sales order) account and a clearing account. More about this later. Note that to the side, goods issues and transfer postings are shown. These are also functions of a warehouse, and both can cause account postings. It is important to understand which goods movements will affect accounting and how.

Often an invoice will be received with the goods shipment, but it can be received independently. Invoice verification is the process of determining whether an invoice matches what was received. In SAP, invoices can be entered either from materials management or from the accounts payable side. Most of us would hold that it is up to A/P to enter the invoice, but who better to verify the invoice against the goods shipment and quality than MM? This issue is up to the company and project team installing SAP. The account entries made upon invoice receipt will typically be against the clearing account posted when the goods received and the vendors account (indicating that the vendor should be paid). The invoice may be blocked for payment for various reasons (e.g.invoiced too early, wrong quantity), but even blocked invoices can cause account postings in SAP.

The invoice can now be paid. Invoice payment is done by A/P, outside of MM. This is done by means of payment programs where A/P clerks have the ability to select which vendors to pay, the means of payment, and whether or not to block payment (based on subsequent QI, or poor relations with the vendor). The account postings for payment are typically against the vendors account (signifying that payment is being received) and against cash (or a bank account).

The Documents

The purpose of this section is to show account postings which relate to documents created from materials management. This will include the creation of the following documents :

1. Purchase requisition

2. Purchase order

3. Goods receipt

4. Vendor invoice

Note that RFQs and quotations will not be considered. This is because neither of these documents has an account assignment category. Their only relevance to accounting is that they specify a material (and thus a material type), and the quotation specifies a vendor and a price. With no account assignment category, however, there is no specification as to who will pay for the ultimate purchase.

The purchase requisition

The purchase requisition is created through transaction ME51 (Log > MM > Purch > Req. > Create). As mentioned, the following are determined in a purchase requisition :

1. What is being requisitioned? material / service

2. How much? quantity

3. When is it needed? delivery date

4. Where will it be delivered? plant, storage location

5. How will it be used? item category

6. How will it be paid for? account assignment category - this may also state how the material/service will be used, as the account assignment may be a sales or production order(for example).

This is shown on the following screen :

As mentioned, neither the vendor, nor the material price is specified in the requisition. A vendor can be specified in a requisition which has been "allocated", but thats a separate story.

The purchase requisition has no direct account postings. When a purchase order is created with reference to the requisition, the account assignment (category) and the material items are carried over. As of 2.2, the account assignment can be changed when the requisition is converted to a PO, but not the account assignment category. (You can change the account assignment from one cost center to another, but not from a cost center to a sales order -- different account assignment categories).

The purchase order

A purchase order can be created for a known vendor with the transaction code ME21 (accessed by Log>MM>Purchasing>Purchase Order>Create>Vendor known). An un-allocated (no vendor previously selected) purchase requisition might then be referenced. Alternatively, a purchase order can be created with reference to an allocated requisition using transaction code ME58 (Log>MM>Purchasing>Purchase Order>Create>via requisition).

As mentioned, the purchase order has the same entries as a requisition, plus item prices and a specified vendor. A sample purchase order is shown :

The purchase order has no direct account postings. However, account postings from goods receipts and invoices made against POs are very much affected by accounts designated in the POs. As of 2.2, a purchase orders account assignment can be changed as long as no goods have been received against the PO, and no invoice has been posted against it. (Thus, if no GR or invoice has been posted against a PO, the account assignment can be changed from one cost center to another, but not from a cost center to a sales order -- just like with requisitions).

The goods receipt (for a purchase order)

A goods receipt for a purchase order is created using transaction code MB01 (Log> MM>Inventory Management>Goods movement>Goods receipt>For purchase order). A movement type can then be selected via the menu bar, or using the list of possible entries. In SAP, every goods movement has a "movement type". The three headings of goods movements in SAP are good receipts, goods issues and transfer postings. Most goods movements will cause account postings. More will be said about that later.

With every goods movement (or transfer posting) in SAP, a material document is created. For every goods movement which affects a G/L account, an accounting document will be created (separate, but tied, to the material document). Material documents are not deleted, but they can be canceled or reversed. Thus, if a good receipt was posted with the wrong storage location and the wrong quantity, the receipt could be canceled. The cancellation will create a new material document (and probably an accounting document which will contain reverse debit/credit entries to what were entered in the first accounting document). Note, that if a goods receipt is entered for twenty-five pieces of a material, and only twenty pieces were actually received, a reversal could be entered. This reversal would be for five pieces. It would also have a material document, and the associated accounting document would have reverse debit/credit postings for the value of the five easy pieces.

The following is a goods receipt for the purchase order created in the last picture :

The movement type is one of the most important entries in materials management. It controls how account postings are made (as we will see), and it is very easy to overlook, as it is only a three-digit identifier. After several materials movements, one becomes familiar with common movement types (e.g. 101 - goods receipt of a PO, 201 - goods issue for a sales order, 561 - initial stock entry, and so on). The movement type will control the account postings with the aid of other parameters (such as the material type and the account assignment category).

The accounting view of the above transaction is shown in the following view :

Using the movement type (101), SAPs automatic account assignment was able to determine that a debit should be made to the cost centers account (which was specified on the purchase order), and the GR/IR clearing account should be credited. With automatic account assignment, the proper accounts with their respective "posting keys" were specified. Posting keys determine whether debits or credits are made against given accounts. More will be said about posting keys later.

The invoice (for a purchase order)

Invoices on the materials management side of SAP are entered via transaction code MRHR (Log>MM>Invoice verification>Document entry>Enter invoice). One could also enter credit memos in materials management (via a similar path to that just shown), as well as subsequent debits/credits against previous entries. As mentioned, these are usually entries made by accounts payable (A/P) clerks, but SAP allows its customers the option of entering this information in MM.

In SAP, invoices are not posted unless total debits and credits balance. New in 2.2, preliminary posted invoices can be made for invoices. In such a case, the proper PO to register the invoice against is unknown, therefore an A/P clerk can enter the invoice information, and "park" the document. Note that in "parked" invoices, no account postings are made.

Invoices can be blocked for payment because tolerances are exceeded. For example, the invoice date is much before the expected receiving date stated on a PO, thus date tolerance has been violated (it wouldnt be the first time a date was violated). Similarly, an invoice can be entered for a quantity greater than that which was received. Here the quantity tolerance has been violated. In SAP, even though an invoice is blocked for payment, account postings are made.

With goods movements, a material document is always created, and an associated accounting document is created when G/L accounts are affected. With invoices, one accounting document is created. An itemized listing of an invoice entered with reference to the PO created for this document is shown :

The accounts referenced in the above picture are not posted to until the invoice document has been saved. The "accounting view" of the above saved document is shown :

The accounting view of the invoice reflects what the item view showed, but note that the account entries could not be made unless the invoice balanced.

Also shown in the picture are tax codes. Tax codes can be created with a simple valuated entry (which would be manually maintained by A/P, purchasing, and system administrators). Tax codes can also be maintained via an external interface. In the US, tax codes are defined by :

1. the jurisdictional laws of the place to which the goods are shipped,

2. the material type of the goods being shipped, and

3. the taxability of the entity (customer) receiving the goods.

There are more than 50,000 different tax jurisdiction areas in the US (as they are defined by state, county, city, zip codes, etc.). External tax systems (such as AVP or Vertex) maintain the taxation rates for these jurisdictional areas. In 2.2, modifications have been created to interface external tax systems. In 3.0, this interface will be standard.

The account entries described in this section are shown in the following "T" account entries.

With the goods receipt, the debit to the cost center account (which could be the cost centers stock account) represents an increase in on-hand stock, while the credit to the GR/IR clearing account represents an outstanding invoice approval process.

With the invoice receipt, the invoice is verified that, in fact, the goods were received, and were of acceptable quality. This invoice entry creates a debit to the GR/IR clearing account (to balance the account), and a credit to the vendor account. A credit to vendor account signifies that in order to make the account balance, the vendor must be paid (debit the vendor account). Note that if the received goods were of sub-standard quality, payment could be blocked at this point by either not entering the invoice, or (more likely), the invoice would be entered, but blocked for payment. (Invoice verification is considered the third link of "three-way matching" -- the matching of the PO, GR and invoice. The invoice verifies the purchase order price and specifications, and that the goods in the PO were received and of appropriate quality)

The payment of the invoice is the final link in the workflow chain. The vendor is paid (account debited), and cash is decreased (credited). In SAP, maintenance of vendor payment is outside of materials management, but with an integrated system, it is coordinated.

Automatic Account Assignments in Materials Management

Consideration of automatic account assignments in MM will be approached in two steps, according to the accounting documents created in the last section. First, we will pursue the account postings made by goods movements, then we will consider account postings made by invoice entries.

Account postings through goods movements

Lets start from the basics. As mentioned, with each goods movement there can be an associated account posting. Where are these account postings maintained? A good place to first look is table 156s. This is accessed by table maintenance (SM31), entering "T156S", and hitting either the "Maintain" or "Display" button. The following table is then presented :

This table shows configuration information based on all the movement types (hundreds) in SAP. For our discussion on account postings, we do not need to concern ourselves now about the entries in the column and to the right of "SLoc".

From the fields shown, a quantity string and value string are determined. Note, that it is the combination of all the appropriate fields which makes this determination. The quantity string determines which quantity fields are updated (through a sequence of instructions), and the value string determines which account posting keys will be signaled (also through a sequence of instructions). Therefore, in order to determine which quantity string and value string are to be referenced for each goods movement, the significant fields of table 156S are now defined from left to right, the following fields have the following meaning :

Movement type - the three digit code associated with a goods movement. It must be specified with every goods movement.

Value update indicator - every material type is designated as to whether or not the material value is updated during goods movements. Thus, the value update indicator signifies if the account posting can affect the material account.

Quantity update indicator - every material type is also designated as to whether or not material quantities are to be updated during goods movements. Note that the the material types quantity update indicator and value update indicator must match a line entry in order to use the associated quantity and value strings.

Special stock indicator - this field indicates who owns the material and who gets the material. For example, the indicator might be blank (" "), where the stock is taken by the user in their plant. The indicator might be "K" (for consignment), where the vendor owns the material, but the stock is taken into the users plant.

Movement indicator - This specifies the type of order the goods movement might be against. For example, the movement could be with reference to a purchase order, a delivery note, or with no reference.

Receipt indicator - This field is currently not used. In the future, it is expected that specification will be possible to determine if this movement was for a stock transport order or an outside purchase order

Consumption posting indicator - this field is used in the case of goods receipts for purchase orders, and is defined from the account assignment category in the PO. Thus, in our previous example, the account assignment of "K" (for cost center) in the purchase order ensured that the receipt debited the cost centers account, and not the stock account.

So with the right combination of these seven (actually six) entries, we determine quantity and value strings. The quantity string is handled very similarly to the value string. Quantity strings are maintained in table 156M (accessed via SM31 and display/maintain "T156M"). In the last picture, the quantity string for the top entry is ME02. In table 156M, the quantity string indicates if orders are to be updated and other relevant quantity information. This table will not be analyzed here.

Value strings are handled in table 156W (accessed via SM31 with display/maintain "T156W"). The value string for the top entry in the last picture was WE06. Table 156W is shown :

Paging down through this table we see that KBS signifies an account specified in a purchase order, and WRX signifies a GR/IR clearing account. If we double-click on (or choose) KBS, we are brought to the following screen :

So how do we know which posting key to take? Is this a debit or a credit? We look to table 156 (a.k.a. "T156) in SM31.

For movement type 101, we see that the first entry is "S" under D/C. This signifies that the first entry is to be a debit, thus the first t/e key (KBS in this case) is a debit. Therefore, we look to posting key 81.

We see that this key causes a debit to the specified G/L account. Thus, an account was specified in the PO (since 101 was a GR for a PO), and by finding the value string in table 156S, then the appropriate transaction/event keys in table 156W, and then by digging into the t/e keys in table 030, we were able to determine the appropriate account postings. So that told us about the debit made, but what about WRX? Lets also look inside t/e key WRX in table 030 (we first must specify the chart of accounts, in this case CAUS) :

Here we see different postings, a valuation grouping code, an account modifier and a valuation class. Since the account modifier is not shown in this screen, well cross that bridge when we get to it. For now, lets look into the valuation grouping code. This is found in table 001K through SM31 (also available in transaction OMWD; Tools > Cust > Config > Log > MM > Val/Acc.assign > Config > Acct. det. > Val. area grouping).

.From this screen, we see that the valuation grouping code is used to group different valuation areas and/or different company codes together within a chart of accounts so that they have similar postings. So we understand the valuation grouping code, now how about that valuation class? Thats attained from the accounting view of the material master (for that specific valuation area).

For this material, the valuation class of 3000 is chosen. When this field is drilled into, we see that for this raw material, the system knew that only certain valuation classes were allowed. How did the system know which valuation classes were allowed for this material? It knew because when this material was created, a material type was chosen. Now on to material type configuration. This can be accessed via transaction code OMS2 (T>C>C>L>MM>Master data > material > control data > material type > click on change or display), select "ROH" (for raw materials), then click on the "account assignment" button. This shows the possible valuation classes assigned to the material types.

So for this raw material, the valuation class chosen was 3000. Therefore, back in table 030, for the t/e key WRX, using the valuation grouping code found in table 001K and the valuation class for the material (found in the material master), we can determine the GR/IR clearing account entry.

While were in the material type screen, lets look at one other thing -- quantity/value updating. From the last picture, click on the button labeled "quantity/value". The following screen appears :

Note that to restrict quantity or value updating of this material type, the button "in no valuation area" under the headings of quantity or value updating would be selected. Thus, FOR EACH MATERIAL TYPE, THIS IS WHERE WE DETERMINE IF THERE IS QUANTITY OR VALUE UPDATING.

Back to our example from II.3 (a goods receipt for a purchase order)

So guess what! With what weve covered in this section were ready to track down how our goods receipt posting in the last section happened as it did! Lets consider what we know about the goods movement :

1. It is a goods receipt for a PO -- movement type 101.

2. The PO had an account assignment category of "K", for a cost center and therefore is an item set for consumption.

3. The material used was a raw material with a valuation class of 3000.

4. For raw materials, there is both quantity and value updating.

5. It is "standard stock" item (no special stock type)

So lets look to table 156S ==>

We are looking for the entry which is the third from the top. It meets all the criteria. Therefore, we are looking to value string WE06 for answers WE06 is found in table 156W.

As we said about this screen, WE06 has only two t/e keys. We determined the account posting for KBS in the following way :

1. We found KBS in table 030

2. Under KBS, we saw that two posting keys were there, one for a debit, one for a credit

3. In table 156, we found that the first entry is a debit, thus we select posting key 81

5. There we saw that posting key 81 causes a debit to a prespecified G/L account (the cost center account specified on the purchase order)

We also determined the account posting for WRX in the following way :

1. We found WRX in table 030

2. Under WRX, we saw that we saw that we needed to specify a valuation grouping code and a valuation class in order to determine the proper GR/IR clearing account.

3. In table 001K, we saw that for our valuation area (US01) and our company code (US01), we have the valuation grouping code US01.

4. From the accounting view of our material master, we saw that our material has a valuation class of 3000 for the plant we are operating in (US01).

Therefore, in table 030, with a valuation grouping code of US01 and a valuation class of 3000, we have the GR/IR clearing account as account number 191100. This is shown in the accounting document created for the goods receipt.

A small change to the purchase order...

We said that a purchase order creates no direct account postings. However, they very much affect account postings for subsequent documents! In the purchase order of section II.2, what if we had chosen the account assignment category as being standard? Lets look again at table 156S.

In this case, we choose the top entry -- goods receipt for a PO, where there is no consumption specified. We are thus given the value string WE01. Lets look to table 156W.

Here we have 12 different posting keys! Note that there should always be more than one posting key for a goods movement because there should always be at least one debit and at least one credit. We saw that for movement type 101 (in table 156), the first entry is a debit. Thus, lets look to table 030 to see what a debit under posting key BSX does.

Again we see the valuation grouping code US01 and valuation class 3000, we have account 300000. This is exactly what we find with this goods receipt ==>

Offsetting entries for inventory postings (Key GBB)

One last point about automatic account assignments from materials movements.

One of the t/e keys definable for a value string is GBB. This is a key often associated with goods issues, but can be used whenever offsets are required for inventory. This key is maintained in table 156X, which is shown :

As we determined the quantity and value strings from table 156S, here we not only can find the value string, but also the account modifier. If we look in table 030, we see the t/e key GBB. When we choose that key, we find the following view :

Where in the t/e key screens of BSX and WRX we only had to know the valuation grouping code and the valuation class, here we also need the account modifier. This screen shows that a goods movement which has a valuation grouping code of US01, a valuation class of 7900 (commonly used for semi-finished goods), and an account modifier of AUF would have debit and credit postings made to account 895000.

An Easier Way...

To review, we recommend a way of determining account postings from goods movement documents :

1. Check table T156S for the appropriate movement type

2. Find the appropriate movement type and value string in table T156S based on :

a. if the material type is quantity and/or value updated

b. if the item has a special stock type

c. what type of movement is occurring

d. what type of account assignment the item might have (consumption, sales order,

e. stock account, etc.)

3. Based on the value string, check table T156W for the sequence of t/e keys accessed

4. Check table T156 to determine if the sequence from T156W begins with a debit or a credit

5. Check table 030 to see the possible postings for each of the t/e keys

a. for the t/e keys which have simple entries of posting keys (as with KBS), look to table TBSL to see what account this posting key affects

b. for the t/e keys which have a valuation grouping code, account modifier, and a valuation class specification, find the account by the following :

 look to table 001K to find the valuation grouping code based on the appropriate valuation area and company code

 look to table T156X if an account modifier must be checked

 look to the accounting view in the material master to find the appropriate valuation class

This is one way to check the configuration without creating all of the documents.

Postings from invoices

Account postings made by invoices are much easier to understand, but harder to examine, than goods movement account postings. With invoices and credit memos, there is an associated document type (note the initial screen of an invoice)

However, we can look at the posting keys for invoices we can expect to be affected. These are maintained with transaction code (accessed via the path : Tools > Cust > Config > Acctg > Fin Acctg > Book > Bus trans > Base params > Control > Posting keys). We are brought to the following screen :

We see that posting key 31 is an invoice in which we credit a vendor. Lets choose this key (or double-click on it).

We see that this is a credit to a vendor account. We also see that posting key 31 has a reverse posting key of 22. The previous screen showed that this is a reverse invoice receipt (different from a credit memo). A note about vendors -- in purchasing, vendors can be created with regard to purchasing, or centrally. If a vendor is created with regard to purchasing only, the vendor will not have accounting information maintained. Thus, the vendor would not bill in the SAP system. This is not to say that the vendor will not bill (we should be so lucky), just that it is not done in the SAP system. This might be for SAP users who are using an external system for accounting (or A/P only).

When a vendor is created, it is designated with an account group. The main functions of a vendor account group are :

1. to designate if the vendor is a one-time vendor

2. to specify the number range the vendor might be assigned to (to assign a vendor name)

The screen shows that the number range for LIFA is "XX" (transaction XKN1 shows this to signify external number assignment). The screen also shows that this is not a one-time vendor. If we double click on "Company code data", and double-click on "account management" in the next screen, we see how accounting fields for this vendor are maintained in the vendor master record.

If an invoice is created with reference to a purchase order, the account postings are already specified, as checking is done as to whether the goods have been received. Note that in creating an invoice, it is not necessary that an A/P clerk reference a PO (although it is advisable if known). If a PO is not reference, the A/P clerk must manually maintain account entries. These account entries have associated posting keys. For example, a freight charge might have a posting key of 50. This account can be seen in table 030. Likewise, unplanned delivery costs can be charged against the group receiving the goods.

During invoice entry, alternative account entries can be entered, either as debits or credits. Thus, account determination is made as the invoice is entered.

Postings from purchasing documents

One last note...

You may find that some account postings happen when referencing purchasing documents, and there is no reference to these postings in table T156S. For example, freight charges. They can be specified in a PO, but how does a goods receipt know to take the POs freight charge over to the account posting?

First, lets remember where freight postings are made in a purchase order. In the pricing condition record (note a special condition type) :

So the condition record of the screen shown has a condition type of FRA1, a percentage freight charge. Purchasing condition types are tied to account postings through PURCHASING configuration. Thus if we look into transaction M/08, yes with a "/" (Tools > Cust. > Config > Log > MM > Purch. > Functs. > Conds. > Pricing > Pricing Proc. > Pricing Proc.), we see the following screen :

If we now double-click on RM0000 (the first pricing procedure), page down to find FRA1, hit the "change view" button, we find the following screen :

Here we see that condition type FRA1 is tied to account key FR1. If we now look in table T030, double-click on "RMK" (MM postings), and double-click on FR1, we see that (in CAUS, for example), these freight postings are made to account number 192100.