‎2008 Mar 11 10:50 AM
Hi Friends,
Is there any possibility to use or select variants in coding?
Thanks & Good regards,
Vallamuthu.M
‎2008 Mar 11 10:52 AM
Variants allow you to save sets of input values for programs that you often start with the same selections. You can use them for any programs except subroutine pools (type S).
LINK
http://help.sap.com/saphelp_nw04/helpdata/en/c0/980374e58611d194cc00a0c94260a5/content.htm
Steps for creating a varient for an existing program
Go to SE38 TRCODE for ABAP Editor
Provide the existing program name[Eg:zvendor]
Select varients
Go to change mode[Click on the change option]
Define varient name here[Eg :zvar] and go for create
Selection screen appears.Provide the i/p values.
Go with attributes option
Under attributes provide the description for varients[like Eg:Demo on varients]
Save the details[Ctrl+s]
TRANSACTION VARIANTS
Transaction variants allow you to preset values for fields in a transaction, set field attributes, or hide entire screens.
Procedure
You can create transaction variants in the SAP Reference IMG.
...
1. Choose Basis Components ® Application Personalization ® Tailoring of Application Transactions ® Configure Transaction-Related Display Values for Fields (transaction SHD0).
2. To execute a transaction variant, you have to define a variant transaction using the Transaction Maintenance transaction (SE93).
3. Once you have entered a transaction code and short description, choose transaction type Transaction with variant (Variant transaction).
4. To define a variant, enter the name of the transaction and the name of the variant.
5. Usually the settings in the Classification group box are set by default.
Professional User Transactions are the standard transactions executed in the SAP system. An Easy Web Transaction is an ITS-based transaction, which can be executed only in the SAP GUI for HTML. You need to refer to an ITS service in order to use it.
The SAP GUI settings do not affect the transaction itself; they only inform the user what software is needed to start the transaction: SAP GUI for Windows, SAP GUI for Java or only the browser (SAP GUI for HTML).
Result
You can use the newly created transaction code to start a special variant of the transaction.
Do reward if helpful
‎2008 Mar 11 10:57 AM
Try using FMs in FG SVAR:
Examples:
RS_CHANGE_CREATED_VARIANT
RS_CREATE_VARIANT
RS_VARIANT_DELETE
RS_VARIANT_DISPLAY
RS_VARIANT_RENAME
‎2008 Mar 11 10:59 AM
Hi,
U can Use Transaction Variants to make your fields Mandatory, Hidden or Display
You can hide unwanted screens and fields in any of the standard SAP programs without changing any of the standard programs. Additional features such as making the variant as default on the standard SAP transaction code is only available on 4.6x.
Steps :-
Transaction SHD0 - Create a variant for the required transaction bychanging the layout through hiding fields and screens.
Transaction SE93 - Create a variant transaction (e.g. for VA02 you canname it as ZA02). Next allocate the transaction variant to this varianttransaction.
Create and change the Zxxx area menu with the new transaction variant. In this way, the user does have to remembers any extra transaction codes.
In 4.6c, you can default your transaction variant as the standard variant. (SHD0 - Edit -> Activate/Deactivate asstandard variant)
An example for using transaction variant (restricting the field displayfor CO11N - Goods movement) :-
If you want to restrict changes to the fields in Goods movement forone group of users.
1. Create a transaction variant for CO11N
2. Create a new transction code for the transaction variant and assign an authorization object to it
3. Divide the users into this two transaction code. Those who can change the field using CO11N. For those that have limited
field change, give them the authorizationfor ZCO11 (this is a new transaction code you have to create).
R/points if useful....
Regards
AK
‎2008 Mar 11 11:00 AM
Hello,
The report variants are stored in the table called VARID
U can use the FM
RS_VARIANT_CONTENTS,
RS_REFRESH_FROM_SELECTOPTIONS,
RS_REPORTSELECTIONS_INFO
TO get the info about the variant.
Cheers,
Vasanth
‎2008 Mar 11 11:24 AM
Hi,
I am copied FI standard program based on the variant the selection-screen will be changed. When I run the program the particular variant screen will execute. Is it possible?
Thanks & regards,
vallamuthu.M
‎2009 May 21 5:48 AM