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

Reading variants with RS_VARIANT_CONTENTS

Former Member
0 Kudos
8,629

Hello guys,

I am using function RS_VARIANT_CONTENTS for displaying variants of reports. For getting the available variants I select entries of table VARI first.

Unfortunately there are some variants which are incorrect/obsolete which results in a dump when calling the function.

Is there any way (table or something else) where I can catch these variants before using the function so that I can avoid the dump?

Thanks!

Regards

Michael

3 REPLIES 3
Read only

Former Member
0 Kudos
3,779

Hi,

Few Variant Related tables are VARID VARIS VAIRD. Put VAR* in SE11 you will find many more, I am not sure which one would help you.

How ever if you debug the FM and find out why the particular Variant went into Short dump you can surely rectify the issue.

Hope this helps.

Read only

Venkat_Sesha
Product and Topic Expert
Product and Topic Expert
0 Kudos
3,779

Hi Michael,

you can catch these errors under FM exceptions.

However to check if the variant exists or consistency of the variant you can use the FM RS*VAR_VARIANT_EXISTS FM.

If you refer to Transaction Variants (Dynamic ones) then you can go to STVARV transaction to see the variants and its corresponding tables are TVARV and TVARVC.

Read only

former_member195402
Active Contributor
0 Kudos
3,779

Hi Michael,

obsolete variants may be caused by an update or by changing the type of an object on the selection screen. This may occur, when you change a parameter from type char80 to type string, or if you make a parameter a select-option for example.

To rescue an obsolete variant there is a repair report named in SAP note 1953229, normally it should be RSVARDOC_610 now for your release.

If you can catch the dump using TRY CATCH ENDTRY with class CX_ROOT, then you can submit this report in case of error and then retry the fm cal. If not, then you can try to submit the report for all variants before calling the fm. Or you can submit the report once or twice per report, 1st for system variants and 2nd for remaining variants.

Regards,

Klaus