Shared Top Border

Enterprise Resource
Planning Portal

 

Advertise | Founder BLOG

ERPGenie.COM ABAP Tips and Tricks Database

THE ultimate
ERP website

 

Forums | Vote for us |

Google    Other Search Options

Login

Login to view more content!!!





Lost Password?
No account yet? Register

Registered Access

Poll

What area of ABAP are you interested in?
 
Home arrow Tips and Tricks arrow ABAP Reports arrow Defining A Default Variant
Defining A Default Variant PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Dany Charbonneau   
Monday, 21 May 2007
There are 2 different ways to define a default variant.
Method 1 - By assigning a variant directly on the transaction code. This is the easiest way but if the program was called from another program or directly from SE38, the default variant will be ignored.

Method 2 - By assigning a variant in the code, here is a short example of this:
Code:
* The code must be in the INITIALIZATION section
INITIALIZATION.
* We must check if a default variant was already entered by the user in a batch job or in the transaction code
* we do not want to overwrite it ! the current variant is store in the sy-slset field
IF sy-slset IS INITIAL.
CALL FUNCTION 'RS_SUPPORT_SELECTIONS'
EXPORTING
report = sy-cprog "actual program name
variant = 'SAPDEFAULT' "default variant name
EXCEPTIONS
variant_not_existent = 0
variant_obsolete = 0
OTHERS = 0.
ENDIF.

* After the initialization we start the real code of our program in the section START-OF-SELECTION
START-OF-SELECTION.
Here is how to create a the variant "SAPDEFAULT" always using as a default date today minus 30 days:

Goto -> variant -> save as variant

Here is the standard variant save screen. Enter a name and a description and press "execute". Very few know how to handle the weird looking bottom part of this screen:


  1. Check the variables for which you want to maintain default values
  2. Choose selection variables button and see the next one



The first part is a legend of the column headers (T D B Z). Because we want to create a date, we double click on the traffic lights of the column "D" for Dynamic date calculation. when the traffic light turn green, you can press on the down arrow in the "T" column. This will bring a popup with all possibilities you can imagine for defaulting a date. From a usability point of view, this is not really good screens but nevertheless, this tool is very powerful.

Related Items:

 
< Prev   Next >

Google Search

Statistics

Contribution Activity
Utilities: 38
Tips and Tricks: 334
Sample Code: 166
Total Contributions: 553

Member Activity
Members: 6310 since 2/1/2007!
New: 1 since yesterday!
Visitors: 1183942
We have 4 guests online

Newest Members

Welcome our newest members:

Google Ads

Shared Bottom Border

Contact Us | Polls | Add URL | Contribute | Privacy | Terms | Feedback

Discussion Forum | BLOG | Consultants: Post your resume | Companies: Advertise on ERPGenie.COM | Post Job
Financials Consultant | Consultant Review | Gallia Consulting | Supply Chain Project | SAP Financials Forum
GenieHoldings.COM, Inc. | Genie Press | WorkflowGenie | ESAGenie | ERPTopSites | ABAP Tips and Tricks | SAP Solutions Database

EDIGenie | Searching Survivor