Sub topic 6
Sales views: sales organization and plant-level sales data
This chapter assumes you know the organizational levels and material types from earlier chapters, can open a material in the maintenance transaction, and understand sales areas (sales organization, distribution channel, division) at a basic level. The ABAP example is optional reading.
Why sales data is split across two levels
Sales data for a material does not sit at one organizational level. Some of it answers "how do we sell this product in this sales channel?" The rest answers "how do we ship it from this plant?" SAP therefore splits the sales views by level:
| View | Organizational level | Main table | Typical content |
|---|---|---|---|
| Sales: Sales Org. 1 | Sales organization and distribution channel | MVKE | Delivering plant, sales unit, pricing and rebate groups, product hierarchy |
| Sales: Sales Org. 2 | Sales organization and distribution channel | MVKE | Material statistics group, item category group, material groups 1 to 5 |
| Sales: General/Plant | Plant | MARC | Availability check, transportation group, loading group, batch management indicator |
| Sales Text | Sales organization and distribution channel | Text tables | Long text printed on sales documents |
Tax classification data is stored per country in table MLAN and is maintained within the Sales Org. 1 view. Client-level data that sales also uses, such as the division and the base unit of measure, stays in Basic Data (MARA).
Sales: Sales Org. 1
This view holds the data a sales order needs to find and price the material.
- Delivering plant (MVKE-DWERK) is the plant that normally supplies the material for this sales area. During order entry, the system looks for the delivering plant in the customer-material info record first, then the customer master, then the material master. The material master value is the fallback.
- Sales unit is the unit of measure the customer orders in. If it is empty, the system uses the base unit. Conversion factors to the base unit come from the Additional Data maintenance in Basic Data.
- Material pricing group, volume rebate group, commission group, and cash discount indicator are keys. Condition records in pricing refer to them, so a wrong value silently changes the price or discount.
- Product hierarchy is a multi-level classification that pricing and reporting can use.
- Tax data is a table of country, tax category, and tax classification. If the classification is missing for the ship-to country, the sales order stops with a tax determination error.
Sales: Sales Org. 2
This view holds the groups that control how the sales document behaves.
- Item category group (MVKE-MTPOS) works with the sales document type to determine the item category of a line, for example a normal item or a text item. A wrong group sends the line down the wrong item category path.
- Material statistics group controls whether sales documents for the material update the sales information system.
- Account assignment group is used in revenue account determination. It must match an entry in the account determination configuration, or billing cannot find a revenue account.
- Material groups 1 to 5 are free classification fields for reporting and pricing.
Sales: General/Plant
This view is stored per plant, so you maintain it for each plant that ships the material.
- Availability check (MARC-MTVFP) is the checking group that decides how the system calculates available stock for a sales order. It works together with the checking rule on the order.
- Transportation group and loading group feed shipping point and route determination.
- Batch management and profit center are shown here and also appear on other plant views.
- Foreign trade data such as the commodity code and country of origin is held per plant for export processing.
Dependencies you must satisfy
A material can be sold in a sales area only when these conditions hold:
- The material exists at client level (Basic Data is complete).
- The sales organization and distribution channel combination exists in the organizational configuration.
- The delivering plant in the Sales Org. 1 view has a plant record (MARC) for the material. If it does not, delivery processing and the availability check fail.
- The material has no blocking sales status (see the chapter on status and deletion).
Because of rule 3, a very common error is extending a material to a sales organization but not to the plant that the sales view names as delivering plant. The sales order then reports that the material is not maintained in the plant.
Extending a material to a sales area
In the classic transaction MM01, you select the Sales views, enter the sales organization and distribution channel on the organizational levels dialog, and optionally enter a reference sales organization and distribution channel. The reference copies the values from an existing sales area, which saves time when you set up a new channel with the same settings. You then adjust the fields that differ, such as the delivering plant.
In S/4HANA, the Fiori app for product master data offers the same split: sales data is entered for a sales area, and plant data is entered for a plant. In S/4HANA the term "product" is also used for what the classic transactions call a "material". The tables are still MARA, MVKE, MARC, and so on.
Reading sales data with ABAP SQL
This report lists materials for one sales area together with the plant data for the delivering plant. A left outer join keeps materials whose delivering plant is empty, so you can find them.
REPORT zdemo_material_sales.
SELECT mvke~matnr,
mvke~vkorg,
mvke~vtweg,
mvke~dwerk,
mvke~mtpos,
mvke~vmsta,
marc~mtvfp,
marc~ladgr
FROM mvke
LEFT OUTER JOIN marc ON marc~matnr = mvke~matnr
AND marc~werks = mvke~dwerk
WHERE mvke~vkorg = '1010'
AND mvke~vtweg = '10'
INTO TABLE @DATA(lt_sales)
UP TO 100 ROWS.
LOOP AT lt_sales INTO DATA(ls_sales).
WRITE: / ls_sales-matnr,
ls_sales-dwerk,
ls_sales-mtpos,
ls_sales-mtvfp.
ENDLOOP.Rows with an initial dwerk (or no matching MARC row) show an empty mtvfp. Those are the candidates to fix.
Common errors
- Missing tax classification: the sales order fails with a tax determination error for the ship-to country. Add the country in the tax data of Sales Org. 1.
- Wrong item category group: the line gets an unexpected item category, or none. Check the combination of document type and group.
- No account assignment group match: billing cannot determine the revenue account.
- Delivering plant not extended: the availability check and delivery creation fail.
- Field values copied from the wrong reference: a reference sales area that was set up for another channel can carry a wrong delivering plant or pricing group into the new area.
Exercise
A sales order for a material fails at delivery creation with the message that the material is not maintained in the plant. The material's Sales Org. 1 view names plant 1010 as delivering plant. Which table row is most likely missing, and how would you check it with ABAP SQL?
Show answer
The plant row in MARC for the material and plant 1010 is most likely missing. Select from MARC where matnr is the material and werks = '1010'. Or join MVKE to MARC on matnr and on werks = dwerk with a left outer join, as in the report above, and look for rows with an empty plant value. The fix is to extend the material to plant 1010, including the Sales: General/Plant view.
Exercise
Which two fields in the sales views decide the item category of a sales order line, and where is each stored?
Show answer
The item category group (MVKE-MTPOS, set in Sales Org. 2) and the sales document type of the order. The system combines these two, together with the higher-level item category and the usage, to determine the item category. Only the item category group comes from the material master.