• No results found

Variant Maintenance in SAP

N/A
N/A
Protected

Academic year: 2021

Share "Variant Maintenance in SAP"

Copied!
25
0
0

Loading.... (view fulltext now)

Full text

(1)

Contents

Introduction ... 2

How to create a variant ... 2

Using Selection Variable ... 10

Using “D- Dynamic date calculation” option ... 11

Using “T – Table variable from TVARVC” option ... 14

How to call a variant ... 19

How to change a variant ... 20

Option 1: Via save variant option ... 20

Option 2: Via table “TVARVC” ... 20

Option 3: Via transaction SE38 - Variant option ... 20

(2)

Introduction

Variant is a very commonly used feature in SAP to save set of input values for a selection screen of a program. You can execute the program easily by calling the relevant variant. Selected variant will contain all necessary values for your selection criteria.

For example, if you run a report in SAP, you will first get a selection screen, where you need to maintain the selection criteria to filter data out of SAP. If you have to fill same set of data every time you execute this report, then you can save those values as a variant.

And also similar setup is significantly used in large scale SAP customer to execute AFS allocation run, delivery note creation, etc in the background mode.

These variants can be used both dialog mode (Online) and background execution.

How to create a variant

In most of the executable programs you have an option of saving a selection variant. For example I will use transaction VL06G (Program - WS_MONITOR_OUTB_DEL_GDSI) to demonstrate the variant creation option.

 Call the necessary transaction else call the relevant program name in the transaction SE38  Fill all required fields

 Click on the save button

 Now you will jump to a “Variant Attributes” screen. You have below fields available in this screen

Description - Enter a name and description for your variant. You can use prefix “CUS&” or “SAP&” for system variants.

(3)

Only for Background Processing – Mark this field if you need your variant only for background jobs and not for online (Dialog) processing

Protect Variant – Mark this field if you want to prevent other users changing your variant. In such a case you will be the only person who can change this variant.

Only Display in Catalog – Mark this filed if you want to call your variant only in variant catalog and not via search help (F4)

(4)

System Variant – This field will be automatically flagged when you create a system variant (CUS& or SAP&)

Type – This field is used as an indicator to specify whether a specific field is a Parameter (P) or a selection (S). You will have to use “Type” when creating variables via table TVARVC.

(5)

Protect Field – Mark this field if you want to set it to “Read Only” in the selection screen. Field will be visible in the selection screen with content you have saved, but cannot be edited

Hide field – Mark this field in case if you want to hide it in the selection screen. Data you have entered in the field will be used for processing, but not be visible in the selection screen

(6)

For example, if I save my variant without a flag in this field for field “Shipping Point”,

And run the transaction with my variant, then the selection screen would be;

(7)

And run the transaction with my variant, then the selection will change to;

Save field without values – If you mark this field, then the system will ignore the values which you have saved in the variant once it is imported to selection screen

For example, before save my variant, I maintain “A300” as my shipping point. The flag was not set in the variant. Just for identification purpose I will also mark the “Protect field” as well. See below for my variant;

(8)

Now when I execute the transaction with this variant, my selection would be;

Now I will change my variant with the flag in the field “Save field without values”. Therefore now my variant is;

(9)

Now when I call the transaction with this variant, my selection screen will change to;

As per the definition system has ignored the values I saved in my variant.

Switch GPA off – This field is used for the purpose of filling values from the memory ID of the user. This is not active for background processing

Required Field – Mark this field if you want to set a mandatory flag in the selection screen. For example; if I mark this field in my variant as shown below;

(10)

In the output screen, “Shipping point” will become a mandatory field

This feature is very commonly used to avoid user error.

Using Selection Variable

Selection Variable / option / Name of the Variable – These fields are used to specify variable values in the variant.

(11)

This is a very handy tool introduced to variants specifically to propose dynamic dates in the variant. This feature is used to run AFS allocation run, delivery note creation in background mode.

Using “D- Dynamic date calculation” option

Let’s say you want to run this program in background mode and the selection date “Planned Goods movement date” should be set to today’s date (System date). In other words, every day when the background job starts running with the variant, this date field should be automatically set to “System date”. This can be easily achieved using variable option.

What you need to do;

 Go to the line which contains your respective date field

 Under column “Selection variable” set “D – Dynamic date calculation” flag

(12)

Note:

(13)

 Save the variant.

 Now when you call this variant again anytime, system will automatically set the system date in to this field.

Eg:

 Now let’s say you want to consider 5 days from the system date. In such a case, you can set the variant as below;

 Save the variant.

(14)

The date was calculated automatically based on the variable values in the variant.

Using “T – Table variable from TVARVC” option

This option is most commonly used for background processing. With this option, you don’t have to create a new variant or change the existing variant every time when you need to do a minor change in your variant. You can simply change the values stored in the table “TVARVC”.

Table – TVARVC as below fields;

You can maintain entries in this table via transaction STVARV.  Call the transaction – STVARV

 Since we need to add selection variable, go to the tab (This is same as “P” or “S” which you saw under “Type” field in the “Variant Attributes” tab)

(15)

 If you’re in display mode, change it to edit mode using button

 To add a new entry in to this table, click on the button  Give a name to your variable under field “Name”

 If you have to range to specify for your field, you can do it under “Lower Limit” and “Upper Limit” columns

 Since I am planning to use this variable for my shipping points, I will maintain it under “Multiple

(16)

 Maintain relevant values

 Save the variable using button

Now go back to the transaction and maintain the data you want and press the in the selection screen to call the save variant option

(17)

 For the field “Shipping Point” under column “Selection variable” select option “T”

 Now press “F4” under the field “Name of the Variable” to select the newly created variable with shipping points

(18)

 Finally my variant looks like below;

 Save the variant using button

 Now let’s run the transaction with my variant

 As you see, now shipping point field is filled with values out of the variable “ZAW1” which I created in the table “TVARVC”

(19)

How to call a variant

 In the online mode you can use button in the selection screen to see all variants save for the transaction

(20)

How to change a variant

You have 3 options to change an existing variant.

Option 1: Via save variant option

 Call the transaction with the variant you need to change

 Maintain new values for your variant and press the save button  From the “Variant Attributes” screen press the save button again  Select option “YES” to override values of your old variant

Option 2: Via table “TVARVC”

If you have any variables maintained in the table “TVARVC” and you need to change them, call the transaction “STVARV”

 Change the variable value according to your new requirement  Save the variable

When you call the variant in the next time, system will include all changes out of that variable in to selection screen

Option 3: Via transaction SE38 - Variant option

For this you need to know the relevant program name of you transaction.  Call the transaction SE38.

(21)

 Press “F4” under field “Variant” to select your variant

 If you want to change any value of you variant, click the option ”Values” and press the button “Change”

(22)

You will jump to the selection screen to change values

 If you want to change any attribute of the variant, select the field “Attributes” and press the button “Change”

(23)
(24)

Table where variants are stored

All variant are stored in the table – VARID It contains below fields

(25)

You can use the function module – “RS_VARIANT_CONTENTS” to get the values of your variant.

Author: Anupa Wijesinghe

E-Mail: [email protected] / [email protected] 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.

References

Related documents

If the roll is equal to or higher then the model's shooting skill then it hits and wounds as described in close combat.. If the roll was lower then the model's shooting skill then

innovation in payment systems, in particular the infrastructure used to operate payment systems, in the interests of service-users 3.. to ensure that payment systems

Results suggest that the probability of under-educated employment is higher among low skilled recent migrants and that the over-education risk is higher among high skilled

18 Francee Anderson, Sylvia Bremer and Dorothy Cumming received their training, and their start in their profession, at Sydney’s three major schools of elocution, Lawrence Campbell’s

 HCC is developing in 85% in cirrhosis hepatis Chronic liver damage Hepatocita regeneration Cirrhosis Genetic changes

The NTSB report stated that the high velocity of the diesel in the tank fill piping and the turbulence created in the sump area resulted in the generation of increase static charge

The encryption operation for PBES2 consists of the following steps, which encrypt a message M under a password P to produce a ciphertext C, applying a

Although nurses and physicians were able to access all these data elements from existing clinical information systems, the TIPI-IS provided a single point of access to view