# RS_VARIANT_CONTENTS — Read Variant Contents

> Returns the parameter and select-option values stored in a report's selection screen variant in RSPARAMS format. Tools that list or compare variant contents or pass them to another program with SUBMIT ... WITH SELECTION-TABLE use it. For variants with dynamic date calculation, values are calculated at call time; if the variant does not exist, VARIANT_NON_EXISTENT is raised.

- Modules: BASIS
- Type: Function module
- Function group: SVAR
- Remote-enabled (RFC): No
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/rs-variant-contents/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| REPORT | RSVAR-REPORT | Program name | Yes |
| VARIANT | RSVAR-VARIANT | Variant name | Yes |
| MOVE_OR_WRITE | - | Return values in internal or external format | - |
| NO_IMPORT | - | Do not import variant | - |
| EXECUTE_DIRECT | - | Execute directly | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| SP | SYLDB_SP | Logical database selection screen |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| VALUTAB | RSPARAMS | Variant values | Yes |
| VALUTABL | RSPARAMSL | Variant values (long) | - |
| OBJECTS | VANZ | Selection screen objects | - |
| FREE_SELECTIONS_VALUE | RSSELDYN | Free selection values | - |

## Exceptions

- VARIANT_NON_EXISTENT: Variant does not exist
- VARIANT_OBSOLETE: Variant obsolete

## Call template (ABAP)

```abap
CALL FUNCTION 'RS_VARIANT_CONTENTS'
  EXPORTING
    report = lv_report
    variant = lv_variant
  IMPORTING
    sp = lv_sp
  TABLES
    valutab = lt_valutab
    valutabl = lt_valutabl
    objects = lt_objects
    free_selections_value = lt_free_selections_value
  EXCEPTIONS
    variant_non_existent = 1
    variant_obsolete = 2
    OTHERS = 3.
```

## Related tables

VARID

