sap_save_variant
Save or update ABAP report selection-screen variants with values for parameters and select-options, enabling reuse in headless runs and avoiding manual entry of mandatory fields.
Instructions
Create or overwrite an ABAP selection-screen VARIANT for a report, so it can be reused by sap_run_program (and the performance trace / headless runs) for programs whose selection screen has mandatory fields. Parameter 'report' (required) is the program name. Parameter 'variant' (required) is the variant name (<=14 chars). Parameter 'text' (optional) is a description. Parameter 'environment' (optional, default 'A') is 'A' online or 'B' batch. Parameter 'parameters' (required) is the selection values as a list of objects with keys: selname, kind ('P' parameter / 'S' select-option), sign ('I'/'E'), option ('EQ','BT','CP',...), low, high. To read a variant back use sap_call_function RS_VARIANT_CONTENTS_RFC (REPORT, VARIANT); to delete use RS_VARIANT_DELETE_RFC (REPORT, VARIANT).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Variant description (optional). | |
| report | Yes | ABAP report/program name. Will be uppercased. | |
| variant | Yes | Variant name, max 14 chars. Will be uppercased. | |
| parameters | Yes | Selection values (RSPARAMS rows). | |
| environment | No | Variant environment: 'A' (online, default) or 'B' (batch). |