LOADING of ASSORTMENTS using BAPI from BODS
1. Introduction
An assortment is an object to which articles are allocated for a clearly defined time frame that is an assortment decides if a store, a distribution centre or a customer can receive certain articles at a certain period of time.
An Assortment
- Determines the articles that may be sold in a store at POS.
- Adding these articles to the article assortment that is assigned to this store’s distribution centre.
- Determines the distribution centres via which articles are distributed when stores are to be supplied from the warehouse.
- Determines the stores in which articles are to be sold at the point of sale.
- Determines the articles which are to be included in the customer‘s assortments.
2. Type of Assortments
Articles are assigned to assortment module either automatically or manually depending on type of assortment module used. There are two types of assortments: Local and General.
-
Local Assortments: Local assortment can be type A and type B. Type A is for stores and type B is for distribution centres. When user creates a site the system automatically creates a local assortment and then assigns it to the site. This local assortment is site-specific and cannot be assigned to another site. Each site has one local assortment created directly and can only be maintained in limited way in Assortment Processing transaction.
-
General Assortments: General assortments are type C assortments. They can be assigned to any number of Customers, and every Customer can be assigned several general assortments. If multiple assignments parameter has been set in Customizing, user can also use assortments of this type to assign stores and distribution centres.
3.Creation of General Assortments
Assortment for general purpose that is of type C needs to be created manually with transaction WSOA1.
Let us see how to create an assortment (ASS001) using WSOA1 transaction code.
There are 4 tabs which can be used to define an assortment. They are Basic data, Languages, Material group and Assortment users and correspondingly 4 tables in SAP WRS1, WRST, WRS6 and WRSZ.
For general assortment we need to provide Sales Organization, Distribution channel and selection of listing procedure is important .The table associated with creation of assortment in Sap is WRS1.
Language tab is used to maintain the description of the assortment and the language used.
This will get updated in WRST table in SAP.
In Mat. Groups tab, material groups which can be assigned to a particular assortment can be added. Any number of material groups can be included here.
WRS6 table in SAP gets updated when each material group are added here.
Assortment users determine the site or the store that belongs to a particular assortment.
WRSZ is the table associated with assortment users.
Finaly by listing articles to assortments, you determine which assortments and, therefore, which articles a store can buy and sell which means a site cannot buy or sell articles that are not included in any of its Assortments.
4. Loading of general Assortment using BODS
The function module BAPI_ASSORTMENT_MAINTAINDATA can be used to load data from BODS. This function module can be used create new assortment and change or delete existing material master data In order to delete e a data record 003 needs to be provided in the function field in the relevant structure.
Job in BODS for creating Assortments as shown in figure below.
Jobs are designed as like RDS jobs.
The first 4 conditional blocks are for loading the corresponding data into 4 staging tables from source files.
Each conditional flow is designed in such a way that it consists of 3 Data Flows for Mapping from source file, Validation and final one for Enrichment.
The data from 4 staging tables are mapped to BAPI_ASSORTMENT_MAINTAINDATA using the flow as shown below.
After the execution of job Assortment are created and WRS1, WRS6, WRST and WRSZ are the tables which are getting updated.
Pre load and Post load jobs can also be created from BODS for further validation.
- Preload Reports: Here the source file is compared with the final data in the staging table after enrichment. For each table in Sap which is getting updated there are 2 Data flows.
In the first Data flow is mapping the source file to staging table.
Second data flow is comparing the enriched data from the main job with the source file using join condition to generate preload reports
- Post Load Reports: Here the data which is loaded into SAP tables are compared with data used for loading.
First we need to extract corresponding data from WRS1 .WRS6.WRST AND WRSZ .
Next we need to compare these tables with data loaded using IDOCs.