Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

calling a variant

Former Member
0 Likes
570

Dear all,

i want to know how to call a variant from one program and the variant is to be used in other new program via variant name only nothing to selected only the vaue contained in that variant is to be used in new program.

is there any functional module for that .

regards,

balaji

5 REPLIES 5
Read only

Former Member
Read only

Former Member
0 Likes
532

Hi,

Select variant from vari table.

Here variants will save in vari table and variant is field which will be variant name.

regards,

sreevani

Read only

Former Member
0 Likes
532

Use RS_VARIANT_CONTENTS.

regards,

ravi

Read only

0 Likes
532

Dear ravi,

i have to pass the values of variant to new program for that the function module is useful i think so.

i want to know how to get the value for a field by using that.

regards,

balaji.

Read only

Former Member
0 Likes
532

Hello,

Do like this:

SUBMIT

... USING SELECTION-SETS OF PROGRAM prog 


Effect 
Uses variants of the program prog when executing the program rep. 



Note 
Important 

The programs prog and rep must have the same SELECT-OPTIONS and PARAMETERs. Otherwise, variants of the program prog may be destroyed. 



Note 
When using this addition, the specified variant vari of the program prog is taken in USING SELECTION-SET vari. On the other hand, all variant-related actions on the selection screen of rep (Get, Save as variant, Display, Delete) refer to the variants of prog. 



Example
SUBMIT REPORT01 
       VIA SELECTION-SCREEN 
       USING SELECTION-SET 'VARIANT1' 
       USING SELECTION-SETS OF PROGRAM 'REPORT00' 
       AND RETURN. 


Effect 
Executes the program REPORT01 with the variant VARIANT1 of the program REPORT00. 



Note 
Runtime errors: 


LOAD_PROGRAM_NOT_FOUND: The specified program was not found. 

SUBMIT_WRONG_TYPE: The specified program is not a report. 

SUBMIT_IMPORT_ONLY_PARAMETER: Only one value passed to a report parameter. 

SUBMIT_WRONG_SIGN: Invalid value passed to a selection with the addition SIGN. 

SUBMIT_IN_ITAB_ILL_STRUCTURE: Table passed to a selection with WITH sel IN itab had an unexpected structure. 

For reading the VARAINT make use of the FM <b>RS_VARIANT_DISPLAY</b>

Vasanth