Skip to main content

LOADING of ASSORTMENTS using BAPI from BODS

Published on 20 October 2020
SAP BODS BeginnersGuide

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.

SAP BODS BeginnersGuide
Fig 1 Create assortment

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.

SAP BODS BeginnersGuide
Fig 2 basic data in assortment

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.

SAP BODS BeginnersGuide
Fig 3 wrs1 table in sap

Language tab is used to maintain the description of the assortment and the language used.

SAP BODS BeginnersGuide
fig 4 languages

This will get updated in WRST table in SAP.

SAP BODS BeginnersGuide
fig 5 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.

SAP BODS BeginnersGuide
fig 6 mat. groups

WRS6 table in SAP gets updated when each material group are added here.

SAP BODS BeginnersGuide
fig 7 wrs6 table in sap

Assortment users determine the site or the store that belongs to a particular assortment.

SAP BODS BeginnersGuide
Fig 8 Assortment Users

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.

SAP BODS BeginnersGuide
fig 9 bapi_assortment_maintaindata from se37

Job in BODS for creating Assortments as shown in figure below.

SAP BODS BeginnersGuide
fig 10 job for assortment from bods

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.

SAP BODS BeginnersGuide
fig 11 data flow
SAP BODS BeginnersGuide
fig 12 mapping from source file
SAP BODS BeginnersGuide
fig 13 validation
SAP BODS BeginnersGuide
fig 13 enrichment

The data from 4 staging tables are mapped to BAPI_ASSORTMENT_MAINTAINDATA using the flow as shown below.

SAP BODS BeginnersGuide
fig 14 mapping to bapi
SAP BODS BeginnersGuide
fig 14. a . query combine
SAP BODS BeginnersGuide
fig 14 . b . query_generatebapi

After the execution of job Assortment are created and WRS1, WRS6, WRST and WRSZ are the tables which are getting updated.

SAP BODS BeginnersGuide
fig 15 wrs1 table in sap
SAP BODS BeginnersGuide
fig 16 wrs6 table in sap
SAP BODS BeginnersGuide
fig 17 wrst table in sap
SAP BODS BeginnersGuide
fig 18  wrsz table in sap

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.
SAP BODS BeginnersGuide
fig 19 preload reports flow

In the first Data flow is mapping the source file to staging table.

SAP BODS BeginnersGuide
fig 20 mapping of source file

Second data flow is comparing the enriched data from the main job with the source file using join condition to generate preload reports

SAP BODS BeginnersGuide
fig 21 generation of preload reports
SAP BODS BeginnersGuide
fig 22 preload report for loading into wrs1
SAP BODS BeginnersGuide
fig 23 preload report for loading into wrs6
SAP BODS BeginnersGuide
fig 24 preload report for loading into wrst
SAP BODS BeginnersGuide
fig 25 preload report for loading into wrsz
  • Post Load Reports: Here the data which is loaded into SAP tables are compared with data used for loading.
SAP BODS BeginnersGuide
fig 26 post load report flow

First we need to extract corresponding data from WRS1 .WRS6.WRST AND WRSZ .

SAP BODS BeginnersGuide
Fig 27 Extraction data from SAP tables

Next we need to compare these tables with data loaded using IDOCs.

SAP BODS BeginnersGuide
fig 28 generation of post load reports
SAP BODS BeginnersGuide
fig 29 post load report for wrs1
SAP BODS BeginnersGuide
fig 30 post load report for wrs6
SAP BODS BeginnersGuide
fig 31 post load report for wrst
SAP BODS BeginnersGuide
fig 32 post load report for wrsz

 

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.