Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

What is a Set?

A Set is a flexible structure for organizing hierarchies and quantities. You can group values or value intervals in a set and several sets into a hierarchy.

For Example:

In SAP Materials Management, the materials are placed in different storage locations of a warehouse. Many a time, it is required to group these storage locations according to the types of material stored in the warehouse.
For instance, some storage locations are used for storage of Demo Materials, some are defined for Service Materials and some for returned stock etc.
In order to maintain such data, SAP has provided a methodology known as Sets.

Some examples of sets are shown in below images:

Storage Locations of Demo Stock grouped in set NP_SLOC_DEMO:


Storage Locations of Service Stock grouped in a set NP_SLOC_SERV:


Storage Locations of Returned Stock grouped in a set NP_SLOC_RETU:




Advantages of Using Sets

This is very helpful in reporting.
Say we have 20 storage locations. We might not want to display all the 20 locations, but want to show the data by forming 4 groups of 5 similar storage locations. One option to do this is hard coding, but that increases maintenance. So a better option is to use sets. Using sets makes sure that the storage locations can be added/deleted/maintained without changing the code. The quantity of materials in storage locations which belongs to the similar groups can be displayed as one column. If we seggregate the storage locations into 4 groups, then 4 sets are created and displayed as 4 columns on the report output.

More about Sets

Set IDs can contain letters, numbers as well as the special characters '_' (underscore) and '-' (hyphen). Please note the following:
  • The set ID should begin with a letter.
  • The set ID must not contain any blank characters.
  • You cannot use the names 'TRUE', 'T', 'FALSE', 'F', 'NOT', 'AND', 'NAND', ''OR' and 'NOR' as set IDs.
  • The system does not differentiate between upper case and lower case letters.
  • Sets whose name begins with a number are delivered with the system or are created by special applications. In general set maintenance, you cannot create them, you can only display, change or delete them. If the first number is 0, you can only display the set.



Useful Transaction Codes

  • Create set (GS01):
    • To access this function, the user must have create authorization for at least one authorization group.
    • To assign an authorization group to the set, the user must have create authorization for this authorization group.
    • To enter a set in a single-dimension set or a multi-dimension set, the user must have display authorization for the authorization group in the entered set.
  • Change set (GS02):
    • To access this function, the user must have change authorization for at least one authorization group.
    • To assign an authorization group to the set, the user must have change authorization for this authorization group.
    • To enter a set in a single-dimension set or a multi-dimension set, the user must have display authorization for the authorization group in the entered set.
  • Display set (GS03):
    • To access this function, the user must have display authorization for at least one authorization group.
    • To display a set that has an authorization group, the user must have display authorization for this authorization group.
  • Delete set (GS04):
    • To access this function, the user must have delete authorization for at least one authorization group.
    • To delete a set that has an authorization group, the user must have delete authorization for this authorization group.

In order to use a set with an authorization group in the Report Writer and other applications that use sets, the user must have display authorization for this authorization group.



Reading Sets in ABAP

The data stored in SET can be read through function module G_SET_GET_ALL_VALUES.
The FROM and TO values imported from the table parameter SET_VALUES gives the data stored in a set.

Example Code:




Summary

A set is a flexible structure which can group values or value intervals. It reduces the maintenance, and is advantageous for a business consultant or business user to add/remove/maintain the values from the specified groups.

2 Comments