Free SAP Training & Tutorial A Free SAP Functional And Technical Tutorial And Training For ABAP, SAP QUERY, ALV, SMARTFORMS, SD, PP, MM, QM, FICO
06.08.2010 | Author: | Posted in ABAP 

If you need to use variant values as the default values in your selection screen, then you can achieve this by using the “RS_SUPPORT_SELECTIONS” function module.

All you need to do is supply the variant name and it will display the value automatically during the INITIALIZATION event.

Here’s the ABAP SAMPLE CODE.


INITIALIZATION.

  data: tp_subrc   like sy-subrc.
  data: tp_repid   like rsvar-report.
  data: tp_variant like rsvar-variant.

    tp_repid = sy-repid.
    clear tp_variant.
    tp_variant = 'Your Variant Name'.

    "Check if the variant is exist.

    call function 'RS_VARIANT_EXISTS'
         exporting
              report  = tp_repid
              variant = tp_variant
         importing
              r_c     = tp_subrc
         exceptions
              others  = 9.

    if sy-subrc = 0.

        call function 'RS_SUPPORT_SELECTIONS'
             exporting
                  report               = tp_repid
                  variant              = tp_variant
             exceptions
                  variant_not_existent = 01
                  variant_obsolete     = 02.

    endif.

Once you run the report program (F8) you will see the selection screen are populated by the variant values.

Popularity: 1% [?]

 


 
 

Related Tutorial " ABAP" 

  •  
     
    Recent Tutorials
    Create Table Maintenance Display In SAP Create table display to maintain tables values using SM30
    Create Table Maintenance Generator In SAP Maintaining SAP Transparent table values using maintenance generator
    Table Relationship In SAP Learn How To Find Tables Relationships in SAP
    Convert Number To words Using ABAP Find out how to convert numbers into words Using ABAP
    How To Maintain Long Text Object in SAP Maintain long text object in SAP
    How To Know What TCODE Used In ABAP Program Find TCODE For your ABAP Program Report
    How does CRM Work? Learn how CRM system works to run your business
    Why SAP CRM is the Best Choice? The reasons why CRM application is the best choice
    Difference Between CRM System and CRM Strategy What's the difference between CRM system and its strategy
    CRM for a Better Customer Service Learn how CRM could make your customer service much better
    Costs of Implementing CRM Software Learn the how much cost you need to prepare when implementing CRM
     
    Popular Tutorials
  • (none)
  •  
    Categories
    ABAP   Basis & Configuration  
    ALV SAP BW (Business Warehouse)
    BAPI   SAP Interview Questions
    SAP Tables   SAP Overview
    Transaction Codes FI SAP Query
      MM SAP Script  
      PP SAP Tutorial FI Module
      QM   MM Module
      SD   PM Module
    SAP Functional MM   PP Module
      SD   QM Module
    White Papers     SD Module
    Uncategorized   SmartForms  
      User-Exits  
     
     

     

    Home | About | Contribute | Privacy

    Copyright 2011 freesaptutorial.com.

    Free SAP Tutorial is not associated with SAP AG in Germany or in any other country.

    SAP is a registered trade mark of SAP AG.