You are on page 1of 16

Contents

Introduction .................................................................................................................................................. 2
Listing: ................................................................................................................................................... 2
Exclusion: .............................................................................................................................................. 2
Configuration steps ....................................................................................................................................... 3
Create the condition tables ...................................................................................................................... 4
How to add a field to the field catalog ...................................................................................................... 5
Create access sequence ............................................................................................................................ 7
Create new listing condition type ............................................................................................................. 9
Create listing procedure............................................................................................................................ 9
Assign the listing procedure to sales document type ............................................................................. 10
Create listing condition record ............................................................................................................... 12
Important Notes ...................................................................................................................................... 13
Listing / Exclusion Analysis Functionality ................................................................................................ 13
Analysis Steps: ..................................................................................................................................... 13



Introduction
In the sales document creation, you have an option of creating a list of articles that a specific customer
can buy as well as a customer cannot buy.
This functionality in SAP is known as Listing/Exclusion.
Listing - List of articles which customer can buy
Exclusion List of articles which customer cannot buy
Eg:
Listing:
Lets say you have activated this functionality for customer ABC. But you didnt list the article XYZ for
that customer. (Because he is no allowed to buy that article)
Now if you try to create a sales order for customer ABC with the article XYZ, system will issue below
error message.

Therefore user will not be able to create the sales order with that article.
Exclusion:
Same manner you can add that article to the Exclude list. Then system will give a different error message
saying;


Notes:
Whether to use listing or exclusion list is based on the number of articles that you want to exclude or
list.
Eg: If you have few articles that a customer cannot buy, then always advisable to have them under
exclude list rather than maintain all other articles in the listing list.
Now lets see how we can configure this functionality within SAP.

Configuration steps
Listing / Exclusion use the famous condition technique in SAP where you have procedure attached to the
sales document type with condition types, access sequence and condition tables with master record
creation.
IMG Path:


Create the condition tables
Use below option to create a new condition table

First check whether you can use existing condition tables provided by SAP. If it is not sufficient you can
create your own condition table for listing.
Go to menu / Create to create a new listing condition table

Enter condition table number required (Always make sure you enter a number between 501 and
999 for custom tables)
Double click on the correct fields that you want to include in to the condition table. Use Page
Up and Page down keys in the key board to search fields in the field catalog.
Once all required fields are move to Selected fields section, click on button to generate
the table.
Give a development package in order to create a transport request and to transport the table to
a different system later. (If you use $TMP as the package, table will be created as a local
object and you will not be able to transport it to any system)

You should be able to see the table generation log as follows.

In the same manner create all condition tables you need to include in to your access sequence
later.
If you dont have a field which you require in the field catalog, you have an option of adding it to the
field catalog as well. After adding it to the field catalog you can use those fields for condition table
creation.
How to add a field to the field catalog
IMG Path:

Before adding the above entry, you need to add the relevant field to the communication tables KOMKG,
KOMPG or KOMGG. Then system will allow you to enter same in the field catalog.
You can do that under below IMG path:

Once you add such a field, you need to fill those communication structures during sales order processing
using the user exits. Otherwise those fields will not be checked for listing/exclusion.
Refer below steps required to follow if you need a new field in the field catalog.
Following communication structures are relevant for listing and exclusion -
o KOMKG (Material listing header data)
o KOMPG (Material listing/material exclusion item data)
o KOMGG (Material listing/material exclusion - communication block)
Note:
The communication structure KOMGG combines KOMKG and KOMPG and contains all fields that can be
used for material listing and exclusion. If you enter a new field in KOMKG or KOMPG, that field will
automatically included in KOMGG.
New fields for material listing and exclusion are integrated in the following INCLUDES.
o Header data in KOMKGZ (INCLUDE in KOMKG, KOMGG)
o Item data in KOMPGZ (INCLUDE in KOMPG, KOMGG)
The routines for supplying the new fields in order processing are found in member MV45AFZA.
You can use following user exits:
o USEREXIT_MOVE_FIELD_TO_KOMKG (Header fields)
o USEREXIT_MOVE_FIELD_TO_KOMPG (Item fields)
A statement for supplying a new header field for material listing could be, for example:
o FORM USEREXIT_MOVE_FIELD_TO_KOMKG
o MOVE VBAK-FELDXY TO KOMKG-ZZFELDXY.
o ENDFORM.
Important:

New data fields must start with the letters "ZZ" or "YY". SAP has reserved these letters to
protect them against overwriting during a release.

Once condition table are created, we need to add those to the access sequence.
Create access sequence
IMG Path:

Create your own access sequence by clicking button
Enter you access sequence ID and the description

Highlight the line and double click on the Accesses node
Press button
Enter your condition tables with step number. (Please leave a gap between each step. This will
allow you to add another table in between in future. Like in pricing, you can use requirement
routines here as well.

Once you add the table, highlight the each table and click on the Fields node.
Important:
If you dont follow this step, those fields will not be properly added to the access sequence.

Save your access sequence
Create new listing condition type
IMG Path:

Create your listing type using button and assign the newly created access
sequence

Save your record

Create listing procedure
IMG Path:

Create your own listing procedure by clicking button

Highlight the procedure and click on Control Data node
Use button to add your own condition types to the procedure. You can add
requirement routines here as well.

Important:
Please keep a gap between your step numbers. This will allow you to add any other condition to the
same procedure in future.
Save your procedure
Now you have completed the listing procedure for your requirement.
Assign the listing procedure to sales document type
In this step you assign your new listing procedure to the sales document type.
IMG Path:

Assign your listing procedure against the sales document type.

Please make a note of the field Pro. This field plays very important role during listing condition record
execution in the ABAP Code. You have below options available.

Option Blank System will only check whether there is one condition that is valid in the
system. But it will not check whether the whole condition record is valid or not.
Lets say you have an access level 10 - customer and material group. And access level (20), with
customer and material.
In that case, lets say you have maintained a VB01 record with customer A300 and material group
F001 (Access level 10). And you have another record for same customer A300 for material AW01
(Access level 20). This material AW01 is having material group A001 and NOT F001
During sales order creation with the option BLANK in the Pro field, system found the access level 10
record with header fields only and then it will not even check whether material is valid with the material
group or not. From that point onwards system will not execute further.
Option B With this, system will validate the full condition record. For above example system
will find the condition record from access level 20 and not from 10
Create listing condition record
Transaction: VB01
Enter Listing type and press Enter key
Select the correct access level
Eg:

Maintain your condition record and save

Now if I try to create a sales order for my test article (AW01) system will allow me to create.
As my article AW01 is listed for customer A300, I can sell this article to this customer.
But if I use any other article (AW02), system should give me an error message.

As article AW02 is not listed for the customer A300, sales are not possible.
In the same manner you can use the Exclusion procedure as well.
Important Notes
In order to activate this listing functionality for a customer, you need at least to maintain a dummy
record. Once you maintain the dummy record, system will not allow you to create a sales order for a
article which is not listed.
Listing / Exclusion Analysis Functionality
Same like in condition analysis functionality in the sales order, you have listing/exclusion analysis as well.
But the main difference is, you will not find a button option like for conditions.
Analysis Steps:
Before enter the article in to the sales order, activate the listing/exclusion analysis functionality.
Menu path:

Once this function is set to ON, system will issue below message.

Now enter your article in the sales order items tab press enter key
System will automatically start the listing/exclusion analysis
Initially it will go to Exclusion analysis

When you press the button from that screen you will be directed to the Listing analysis.

From the detail analysis, you can find out why the article cannot be sold to this customer.





Author: Anupa Wijesinghe
E-Mail: anupaw@gmail.com / anupaw@learnsaptips.com
Website: www.learnsaptips.com
View my profile in LinkedIn
Follow me on Twitter


Disclaimer

This article is done based on my research and readings, unless otherwise stated. The views expressed
are my own and not of anyone else.
Author accepts no liability for the content of the articles in this website or for the consequences of any
actions taken on the basis of the information provided. Using this information is at the users own
discretion and responsibility.

You might also like