Building ABAP Program sometimes you need store your maintain configuration data for your ABAP Program in the Z Table with maintenance. Definetely that is the best approaching but if you have only some of configuration data, you can use Sets for your configuration data.

What is Sets in SAP

Sets is a list of data which is widely used in report writer, substitution/validation and ABAP Program. So maintaining ABAP Program to be efficiently and effectively.

You don’t need hardcode in ABAP Code only for validation like IF GV_MART = ‘001’, but you only need put syntax IF GV_MART IN ZSET. and you can add or delete your value of Sets later without changing your ABAP Program.

There are 4 Types of Sets in SAP

1.Basic Set

This is basic set is use to kept value for one dimension in one set. for example you can save value of VBAK-AUART ZIN, ZPP in one set.

2.Single Set

This set is used to build hierarchy so you can combining basic set into one set.

3.Multi Set 

This set is used to combine basic set or single set into one set.

4. Key Figure

This set is used for report painter.

How to create Sets in SAP

In this article i will show you how to create Basic Sets for Sales Document Type ( VBAK-AUART ) and use it in ABAP Program. Here the step.

1. Go to GS01 Transaction code.

how-to-create-set-in-sap

In this transaction please entered your Set Name and Table name that contain dimension set value, and choose Basic Set as Set Type and press ENTER.

The popup screen will appear, in this popup screen you need to entered name of field for this sample entered AUART and press ENTER.

how-to-create-set-in-sap-1

After you press ENTER. The next screen you can entered your value of set.

how-to-create-set-in-sap-2

You can display, maintain and delete Set SAP via GS02 ( Change ) , GS03 ( Display ) and GS04 ( Delete ).

Using Sets in ABAP

You can read SAP Sets value via G_SET_GET_ALL_VALUES or G_SET_GET_ID_FROM_NAME and G_SET_FETCH.

You can see debug result.

how-to-create-set-in-sap-3

Incoming search terms:

Leave a Reply

Your email address will not be published. Required fields are marked *