Supply Network Planning

Embed Size (px)

DESCRIPTION

SUPPLY NETWORK PLANNIG

Citation preview

Integration via APO Core Interface (CIF)

Advanced Planning and optimizer Supply Network Planning

Supply Network Planning

APO Supply Network Planning (SNP) integrates purchasing, manufacturing, distribution, and transportation so that comprehensive tactical planning and sourcing decisions can be simulated and implemented on the basis of a single, global consistent model. Supply Network Planning uses advanced optimization techniques, based on constraints and penalties, to plan product flow along the supply chain. The result is optimal purchasing, production, and distribution decisions; reduced order fulfillment times and inventory levels; and improved customer service.

Starting from a demand plan, Supply Network Planning determines a permissible short- to medium-term plan for fulfilling the estimated sales volumes. This plan covers both the quantities that must be transported between two locations (for example, distribution centre to customer or production plant to distribution center), and the quantities to be produced and procured. When making a recommendation, Supply Network Planning compares all logistical activities to the available capacity.

The Deployment function determines how and when inventory should be deployed to distribution centers, customers, and vendor-managed inventory accounts. It produces optimized distribution plans based on constraints (such as transportation capacities) and business rules (such as minimum cost approach, or replenishment strategies).

The Transport Load Builder (TLB) function maximizes transport capacities by optimizing load building.

In addition, the seamless integration with APO Demand Planning supports an efficient S&OP process.

Integration with Other APO Applications

To...Do this...Other Information

Set up the Supply Chain ModelUse the Supply Chain Engineer (SCE)In the SCE, you assign the locations, products, resources, and PPMs to a model. You then add transportation lanes to link supply to demand locations, allocate products to the transportation lanes, and maintain quota arrangements.

Make the unconstrained forecast available in Supply Network PlanningRelease the Demand Plan to Supply Network Planning and vice versa.The supply chain planner can then plan resources based on a full and reliable picture of demand, and, likewise, the demand planner can later monitor where adjustments to the demand plan have been necessary due to production, distribution and other constraints.

Make the Supply Network Plan available to PP/DSConvert the SNP orders into PP/DS ordersIn PP/DS, production planning is synchronized with execution to resolve all constraints and bottlenecks and create a viable production plan.

Features

Supply Network Planning is used to calculate quantities to be delivered to a location in order to match customer demand and maintain the desired service level. Supply Network Planning includes both heuristics and mathematical optimization methods to ensure that demand is covered and transportation, production, and warehousing resources are operating within the specified capacities.

The interactive planning desktop makes it possible to visualize and interactively modify planning figures. You can present all key indicators graphically. The system processes any changes directly via live Cache.

Supply Network Planning Process

You use Supply Network Planning (SNP) to model your entire supply network including all associated constraints. You can use this model to synchronize activities and plan the flow of material along the supply chain. This allows you to create feasible plans for purchasing, manufacturing, inventory, and transportation, and to closely match supply and demand.

Process

The following diagram shows the SNP cycle and the integration of SNP with the other components of SAP APO.

The sequence of the process steps described here is generally the sequence in which you should carry out the cycle. However, you may need to repeat certain steps or to proceed in a different order. Also, not all activities are mandatory.

Planning Area AdministrationTake all the necessary steps to set up your planning area. The planning area is the basis for all activities in SNP. It is a collection of parameters that define the scope of all planning tasks.

SAP APO Master Data SetupMaster data is a crucial aspect of the SNP component in SAP APO. You have to configure this master data very carefully to achieve satisfactory results. SNP master data includes information about locations, products, resources, production process models (PPMs) or production data structures (PDS), and transportation lanes.

Model/Version CreationBefore you set up the model in the Supply Chain Engineer (SCE), you have to create a model name and assign the model to at least one version. You can assign the model to several different versions for simulation purposes. The version is also used for releasing the demand plan (final forecast) to SNP and for releasing the supply network plan to Demand Planning.

Supply Chain Model SetupYou set up the supply chain model for SNP in SCE. There you assign the locations, products, resources, and PPMs or PDS to a model. You then add transportation lanes to link supply locations to demand locations, allocate products to the transportation lanes, and define quota arrangements.

Release Forecast Data to SNPYou release forecast data to SNP by first loading the data in a planning area in demand planning (DP) and then releasing it, or by directly releasing it from an Info Provider. The data is often unconstrained by any production or distribution restrictions. Either the demand planner or the SNP planner can execute this step.

Definition of Planning Method and Profile SettingsYou choose whether you want to use optimization-based planning, heuristic-based planning, or supply and demand propagation as your planning method. You also decide if you want to perform safety stock planning before the Supply Network Planning run. You then make the settings in the appropriate profiles for each of the methods requiring settings. You can still change these profiles during planning for simulation purposes. You may need to define additional master data specifically for the method you are using.

Supply Network Planning RunYou perform the planning run once you have chosen the method and carried out the prerequisite steps.

The result of a Supply Network Planning run using the heuristic, the optimizer, supply and demand propagation, or Capable-to-Match is a medium-term production and distribution plan.

Interactive PlanningAfter the SNP run, you review the plan in the interactive planning desktop. If you run heuristic-based planning, you can also level capacities from the interactive planning table.

Release SNP Plan to DPYou release the final supply network plan back to Demand Planning (DP) to compare the demand plan (without constraints) with the constraint-based supply network plan. Major discrepancies between these two plans could trigger re-forecasting, and, ultimately, re-planning. For example, you may want to release the supply network plan back to DP if the capacity situation is not sufficient to fulfill demand created by a promotion and you need to make adjustments to the promotion planning strategy.

Converting SNP Orders into PP/DS OrdersThis is not part of the SNP process since it can only be done in Production Planning and Detailed Scheduling (PP/DS). However, it is included in the cycle because this step is usually performed before running deployment and the Transport Load Builder.

In PP/DS, you convert SNP orders into PP/DS orders to make them available for Production Planning and Detailed Scheduling.

Production Planning and Detailed Scheduling (PP/DS)This is not part of the SNP process because it can only be run in PP/DS. However, it is included in the cycle because Production Planning and Detailed Scheduling is usually run before deployment and the Transport Load Builder, which are both part of the Supply Network Planning application component.

In PP/DS, you create a viable production plan based on the planned orders generated in SNP.

Deployment RunAfter production planning is complete and the system knows what will actually be produced (this information is saved automatically in liveCache), the deployment run generates deployment stock transfers.

Transport Load BuildingThe Transport Load Building (TLB) run groups the deployment stock transfers resulting from the deployment run into TLB shipments. You can also manually create TLB shipments for stock transfers that could not be taken into account during the TLB run due to specified constraints.

Planning Area Administration

The set up of the Supply Network Planning (SNP) system environment is integral to successful planning. Planning area administration is the first step in this setting-up process?

Prerequisites

You have understood the differences between the different storage methods in Supply Network Planning and Demand Planning, and know which functions are supported by which storage methods. For more information, see Data Storage in Supply Network Planning and Demand Planning.

You have understood the role and purpose of the following:

Key Figure Characteristic Master Planning Object Structure Storage Buckets Profile Planning Area Planning BookNote that the attribute object (navigation attribute for instance) is only used in Demand Planning. You cannot create aggregate objects yourself, as opposed to Demand Planning, where you can do this. If you create and activate your own master planning object structure (see step five below), SNP aggregates are generated automatically.

Process

1. For Supply Network Planning, SAP delivers pre-defined standard key figures and characteristics, which mean you, do not have to create your own key figures and characteristics. The characteristics in master planning object structure 9ASNPBAS and key figures in the planning areas 9ASNP01, 9ASNP02, 9ASNP03, or 9ASNP04 are displayed in Administration of Demand Planning and Supply Network Planning (APO Easy Access menu ( Supply Network Planning ( Environment ( Current Settings ( Administration of Demand Planning and Supply Network Planning). If you do not see these key figures and characteristics there, go to the ABAP Editor to create them in your system (APO Easy Access Menu ( Tools ( ABAP/4 Workbench ( Development ( ABAP Editor) and run the program /sapapo/ts_d_objects_copy.

If the key figures that are delivered with the system are not sufficient for your purposes, you can create additional key figures in the Administrator Workbench (from Administration of Demand Planning and Supply Network Planning, choose Administrator Workbench and then Tools ( Edit Info Objects). If the system asks you to choose between an APO key figure and a BW key figure, choose APO key figure. When creating a key figure for quantities, select Quantity and enter the data type QUAN and the unit 0BASE_UOM or 0Unit.2. You create storage bucket profiles from SNP Current Settings by choosing Periodicities for Planning Area. For more information, see Storage Buckets Profile.

3. You create planning bucket profiles in Customizing from Supply Network Planning by choosing Define planning bucket profiles. For more information, see Planning Buckets Profile.

4. You create the planning versions that you want to use for SNP and assign them to a supply chain model. For more information, see Model/Version Creation.

5. SNP comes with the standard master planning object structures 9ASNPBAS and 9ASNPSA (for scheduling agreement processing). You also have the option of creating your own master planning object structure. However, this does not have any advantages over using the standard master planning object structures. To create a new master planning object structure, from the SAP Easy Access screen, choose Supply Network Planning ( Environment ( Current Settings ( Administration of Demand Planning and Supply Network Planning. Then, from the top left pull-down menu Administration, choose Planning Object Structures, right-click the Planning Object Structures folder, and choose Create Planning Object Structure. If you select the SNP Planning indicator, the SNP standard characteristics are adopted into the master planning object structure automatically.

It is not possible to use additional characteristics in SNP. The delivered standard characteristics mentioned above should not be changed either. In particular, you are not permitted to add navigation attributes to characteristics, as SNP does not support them (apart from the standard navigation attributes), which means that using navigation attributes leads to problems.

When you activate the master planning object structure, you are asked whether you want the SNP standard planning level to be created. Confirm this to trigger generation of the SNP aggregates (that is, master data objects such as location product or resource). You also still have the option of creating the SNP standard planning level at a later point in Administration of Demand Planning and Supply Network Planning using the context menu function from the master planning object structure.

For more information, see Master Planning Object Structure and IMG.

6. SAP delivers the following standard planning areas for SNP:

9ASNP01 (time series-based)

9ASNP02 (order-based)

9ASNP03 (for scheduling agreement processing)

9ASNP04 (for optimization-based planning with time-dependent restrictions)

9ASNP05 (for safety stock planning)

9AVMI03 (for deployment heuristic with consideration of demands in the source location)

You can also create your own planning areas: From the SAP Easy Access screen, choose Supply Network Planning ( Environment ( Current Settings ( Administration of Demand Planning and Supply Network Planning, and choose Planning Areas from the pull-down menu Administration on the top left.

To create an order-based SNP planning area, you should copy an order-based SNP standard planning area. That way you can ensure that your own planning area contains the entire key figures with their necessary attributes required in SNP. To create a time-series-based SNP planning area, you should choose menu function Edit ( SNP Time Series Object, which adds the standard SNP time series key figures to the planning area. You can also assign additional key figures to your planning area to store data that is calculated by a macro, for example. Note that you should not make any settings for the additional key figures in the key figure details since these key figures would then be created in liveCache time series objects.

For more information, see Planning Area and IMG.

7. You set up your master data for SNP. For more information, see Master Data for Supply Network Planning.

8. You initialize the planning area by right-clicking the planning area and choosing Initialize Planning Version. Note that the context menu function for initializing is only called Initialize Planning Version if no time series key figures are included in the planning area. If at least one of these key figures exists in the planning area, the context menu function is called Create time series objects.

If you need to re-initialize a planning area after updating your master data or in order to extend the planning horizon, you do not need to de-initialize it first or delete the time series objects. The system recognizes new and deleted planning objects and updates accordingly.

6. Create planning books and planning views. You can assign the planning books and planning views to individual users. For more information, see Planning Book.

SNP provides the following standard planning books and data views for the different types of planning. For SNP, we recommend that you use these standard-planning books. If you need to create additional planning books, you should use the standard books as templates.

9ASNP94 (Interactive Supply Network Planning and Transport Load Builder (TLB)) - This planning book offers the standard functions for running interactive Supply Network Planning and the interactive Transport Load Builder.

9ASOP (Sales & Operations Planning (SOP)) - You use this planning book to run SNP planning method supply and demand propagation.

9ADRP (Distribution Resource Planning (DRP)) This user interface is almost identical to the interactive Supply Network Planning interface, the only difference being that here it is also possible to display distribution receipts and issues.

9AVMI (Interactive VMI) - In addition to the typical SNP data that you can display, you can also display the values for your VMI receipts and demands (planned, confirmed, and TLB-confirmed).

9ASA (interactive scheduling agreements) You use this planning book to display and change all data that is relevant for scheduling agreement processing.

9ASNPAGGR (Aggregated Planning) You use this planning book to perform aggregated planning and planning with aggregated resources.

9ASNP_PS (product interchangeability) You use this planning book if you want to consider product interchangeability when planning.

9ATSOPT You use this planning book to define time-based constraints for optimization-based planning.

9ASNP_SSP You must use this planning book (or one based on it) if you want to apply certain standard safety stock planning methods. You can also use this book for extended safety stock planning.

9DRP_FSS You can use this planning book (or one based on it) if you want the deployment heuristic to also consider customer demands or planned independent demands in the source location. For more information, see Consideration of Demands in the Source Location.

Master Planning Object Structure

Definition

A master planning object structure contains plannable characteristics for one or more planning areas. In Demand Planning, the characteristics can be either standard characteristics and/or ones that you have created yourself in the Administrator Workbench. Characteristics determine the levels on which you can plan and save data. Specific characteristics are required for Supply Network Planning, Characteristics-Based Forecasting and forecasting of dependent demand; these characteristics can be included on demand in the master planning object structure.

The use of additional characteristics for Supply Network Planning is not supported. For an example of a master planning object structure with the correct characteristics for Supply Network Planning, see 9ASNPBAS.

The master planning objects structure is the structure on which all other planning object structures are based. Other planning object structures are aggregates and standard SNP planning levels.

A master planning object structure forms part of the definition of a planning area. The existence of a master planning object structure is therefore a prerequisite for being able to create a planning area.

Integration

Before you can start planning, that is entering data for key figures; you must have created characteristic combinations. You do this for each master planning object structure.

Working with Master Planning Object Structures

Master planning object structures are prerequisites for creating planning areas in Supply and Demand Planning.

In Demand planning you can assign any characteristics that exist in the system to the master planning object structure.

The following applications have fixed sets of standard characteristics:

Supply Network Planning

Characteristic-based forecasting

Forecasting with bills of material

Prerequisites

You have created the characteristics with which you wish to work.

Procedure

To edit master planning object structures you work in Supply and Demand Planning Administration, which you access by choosing Demand Planning/Supply Network Planning ( Environment ( Current Settings ( Administration of Demand Planning and Supply Network Planning.

In S&DP Administration you can edit:

Planning areas

Master planning object structures

To edit master planning object structures choose Planning object structures on the selection button (top left of the screen).

Creating Master Planning Object Structures

1. Choose Create master planning object structure from the context menu.

2. On the dialog box that appears enter a name for the new master planning object structure and choose. The Configure Planning Object Structure screen appears.

3. Enter a descriptive text for the master planning object structure.

4. You now assign characteristics from the table on the right of the screen. If the master planning object structure is for use in one of the applications listed above in the Use section, simply select the relevant indicator. The standard characteristics are transferred automatically. Otherwise select the characteristics that you want to use and then choose . Similarly you can choose to remove characteristics from the master planning object structure.

5. You can also assign dimensions to the characteristics in your master planning object structure. Dimensions here are similar to dimensions in InfoCubes and are used to improve performance. To assign dimensions use the pull-down box in the dimension () column of the left hand table. You can add further dimensions by choosing the Add button at the bottom of the screen.

6. If you want to use other characteristics for product and location than 9AMATNR and 9ALOCNO, you must specify these characteristics in the master planning object structure. In general you should use the two SAP characteristics as the basis for the new characteristics. The main reason for changing these characteristics is to be able to use navigational attributes in Demand Planning without causing problems afterwards in SNP (SNP does not support navigational attributes). To assign the product / location characteristics in the master planning object structure choose Edit ( Assign prod. /loc. Enter the relevant characteristics in the dialog box that appears.

7. Save your master planning object structure.

Changing Planning Object Structures

SAP recommends that you do not change master planning object structures that have been activated and that are in use in planning books.

To remove a characteristic from a master planning object structure you must first deactivate the structure.

When you deactivate a master planning object structure, all characteristic value combinations are deleted and the existing liveCache time series objects become inconsistent.

Activating/Deactivating Master Planning Object StructuresBefore you can work with a master planning object structure (for example create characteristics combinations or assign them to a planning area) you must activate it.

You can do this either:

From the planning object structure workspace in S&DP Administration by selecting the master planning object structure and then choosing Activate or Deactivate from the context menu.

On the Configure Planning Object Structure screen by choosing to activate or to deactivate. Read the cautions above before deactivating master planning object structures.

Storage Buckets Profile

There are two kinds of time bucket profiles: one is used for storing data (the storage buckets profile), and the other for planning the data (the planning buckets profile). A storage buckets profile defines the time buckets in which data based on a given planning area is saved in Demand Planning or Supply Network Planning. In a storage buckets profile, you specify: One or more periodicities in which you wish the data to be saved The horizon during which the profile is valid.You can also include a time stream in storage bucket profile. You use time streams to incorporate factory calendars and other planning calendars in Demand Planning. You can thus specify which days are workdays and which days are holidays. You define time streams in Customizing under APO ( Master Data ( Calendar ( Maintain Planning Calendar (Time Stream). Refer to the implementation guide (IMG) before editing time streams. You assign the time stream to the storage bucket profile in the relevant field at the bottom of the screen. You select the periodicities month and week in the storage buckets profile. You do not enter a time stream. Data for the months of June and July 2001 is stored in the following buckets, also known as technical periods.

Time spanNumber of days

Friday through Sunday, June 1-33 days

Monday through Sunday, June 4-107 days

Monday through Sunday, June 11-177 days

Monday through Sunday, June 18-247 days

Monday through Saturday, June 25-306 days

Sunday, July 11 days

Monday through Sunday, July 2-87 days

Monday through Sunday, July 9-157 days

Monday through Sunday, July 16-227 days

Monday through Sunday, July 23-297 days

Monday and Tuesday, July 30-312 days

The definition procedure for storage bucket profiles is the same for Demand Planning and Supply Network Planning.Include in the storage buckets profile only the periodicities you need because the technical periods take up storage space. On the other hand, you must include all the periodicities in which you intend to plan. For example, if you intend to plan in months, you must include the periodicity month in the storage buckets profile.You need a storage buckets profile before you can create a planning area. The storage buckets profile can be used for the release to SNP. For more information, see Release of the Demand Plan to SNP.The way data is saved is further defined by the way you customize the Calculation type and Time-based disaggregation in the planning area. For more information, see Aggregation and Disaggregation and the F1 Help for these fields.To define the buckets in which data is displayed and planned in interactive planning, create a planning buckets profile. For more information, see Planning Buckets Profile.You maintain storage bucket profiles in Customizing under Supply Chain Planning ( Demand Planning ( Basic Settings ( Define Storage Bucket Profile.

Once a storage buckets profile is in use, it is not possible to change it. It is therefore sensible to specify a relatively long horizon. Since the storage bucket profile does not take up any room in liveCache, this does not affect performance.

Planning Buckets Profile

Information, which is incorporated into the definition of the past or future time horizon of demand planning. The planning buckets profile defines the following:

Which time buckets are used for planning

How many periods of the individual time units are used

The sequence in which the time periods with the various time units appear in the planning table

Use

You can plan in monthly, weekly, daily or (combined with fiscal year variants) self-defined periods.

When you create a planning buckets profile, only use the periodicities or a subset of the periodicities that are also defined in the storage buckets profiles (see storage buckets profiles) on which the planning area is based. In a planning buckets profile, do not include a periodicity that is not in the storage buckets profile.

You can have multiple planning buckets profiles, and therefore multiple planning horizons, for one planning book. The planning buckets profile is attached to the data view within the planning book. You could have three data views for three users, for example, where a different planning buckets profile is valid for each view: Marketing plans in months, sales plans in months and weeks, and logistics plans in weeks and days.

To switch to a different planning buckets profile in interactive planning, you open the planning book wizard by changing to Design mode and choosing the Change Planning Book button. On the Data View tab page, enter a name and description for the new view as well as the required time bucket profiles and any other necessary data.

If you specify a historical planning horizon in the data view, the first historical time bucket starts on the day before the future planning horizon start date. The second historical period begins further back in the past, and so on. If you plan in weeks, the first day of the week is always Monday.

If you plan in weeks and the planning horizon start date as specified in the data view of the planning book is not a Monday, the first week of the planning horizon is predated to the previous Monday. For example, if the planning horizon starts date as specified in the planning book is November 1, 2001 (a Thursday), the first week of the planning horizon begins on October 29, 2001 (a Monday).

If the planning buckets profile contains smaller and larger time buckets, for example weeks and months, the smaller time buckets take precedence if any conflict arises. If, for instance, you have specified that the first month is to be planned in weeks and the month does not start or end on a Monday, the system creates 5 time buckets of a week's duration. For example, you start planning on January 01, 2001 and specify that the first month (January) is to be planned in weeks. The first 5 time buckets from January 1 to February 4 are in weeks. The first month bucket is shortened and is from February 5 through February 28.

If you forecast using mass processing jobs, the length of the planning horizon is a vital prerequisite for being able to save corrected history and the corrected forecast. The historical planning horizon in the planning book must include the historical forecast horizon in the master forecast profile. It may also go further back into the past than the historical forecast horizon in the master forecast profile. It must not be shorter than in the master forecast profile. Similarly, the future-planning horizon in the planning book must include the future forecast horizon that is defined in the master forecast profile. It may also extend further into the future than the future forecast horizon in the master forecast profile. It must not be shorter than in the master forecast profile. This restriction is necessary for performance reasons. It does not apply if you forecast in interactive demand planning.

To read the data for the online release of the demand plan to SNP, you can use a planning buckets profile. For more information, see Release of the Demand Plan to SNP.

To release the demand plan to Supply Network Planning in daily buckets, you use a daily buckets profile, that is a planning buckets profile containing daily buckets only. The use of a time buckets profile to release data to Supply Network Planning is optional. See also Release of the Demand Plan to SNP and Release from an Info Provider to SNP.

To see the start and end dates of a period in a planning book or in the demand-planning table, double-click with the right mouse button on the column heading. In this dialog box, you can also configure what information you want to see in the column heading.

The buckets in which the data is stored in the system are known as storage buckets or technical periods. You define these technical periods when you create a storage buckets profile. For information on how technical periods affect disaggregation and rounding, see Example of Disaggregation and Rounding.

Structure

After you have created the planning buckets profile, use it for the definition of the future planning horizon and of the past horizon by entering them in a planning book: one horizon as future planning horizon and one as past horizon. The system displays the horizons in interactive demand and supply planning starting with the smallest time bucket and finishing with the largest time bucket. The future horizon starts with the smallest time bucket; on the planning horizon start date, and works forwards, finishing with the largest time bucket. The past horizon starts with the smallest time bucket the day before the start of the future horizon and works backwards, finishing with the largest time bucket:

Example

Number of periodsBasic periodicityFiscal year variant of basic periodicity (optional)Display periodicityFiscal year variant of display periodicity (optional)

2Y

1YM

2MW

In the above example, the time horizon spans two years. Of these two years, the first year is displayed in months. The first two months of this year are displayed in weeks.

The first row defines the entire length of the time horizon. The following rows define the different sections of the horizon. You make entries in the columns Number and Display periodicity. The content of the other columns is displayed automatically when you press Enter. To see exactly which buckets will be displayed, choose Period list.

Key Figure

Contains data that is represented as a numerical values either a quantity or a monetary value. Examples of key figures used in Demand Planning are planned demand and actual sales history. Examples of key figures used in Supply Network Planning are production receipts and distribution receipts.

You create key figures in the Administration Workbench, even if you only intend to use the key figures in LiveCache. Choose Tools, Edit Info Objects.

In APO, create APO key figures (not BW key figures).

There are three types of key figure that are of interest for demand planning:

Quantity- Use this type for physical quantities

Amount - This type is amounts of money

Number - Use this type for numbers that do not have units of measure or currencies, such as factors.

The unit of measure and currency are always taken from the planning area.

There are different places in which a key figure can be stored. For detailed information, see Data Storage in Demand Planning and Supply Network Planning. CharacteristicA planning object such as a product, location, brand or region.

The master data of Demand Planning or Supply Network Planning encompasses the permitted values of the characteristics, the characteristic values. Characteristic values are discrete names or numbers. For example, the characteristic 'location' could have the values London, Delhi and New York.

The characteristics used in Demand Planning are the same as those used in the SAP Business Information Warehouse. You create and edit characteristics in the Administration Workbench. For more information, see InfoObject and Creating InfoObject: Characteristics.

SAP delivers several characteristics for use in SAP APO as Business Content. These characteristics have the prefix 9A as opposed to 0 for other BW characteristics. As SAP reserves the right to change these characteristics without notice, we strongly recommend that you do not change them.

Compared to BW characteristics there are the following restrictions for the use of characteristics in Demand Planning.

Data types DATS Date and TIMS Time are not permissible.

Similarly lowercase characteristic names are not permissible. (You can of course use lowercase in the description fields.

We recommend that you do not use compound characteristics.

Planning Area

Planning areas are the central data structures for Demand Planning and Supply Network Planning.

The planning area is created as part of the Demand Planning/Supply Network Planning setup. A planning book is based on a planning area. The end user is aware of the planning book, not the planning area. The liveCache objects in which data is saved are based on the planning area, not the planning book.

The planning area specifies the following:

Unit of measure in which data is planned

Currency in which data is planned (optional)

Currency conversion type for viewing planning data in other currencies (optional)

Storage buckets profile that determines the buckets in which data is stored in this planning area

Aggregate levels on which data can be stored in addition to the lowest level of detail in order to enhance performance

Key figures that are used in this planning area

Settings that determine how each key figure is disaggregated, aggregated, and saved

The assignment of key figures to aggregates

Supply Network Planning comes with predefined planning areas. You can also define your own planning areas.

You define planning areas in S&DP Administration.

Structure

You assign a planning area to a master planning object structure, which in turn is assigned characteristics and aggregates, which in turn are assigned characteristics and aggregates.

You assign the key figures with which you want to work directly to the planning area.

Mass Maintenance of Time Series Key Figures

In Supply Network Planning (SNP), planning is generally based on order key figures. However, in some areas, you can also use time series key figures, for defining time-dependent restrictions for optimization-based planning, for instance.

You can use this function to carry out mass maintenance of time series key figures, that is, you can select several key figures and planning objects, and either define the key figure values for individual periods, or for all periods.

You can also use this function to process time series key figures for Demand Planning (DP).

Features

Selection of Key FiguresYou can select the key figures for a particular planning area and planning time period, as well as for particular planning objects. As when defining a planning book, you determine the planning time period and the period schedule lines, by entering a planning buckets profile and a planning start date. You can also shorten the planning time period further by entering a time period for maintenance.

You select the planning objects with the shuffler, as in interactive planning. In addition to the standard planning objects, in this function, you can also use the SNP aggregate APO Product Transport (a product on a transportation lane). The APO PPM/PDS aggregate also includes the header product for the production process model (PPM) or the production data structure (PDS). If you select Display Selected Objects, the planning objects selected in the shuffler are displayed. Definition of Key Figure ValuesYou can define key figure values for individual periods or for all periods. The options available are:

Set Key Figure Values: You can define the values for the individual periods. You can use the distribution function to distribute values over periods, as in interactive planning.

Change Key Figures: You can define or change the values for all periods in the planning time period. You can also determine, for example, that you want the system to add or subtract specific values or percentages to (or from) existing values.

Note that values saved earlier or in liveCache are not displayed, but are overwritten by the new values.

Activities

1. Select Advanced Planning and Optimization ( Supply Network Planning ( Environment ( Mass Maintenance of Time Series Key Figures from the SAP Easy Access screen.

2. Select the key figures as detailed above, and then select Set Key Figures or Change Key Figures.

3. After entering the values, select (with tool tip Save) or (in the Background). If you select the latter option, you carry out the saving procedure as a background job.

Data Storage in Demand Planning and Supply Network Planning

In Demand Planning and Supply Network Planning, you can store data in three ways:

In liveCache time series objects

In liveCache orders

In an InfoCube

Each key figure in a planning area has its own storage method.

Integration

Since planning areas for Supply Network Planning can contain only the standard SNP characteristics, you can only use a joint planning area for Demand Planning and Supply Network Planning, if demand planning in your company is done at product level or at product and location level. If you want to do demand planning at other levels, such as brand or regional level, you must have separate planning areas.

Features

LiveCache Time Series Objects

The data is stored in buckets, with no reference to orders. This storage method is suitable for tactical, aggregated planning. It is the usual method for saving current Demand Planning data. It also supports the Sales & Operations Planning process. If you save a key figure to liveCache time series objects, you can use the following functions:

Constraint propagation up and down stream (material constraints, capacity constraints, stock level constraints)

Aggregation and disaggregation

Freely definable macros

Product allocation checks

Characteristics-Based Forecasting (CBF)

Single- and multilevel infinite heuristics

Capacity leveling

MILP Optimizer

Capable-to-Match

Deployment

Vendor-Managed Inventory (VMI)

There are a number of standard key figures that are saved to liveCache time series objects which you can include in an SNP planning area by choosing Edit SNP time series objects.

The prerequisites for saving a key figure to liveCache time series objects are that:

You have created time series objects for the planning area.

When creating the planning area, you made no entries for the key figure in the fields InfoCube, Category or Category Group.

When creating the planning area, any entry you made in the field Key figure semantics is prefixed with TS (an entry in this field is optional).

For an example of Sales & Operations Planning using the time series storage method, see planning book 9ASOP, planning area 9ASNP01 (transaction /SAPAPO/SNPSOP) in the standard APO system.

LiveCache Orders

The data is stored with reference to orders. This storage method is suitable for operative planning, such as in a classical SNP setup. If you save a key figure to liveCache orders, you can use the following functions:

Real-time integration with R/3

Full pegging

Freely definable macros

Single- and multilevel infinite heuristics

Capacity leveling

MILP Optimizer

Capable-to-Match (CTM)

Deployment

One-step deployment

Transport Load Builder (TLB)

Vendor-Managed Inventory (VMI)

There are a number of standard key figures that are saved to liveCache orders which you can include in an SNP planning area by choosing Edit SNP standard.

The prerequisites for saving a key figure to liveCache orders are that:

You have created time series objects for the planning area (even though you are saving to orders).

When creating the planning area, you either specified a Category or Category Group or entered a Key figure semantic prefixed with LC.

When creating the planning area, you made no entry for the key figure in the field InfoCube.

For an example of Supply Network Planning using the orders storage method, see planning book 9ASNP94, planning area 9ASNP02 (transaction /SAPAPO/SNP94) in the standard APO system.

InfoCubes

The data is stored in an InfoCube in the Administrator Workbench. This storage method is suitable for data backups, old planning data, and actual sales history. In Demand Planning, actual sales history is used to generate master data and as the basis for forecasting.

In APO Demand Planning you can only read from InfoCubes if you have specified the InfoCube in planning area configuration. For details of how to save data to InfoCubes see Exchange of Data Between InfoCubes and Planning Areas.

To specify an InfoCube from which the key figure is read in all versions:

1. Select the planning area in S&DP Administration.

2. Choose Change in the context menu.

3. On the Key figs tab page choose Details.

4. Select the relevant key figure and enter the InfoCube in the relevant field.

It is possible to use different InfoCube for different versions. Continue as above up to step 3. In Step 4 do not enter an InfoCube. Choose . A dialog box appears, in which you enter the InfoCube for each version. After you entered the necessary information, choose to save the data and return to the previous screen. You can see that such data has been entered by the icon.

Extracting Data from a Planning Area

There are two purposes for which you might follow this procedure:

For ad hoc reporting for planning area data

To save data persistently to the database

Procedure

1. Generate an export Data Source for the planning area. To do so, proceed as follows:

a. On the SAP Easy Access screen, choose Demand Planning ( Environment ( Administration of Demand Planning and Supply Network Planning.

b. Select the planning area and, in the context menu, choose Change/Display.

c. In planning area maintenance, choose Extras ( Generate Data Source.A dialog box appears in which you enter a name for the data source.

d. Choose Execute.

A screen with details for the data source appears.

e. Specify the fields that you want to be able to select later for reporting purposes. This step enables you to limit a query to specific objects or ranges of objects. Your selection here does not influence the fields that are included in the export structure. Select the Suppress field indicator for the fields (InfoObjects) that you do not want to transfer.

The number of fields that you transfer directly affects performance. Therefore, we recommend that you only transfer those fields that you require for reporting purposes in the InfoCube.

The field for the planning version is selected by default; you cannot deselect it. This means that you must enter a planning version in the InfoPackage later.

f. Make a note of the DataSource name.

g. Choose Save.2. Replicate the DataSource. To do so, right mouse click the source system and choose Replicate DataSources in the Data Warehousing Workbench. In this case, the source system is the system in which you are performing Demand Planning. For example, if you are planning in the SAP SCM system, client 002, the technical name of the source system is APOCLNT002.

When the system messages at the bottom of your screen cease, a background job is triggered. Check in the job overview that this job has finished before proceeding to the next step.

3. In the Data Warehousing Workbench, you are still in the source system view. Right-click the source system and choose DataSources Overview in the context menu.

4. Assign an InfoSource to the DataSource: To do so, proceed as follows:

a. In the DataSource overview under Data Marts, select the DataSource and choose Assign InfoSource from the context menu.

b. In the dialog box, choose Create.

c. In the next dialog box, enter a name and a short description for the InfoSource.

d. When the InfoSource has been created, choose Enter.

e. Answer the system prompt with Yes.

This saves the InfoSource/DataSource assignment.

If the above procedure is unsuccessful, use the following alternative:

Switch to the InfoSource view.

Create an InfoSource (right-click a suitable InfoArea and choose Create InfoSource).

Right-click the InfoSource and choose Assign DataSource from the context menu.

A dialog box appears with an overview of all DataSources in the Data Mart, including the export DataSources you have generated yourself.

Select the DataSource you created in step 1.

5. In the Data Warehousing Workbench, branch to the InfoSource view.

6. Right-click the InfoSource that you have just created and choose Change.

The screen in which you can specify the assignment of the communication structure to the transfer structure appears. You see the communication structure in the upper half of the screen and the transfer structure in the lower half. Some of the assignment information is proposed by the system. You must fill in the missing information.

This is another opportunity to remove superfluous InfoObjects from the communication structure. See also step 1.

7. Define the assignment of the communication structure to the transfer structure. To do so, proceed as follows:

a. In the lower half of the screen, enter the source system and the DataSource for the transfer structure.

b. On the Transfer Structure tab page, copy the objects from the DataSource to the transfer structure (from right to left).

c. Click the Transfer Rule tab page.

d. Check where the assignment of transfer structure fields to communication structure InfoObjects is not proposed by the system.

e. Where the assignment has not been proposed:

Include new InfoObjects in the communication structure in the upper half of the screen.

In the lower half of the screen, select the new InfoObjects in the communication structure on the left and copy the InfoObjects to the appropriate fields in the transfer structure on the right.

f. Choose Activate.

8. If you need an InfoCube to carry out reporting with a BI front end, create an SAP Remote InfoCube, specifying the InfoSource that you created in step 4 as the InfoSource, Otherwise, see the note below.

9. Activate the SAP Remote InfoCube.

Result

In the SAP Business Explorer Browser, you can now create queries based on this SAP Remote InfoCube. See also Ad Hoc Reporting on Data in a Planning Area

If you want to copy planning area data to an InfoCube for backup purposes or to save old planning data, create a basic InfoCube during step 8 (for example, by running program /SAPAPO/TS_PAREA_TO_ICUBE) and proceed as you would when uploading data from an ERP system or a flat file.

Tools for Extraction from Planning Areas

SAP provides a group of tools for checking and working with DataSources and other objects used in conjunction with planning areas.

Most of the functions available here are also available in other transactions, in particular in the Data Warehousing Workbench and in Administration of Demand Planning and Supply Network Planning. The data extraction functions described here has been bundled together for ease of use. DataSource Management

Generate DataSource

You use this function to generate a DataSource. This is the existing SAP APO function that you can also access from the context menu for a planning area under Generate Export DataSource.

You can only create one DataSource for each basis planning object structure and each aggregate assigned to a planning area.

You can choose any characteristic to be used for selection purposes. The characteristic 9AVERSION for the planning version is always used for selection and cannot therefore be changed here. You cannot use key figures or units for selection purposes.

You must enter the version in the selection when you call up the DataSource. Otherwise, the system issues an error message.

You use the Suppress field indicator to exclude key figures from a DataSource. These key figures are not extracted. This reduces the amount of data to be handled, and thus improves performance.

For performance reasons, we recommend that you only use export DataSources for extracting data from liveCache. You can extract key figures from an InfoCube directly by creating an export DataSource in the Data Warehousing Workbench.

For technical reasons, extracting data from planning areas to InfoCubes using DataSources is only possible with full uploads. However, you can use Data Store objects to simply update the changes. For more information, see Updating InfoCubes Using Data Store Objects.

Change/Display DataSource

This function allows you to change or display a DataSource using the same screen as above.

Check DataSource

This function runs a consistency check on the selected DataSource and displays a log if errors are found.

Repair DataSource

This function attempts to repair errors found in the above checks.

Test DataSource

You can use this function to test data extraction using the selected DataSource.

Restrictions

Do not use F4 help.

The system uses the internal representation of characteristic values. This means:

When entering numeric characteristic values, use leading zeros, if necessary

Enter dates in internal formal, that is, YYYYMMDD, YYYYMM, YYYYWW, for example

Assigning DataSources to InfoSourceThe system automatically suggests a name for the InfoSource when you make the assignment in the Data Warehousing Workbench. The InfoObjects from the DataSource are then automatically assigned to the InfoSource per default. On the dialog box that appears, the name is in the Applicant Proposal field and the corresponding indicator is selected by default. If you want to use another name for the InfoSource, choose others and then . In this case, some InfoObjects may not be transferred automatically from the DataSource.

This function is only available for DataSources that were created in release 4.0 or after release 3.0 SP 22, or after release 3.1 SP 9. If the DataSources were created before these releases, execute the function Check DataSource and then the function Repair DataSource as described above.

Virtual Provider Management

You use these functions (ad hoc reporting) to check and test Virtual Providers.

Information About Virtual Provider

This function provides information about the selected Virtual Provider, such as the names of the objects involved (DataSource, InfoSource, planning area, for example), the initialized versions, and the number of characteristic combinations.

Virtual Provider Consistency Check

You can use this function to run a consistency check on the selected Virtual Provider. The system displays a log if errors are found. For example, the system checks if the same InfoObjects exist in the planning area and the Virtual Provider.

Test Virtual Provider Automatically

This function chooses an existing characteristic combination and reads it from the planning area. It then checks for the same characteristic combination in the Virtual Provider. If the characteristic combination exists in both objects, it reads the data for all key figures in one period from the planning area and the Virtual Provider. If the values of the individual key figures are the same in the planning area and the Virtual Provider, the system completes the test successfully.

A log is produced in which the various steps are documented. You can find details of most steps in the long texts.

Start the Report Monitor

This starts a Box query in the SAP APO environment (does not use Microsoft Excel). You can use it to test queries for basic InfoCubes and Virtual Providers. Other functions are also available for testing queries.

Basic Cube Management

You use this function to generate a Basic Cube based on a planning area. You can use Basic Cubes for backing up data and for reporting purposes.

This function only generates the InfoCube. It does not generate other objects required for data extraction, such as DataSources or InfoSource. Similarly, it does make any assignments.

Activities

To access the tools described here, call the planning area maintenance. There, choose Extras ( Data Extraction Tools and then one of the following functions:

To call Data Source management, choose DataSource management.

To call Virtual Provider management, choose Ad-Hoc reporting.

To generate a basic Info Cube, choose Data backup.

Updating InfoCubes DirectlyYou can update an existing InfoCube directly from the planning area without Data Store objects. This results in better performance.

If you use this procedure, the system deletes the contents of the InfoCube before it creates a backup of the planning area.

Prerequisites

The InfoCube, DataSource, InfoSource, and update rules already exist. For information about how to create these objects, see Extracting Data from a Planning Area, DP Data Mart, and the subordinate topics.

Procedure

1. Create an InfoPackage for the InfoSource. To do this, select the InfoSource for the source system on the InfoSource screen of the Data Warehousing Workbench.

2. Go to the Data Targets tab page. Here, the following methods are available for deleting data while adding new information to the InfoCube:

To delete all the data in the data target before uploading the current data, select the relevant data target and set the Delete entire content of data target indicator.

Since the system does not check the existing data before deleting, this is the quicker method. However, data can be lost if problems occur during the update.

To delete data selectively, click the icon in the Automatic loading ofcolumn. (This icon is either or depending on whether entries have already been made or not).

A dialog box appears in which you can restrict the selection conditions.

3. Proceed with the update as usual.

The settings that you make in the InfoPackage can be critical for performance. For more information, see SAP Note 482494.

After your update process has run smoothly, update the data directly in the data target without using the Persistent Staging Area (PSA). This improves performance.

Updating InfoCubes Using Data Store Objects

Extracting data directly has the disadvantage that the complete data set is copied to the InfoCube at each update. The following procedure allows you to update the data in an InfoCube without adding superfluous data.

You can also use this procedure for uploading data from flat files.

The procedure that is described here using Data Store objects can be time consuming. Therefore, we only recommend that you use it if you require delta functionality. For most purposes, it is sufficient to delete the contents of the InfoCube before conducting a full update. For more information, see Updating InfoCubes Directly.

Prerequisites

You have generated an export DataSource for the planning area (see Extracting Data from a Planning Area).

Do not create any update rules for an InfoCube that has an InfoSource as the data source.

Procedure

1. If necessary, replicate the DataSource. To do so, you can use the following options in the Data Warehousing Workbench:

Select the source system in the source system overview and choose Replicate DataSources in the context menu. This replicates all data sources in the source system.

Select the data source in the DataSource overview and choose Replicate Metadata in the context menu. This replicates just the one DataSource.

2. Create an InfoSource and assign the data source to it. To do so, choose your application component on the InfoSource page of the Data Warehousing Workbench. In the context menu, choose Create InfoSource. On the next dialog box, select Transactional Data. Another dialog box appears. Enter a name and description for the new InfoSource and choose Enter. In the tree, select the new InfoSource. In the context menu, choose Assign DataSource. On the dialog box that appears, enter the source system. A list of DataSources appears. Select the required DataSource. Choose Enter.

Alternatively you can remain in the DataSource overview. An icon indicates that no InfoSource has been assigned yet. Either click the icon or choose Assign InfoSource in the context menu. On the dialog box that appears, enter a name for the InfoSource. Choose. On the next dialog box, enter a description and choose. Confirm the following dialog box. You can now maintain the InfoSource.

You can assign a DataSource to one InfoSource only.

3. Create a Data Store object in the InfoProvider overview of the Data Warehousing Workbench.

a. Enter a name and a short description. If required, you can also specify a DataStore object to use as a template. Choose . The Edit DataStore Object dialog box appears.

b. On the left-hand side of the screen, you can select InfoObjects, for example, InfoCubes or InfoObjectCatalogs. You can copy characteristics or key figures from these InfoObjects to the DataStore object. We suggest that you select either the InfoCube to which you want to copy the data, or the InfoSource.

c. Copy the characteristics to the key fields in the right-hand tree in the DataStore object and copy the key figures to the data fields. In both cases, use drag and drop. You might have to transfer the 0RECORDMODE InfoObject from the Business Content.

d. In the Settings branch of the DataStore tree, set the following indicators:

Set quality status to 'OK' automatically

Activate DataStore object data automatically

Update data targets from DataStore object automaticallye. Activate the DataStore object.For more information, see DataStore Object.

4. Create update rules for the DataStore object.a. Select the DataStore object in the data targets page (Data Warehousing Workbench).

b. Choose Create update rules from the context menu. The Create Update Rules screen appears.

c. Enter the InfoSource that you created in step 2. Choose . Edit the update rules as necessary.

Activate the update rules by choosing .

5. Create update rules for the InfoCube as above, but with the DataStore object as the data source.

6. Create an InfoPackage for the InfoSource. In contrast to the normal procedure, on the Processing tab page, set the Only PSA and Update subsequently in data targetsindicators. Start or schedule the data load. For more information, see Upload Process.

Planning Book

A planning book determines the content and layout of the interactive planning screen.

Use

You use planning books in Supply Network Planning (SNP) and Demand Planning (DP). They allow you to design the screen to suit individual users planning tasks. A planning book is based on a planning area. There is no restriction on the number of planning books you can have for a planning area.

Within a planning book, you can also define one or more views. Views allow you, for instance, to tailor the information displayed to various users (for example, displaying different key figures for different users).

Supply Network Planning comes with the following standard planning books:

9ASNP94 for traditional Supply Network Planning

9ASOP for Sales & Operations Planning (SOP)

9ADRP for Distribution Resource Planning (DRP)

9AVMI for Vendor-Managed Inventory

9ASA for scheduling agreement processing

9ASNPAGGR for aggregated planning and planning with aggregated resources

9ASNP_PS for planning that takes into account product interchangeability

9ATSOPT for optimization-based planning that takes into account time-based constraints

9ASNP_SSP for safety stock planning

9ADRP_FSS for planning with the deployment heuristic with consideration of demands in the source location

We recommend that you use the standard planning books for Supply Network Planning. If you need to create additional planning books, you should use standard books as templates. To create your own planning books, from the SAP Easy Access menu, choose Supply Network Planning ( Planning ( Interactive Supply Network Planning. Then choose the Design icon and Create new planning book.

If you create additional planning books, you can define the following elements:

Characteristics

Key figures and other rows

Functions and applications that can be accessed directly from this planning book

User-specific views for the planning book, including initial column, number of grids and accessibility of the view for other users (there is no limit on the number of views you can have within one planning book.)

You can use context menus in interactive design mode to configure these and additional elements of the interactive planning screen (such as the position of columns and rows, the use of colors and icons in rows, the visibility or not of the rows, the appearance of the graphic, and macros).

Planning Book Maintenance

Supply Network Planning (SNP) offers a variety of standard planning books (and planning views) for the different planning methods. However, you can also create your own planning books. We recommend that you use the standard planning books as templates when you create your own planning books.

Prerequisites

You have created a planning area.

You have created a planning buckets profile.

Process Flow

1. On the SAP APO Easy Access screen, choose Demand Planning ( Planning ( Interactive Demand Planning. On the interactive desktop, choose Design and Planning Book.

2. You then work through the tab pages guided by the planning book wizard and choose Continue after entering the relevant data on each tab page.

a. Planning Book tab pageOn the Planning Book tab page, you give a longer description for the planning book, the planning area on which the planning book is based, the SNP functions (for example, Supply Network Planning, Capacity Planning, and so on) to be included in your planning book, and, if you are also using Demand Planning, the views to which you can navigate.

b. Key Figures tab pageOn the Key Figures tab page, you specify which key figures you want to use in this planning book. To add all key figures from the planning area to the planning book, choose the Add all key figures icon below the planning area window.

The planning areas you are using (such as 9ASNP01 or 9ASNP02) determine which key figures are transferred to your planning book.

c. Characteristics tab pageOn the Characteristics tab page, you specify which characteristics you want to use in this planning book. You can add all characteristics to your planning book or choose individual characteristics only.

d. Key Figure Attributes tab pageOn the Key Figure Attribute stab page, you define the attributes of specific rows in the planning book. When you create a planning book, this tab page is available in Display mode. The tab page is available in Change mode when you edit a planning book.

On this tab page, you can also create auxiliary key figures that are not stored in the database but that can be displayed in interactive planning. You can use auxiliary key figures with macros, for example.

You can also define that a key figure refers to a specific planning version. The implication of this is that you can work with different versions of a key figure in the same planning book. If you carry out SNP planning with different planning versions, you can compare the results in interactive SNP planning.

If you specify that the key figure refers to a variable planning version, you can select the planning version for the key figure in interactive SNP planning.

e. Data View tab pageOn the Data View tab page, you create one or more data views for the planning book. You need at least one view to use the planning book. You can have multiple views for multiple users within one planning book. In the data view, you specify the planning horizon.

f. Key Figures tab page (after Data View)On the Key figures tab page (after Data View), you specify which key figures in the planning book the users of this particular data view use.

3. When you have finished working through the tab pages and wish to save the planning book, choose Complete and confirm any messages that may appear.

Advanced Macros

Use advanced macros to perform complex calculations quickly and easily.

Macros are executed either directly by the user in interactive planning or automatically at a predefined point in time during a background job.

The definition of macros is optional.

You do not have to write macros yourself. Some stock level and days' supply macros are also delivered with the standard SNP planning books. You can create your own planning book for SNP using one of the existing books as a template, and copy the standard macros to the new book.

Integration

You create an advanced macro either when creating or chaning a planning book in Customizing, or in design mode of interactive planning. You can define a macro either for an entire planning book or for a specific data view.

Prerequisites

1. You have created a planning area.

2. You have created a planning buckets profile.

3. You have created a planning book with at least one data view.

Features

You can:

Control how macro steps are processed through control instructions and conditions.

Build a macro consisting of one or more steps.

Control how macro results are calculated through control instructions and conditions.

Use a wide range of functions and operators (see Operators and Functions in Macros).

Define offsets so that, for example, the result in one period is determined by a value in the previous period.

Restrict the horizon in which the macro is executed to a specific period or periods.

Write macro results to either a row, or a column, or a cell.

Write the results of one macro step to a row, column, cell or variable, and use them only in subsequent iterations, macro steps or macros.

Trigger an alert in the Alert Monitor showing the outcome of a macro execution.

To create authorizations for the creation and execution of macros, choose Tools ( Administration ( User Maintenance ( Roles from the SAP Easy Access menu. For more details see Authorization in Supply Network and Demand Planning.

Macro Builder Screen

When defining advanced macros, you work in a special desktop environment known as the MacroBuilder.

There are two methods of accessing the MacroBuilder:

From the SAP Easy Access screen, choose Demand Planning ( Environment ( Current Settings ( Macro Workbench. For more details, see Macro Workbench.

From design mode of interactive demand planning, choose MacroBuilder => Planning Book or MacroBuilder => Data View.

Structure

The Macro Builder consists of the several screen areas:

Macro elements in a tree on the top left Depot with parked macros on the bottom left

Keep all macros that you are not currently editing in the depot. This improves the performance when starting the Macro Builder.

Demand planning table (grid) in the top center

Processing area where you edit macros

Macro tree with the macro tools in the bottom center

To see the attributes of any item in the tree, double-click on the item.

Standard macros on the top right

Clipboard on the bottom right

Results area for semantic checks

Auxiliary table

The last two screen areas are hidden when you open the Macro Builder. You can make them visible by dragging the lower edge of the processing area upwards. Similarly you then drag the lower edge of the semantic check area upwards.

For more information on how to edit macros, see Definition of Macros in the Macro Builder.

Advanced Macro Structures

An advanced macro consists of one or more macro steps. To define the conditions under which individual macro steps are carried out, you use control structures. Each macro step consists of one or more calculations. To define these calculations in the macro tree, you use calculation structures.

Structure

A macro can comprise of up to 4 levels. The following figure shows a simple

Example:

1. Macro level

This is the top level and consists of the macro name only.

2. Step level

At this level you can enter either a step or a control structure. A macro must contain at least one step. A step contains a calculation or series of calculation. A step is also an iteration loop. The calculation or operation is repeated over a predefined period, if you work with rows.

3. Result level

At this level you specify the macro object to which the results of a calculation or operation is written. This can be a key figure in the planning book, or an element in the auxiliary table that you use to store an intermediate result temporarily. At this level you can also enter control structures, action boxes, documents, procedural messages, or alerts.

4. Argument level

At this level you enter the calculations or operations. Similarly conditions are defined at argument level, if the control structure is entered at result level.

The following figure is a concrete example of the structure above. The macro calculates the adjusted forecast by adding the manual adjustment to the sales forecast. This is done for the period of one year in the future.

Control Structures

As mentioned above, you use control structures at either step level or result level. In the first case you can control structures to decide which step to execute depending on which conditions are satisfied.

The statements that are available here are based on the corresponding ABAP statements, such as IF, DO, CASE, WHILE and are similar in most programming languages. For further information see Controlling the Program Flow. Not all ABAP statements are supported in macro control structures.

There are more options when working at the step level than the result level. For instance, you can use CASE WHEN structures to branch to different steps depending on the value of a variable or key figure.

The following is an example of a macro that makes extensive use of control structures. Note the level of the various objects. For information on the functions used, see Functions for Info Objects and Planning Book.

Calculation Structures

You use calculation structures not only to execute calculations but also to carry out other actions in which a value is not directly assigned to a key figure or variable. Examples of such actions are:

Triggering an alert

Displaying a message or dialog box

Sending an e-mail

Calculation structures always consist of at least one step.

In general a calculation step consists of a macro element at the result level followed by one or more elements at the argument level. A simple example is the second graphic above.

Using Macro Elements

To define macros, use macro elements in combination with macro tools (see Using Macro Tools) and drag&drop techniques (see Definition of Macros in the MacroBuilder).

Features

IconElementDescription

MacroUsed in Demand Planning or Supply Network Planning (SNP) to carry out complex or frequent planning tasks quickly and easily. You can execute a macro in interactive planning or as part of mass processing.

BAdI/User Exit MacroA complex macro used in Demand Planning or SNP and that you implement in ABAP yourself. You can use this Business Add-In (BAdI) in a collective macro.

StepA macro step consists of one or more macro calculations or macro activities. For each macro step, you define how much iteration of the macro calculations or macro activities are to be performed; that is, the area of the table to which the macro calculations/activities apply.

The sequence of the macro calculations/activities in a step is not significant; that is, a calculation/activity cannot use the results of another calculation/activity within the same iteration.

Control statementUsed together with a condition (see below) to control macro steps and calculations.

ConditionUsed for the definition of a logical condition that, together with a control instruction, is used for macro steps and calculations.

RowRow in the table. You can assign the results of a calculation to a row (a results row). A row can be used as an argument in a calculation. A row can also be an argument in a logical condition (an argument row). The calculation is repeated for all the cells that lie within the period defined for the step.

ColumnColumn in the table. You can assign the results of a calculation to a column (a results column). A column can be used as an argument in a calculation. A column can also be an argument in a logical condition (an argument column). As for rows, calculations are repeated for all the cells in the column.

CellCell in the table. You can assign the results of a calculation to a cell (a results cell). A cell can be used as an argument in a calculation. A cell can also be an argument in a logical condition (an argument cell).

AreaSeveral adjacent cells in the table. You can assign the results of a calculation to an area. Use an area if the function of a macro step changes several cells in one iteration. For example, the function CPY copies values from one area to another area, such as to the auxiliary table. In the "copy to" area, you select only the top left cell of the area before pasting. Another use of areas is in mathematical operations, for example where a sum is formed over a range of cells or a maximum value is found.

Auxiliary tableHolds data that is used subsequently as part of the macro execution. Use the auxiliary table to retain intermediary results for subsequent calculations, or to collect data for calculations.

The same elements are available in the auxiliary table as in the planning book table.

The system differentiates between a local auxiliary table and a global auxiliary table. A global auxiliary table is available in every macro book. If you do not set the Do Not Initialize Auxiliary Table indicator, the system uses a local auxiliary table for this macro and you cannot access the global auxiliary table. You can use the global auxiliary table if you set the indicator Do Not Initialize Auxiliary Table.

Values in an auxiliary table cannot be saved. To save them, you must assign the values to elements in the planning book table.

Operator/functionSymbolizes:

1. Comparative operators such as < or >

2. Arithmetic operators such as + or -

3. A wide range of complex functions that enable you to manipulate data in your planning book. These functions include several useful DP and SNP tools.

See also Operators and Functions in Macros.

FunctionYou define functions for a rectangular section of the table. The section borders either are fixed or move with each iteration.

If an "$" appears next to a function in the macro tree, this means that the coordinates of the section are fixed and are not relative to the iterations.

Alert/statusYou can use this element to send an alert to the Alert Monitor: For example, you can define an alert that is triggered if a specific condition is met (such as demand > 1,000 boxes).

A status alert displays the status after the execution of the macro. Any previous statuses are deleted from the Alert Monitor. If you run a macro twice, you see only the latest alert.

A message alert displays the current status after the execution of the macro, and also any previous statuses. If you run a macro twice, you see two alerts.

You assign one of the following priorities to an alert:

1. Error

2. Warning

3. Information

You also assign a text to an alert. This is the text that appears in the Alert Monitor; for example, MAPE is too big: &. In the Alert Monitor, the actual value of MAPE appears in place of the &.

You can assign the alerts that are generated in a planning book/ data view to another planning book/data view. This is particularly useful when working with background jobs.

Process messageUsing this element, you can have the system issue a message. You define the message text yourself. In interactive forecasting, an information message appears in a dialog box, while warning, success and error messages appear at the bottom of the screen. In mass processing, the messages are shown in the job log.

Note that if the system issues a procedural message with type Warning or Error, it also terminates the macro. The background job is not terminated. Any changes that the macro has already made are revoked.

Action boxUse an action box if a macro function does not return a result or if you do not want to assign the result of a macro function to an element of the planning table or auxiliary table. Always use the following functions in an action box:

1. HELPTAB_CLEAR

2. OUTPUT_POPUP()

3. REPORT_SUBMIT()

DocumentUsing this element, you can have the system send an email. The recipients can be a single internal user, a distribution list, or an external user. There are options for sending to Internet addresses, for sending regular or express mails, and for including the demand planning table as an attachment to the email.

If you do not enter a recipient, a dialog box requesting the details appears when the macro is run.

You can also use a variable to create the address at runtime. Enter LAYOUTVARIABLE (variable name) in the recipient field.

Using Macro Tools

Use macro tools in combination with macro elements and drag&drop techniques to define macros. For more information about macro elements, see Using Macro Tools and for more information about drag&drop techniques, see Definition of Macros in the MacroBuilder.

Features

SymbolToolUse

AttributesDisplay or change an element's attributes.

Select the element, whose attributes you want to change or display. Click on the icon. A dialog box with the attributes of the selected element appears.

This has the same effect as double-clicking on the element or selecting it and choosing Attributes from the context menu.

See also Macro Attributes.

DeleteDelete an element in the macro tree. The deleted element is automatically copied to the macro clipboard.

CheckCheck the syntax of one macro or of all macros in the tree.

GenerateGenerate one macro or all macros. You must generate a macro before it can be executed.

Active/inactiveActivate/deactivate an element in the macro tree. For example, use this tool to check individual sections of complex macros by deactivating some sections and then checking the remaining section(s).

Copy to macro clipboardCopy an element in the macro tree to the clipboard.

PastePaste the contents of the clipboard to the macro tree.

UndoUndo the previous step. You can undo up to 20 steps.

RedoRedo the step you have just undone. You can redo up to 20 undone steps.

Expand allExpand all nodes in the macro tree.

Collapse allCollapse all nodes in the macro tree.

Save layout settingsSave the MacroBuilder's new layout after you have adjusted the size of some of the screen areas. The new screen layout is then retained and appears the next time you open the MacroBuilder.

Definition of Macros in the Macro Builder

There are two basic methods of working in the Macro Builder:

The context menu

Drag&Drop techniques

You define macros in planning books in combination with macro elements and macro tools.

Activities

Context Menu

You use the context menu primarily in the macro tree section. If you select an existing macro element (this can even be at the Macro level), the system displays a menu with all the available options for this element at the current position in the macro. Each macro element is listed separately.

TerminologyInsert Enter the new element before the selected element

Attach Enter the new element after the last element at the same level

Add Enter the new element after the selected element at the next level

The context menu offers two options that are not available with Drag&Drop:

Active/inactive

Activate/deactivate an element in the macro tree as in the macro toolbar.

Breakpoint On/Off

Sets a breakpoint. This means that during execution of the macro the macro stops at this element. A dialog box appears in which the value of the element is displayed. You continue processing by choosing .

These two options are for use when creating macros, particularly for debugging complex macros.

Drag & Drop

Use Drag & Drop to do any of the following:

Add or insert any macro element in the macro tree

When you drop the element, the system offers you a choice of options if more than one option is available.

Move elements within the macro tree

Drag a macro from the macro tree to the standard macros screen area

Change the sequence of the standard macros

Copy a part of the macro tree to the clipboard

If the icon appears, you cannot carry out the action for this element. If the + icon appears, you can carry out the action for this element. In this case, you can release the left mouse button.

For more information on the different areas of the Macro Builder screen, see Macro Builder Screen.

Menu Functions in the Macro Builder

Use

To be able to use some of the MacroBuilder menu functions, you need some additional information, which you can find below. The functions described here are available to you if you access the MacroBuilder as a stand-alone application (Demand Planning or Supply Network Planning ( Environment ( Current Settings ( Macro Workbench) as opposed to through interactive planning.

Features

Menu OptionFunction

Edit ( Import Macro(s)Imports either all macros or one macro from another planning book.

After the import, check the macros in the target book. This is especially necessary if the source book contains key figures that are not in the target book. If required, make the appropriate adjustments. Then activate the macros in the target book.

Edit ( Edit User FunctionAdds a function that you have programmed in your own system to the list of possible operators/functions in the MacroBuilder.

You have programmed the function and defined the corresponding interface in transaction SE37. In the dialog box, which appears after choosing the menu entry, enter the technical name of the user function. Choose Enter. Another screen appears in which you select the interface parameters of the function. You must select the exact same interface parameters that you used when defining the interfaces of the user function.

Note that the parameters GRID_LINES, GRID_COLS, GRID_CELLS, GRID_FIXED_LINES; GRID_FIXED_COLS and GRID_FIXED_TAB are obsolete and should no longer be used. If you use one of these parameters in a user function, the performance may suffer when a macro is executed that uses this user function.

Settings ( Expert Mode On/OffIf you turn the export mode off, certain fields are not visible on the attribute screens of macro elements.

Utilities ( VersionsSee Macro Book Versions

Utilities ( Test MacrosA new screen appears with an empty test planning book. You can enter test data in the grid and select a macro that has been generated. Choose Execute Macro to test the macro. Similarly you can test the default macros by choosing the Default button.

For more information, see SAP Note 893691.

Operators and Functions in Macros

You enter functions in the following manner:

1. Drag and drop the operator/function icon to the relevant line in the macro work area. A dialog box appears.

2. On the bottom line choose the function you want to insert by using the pull-down box or F4 help. The function automatically appears in both lines. On the top line you can add alphanumeric arguments to the functions.

For more details of individual function see the following topics according to the type of function you want to use:

Mathematical Operators and Functions

Statistical Functions Logical (Boolean) Functions

Functions for Info Objects and Planning Books

Date Functions General and Planning Table Functions

SNP Functions

3. If you want to add another macro element (an icon) to your macro, do not close the parentheses (in other words delete the right-hand parenthesis) and choose . Enter the macro element as usual. After you have made all the necessary entries, finish the function by adding ) as the last line.

You can nest macro functions within each other. In the following example the macro step converts the value of row 1 from the internal unit of the current resource to the external unit co