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

Modify a report variant from ABAP Code.

Former Member
0 Likes
2,749

Hi experts,

I want to modify (or create) a report variant for a program with ABAP. I need to do this c'ause in this case it's impossible to execute a submit.

Is it possible to do it with a function módule or ABAP code? I only need to change the value of one of the variables.

Thank you very much,

Artur.

1 ACCEPTED SOLUTION
Read only

former_member209217
Active Contributor
0 Likes
1,303

Hi , Just give RS_VARIANT* in SE37 and press F4 .It will give you the list of function modules using which we can play with variants of ABAP Reports. Regards, Lakshman

4 REPLIES 4
Read only

former_member209217
Active Contributor
0 Likes
1,304

Hi , Just give RS_VARIANT* in SE37 and press F4 .It will give you the list of function modules using which we can play with variants of ABAP Reports. Regards, Lakshman

Read only

0 Likes
1,303

Ok, thanks!

Read only

0 Likes
1,303

You can use Function modules:

CALL FUNCTION 'RS_VARIANT_EXISTS'

EXPORTING

report = 'RHINTE00'

variant = 'ALIGNMENT'

IMPORTING

r_c = lf_rc

EXCEPTIONS

not_authorized = 1

no_report = 2

report_not_existent = 3

report_not_supplied = 4

OTHERS = 5.

CALL FUNCTION 'RS_VARIANT_DELETE'

EXPORTING

report = 'RHINTE00'

variant = 'ALIGNMENT'

flag_confirmscreen = 'N'

flag_delallclient = 'N'

  • IMPORTING

  • VARIANT =

EXCEPTIONS

not_authorized = 1

not_executed = 2

no_report = 3

report_not_existent = 4

report_not_supplied = 5

variant_locked = 6

variant_not_existent = 7

no_corr_insert = 8

variant_protected = 9

OTHERS = 10.

ENDIF.

CALL FUNCTION 'RS_CREATE_VARIANT'

EXPORTING

curr_report = 'RHINTE00'

curr_variant = lf_variant

vari_desc = ls_vari_desc

TABLES

vari_contents = lt_valutab

vari_text = lt_vari_text

  • VSCREENS =

EXCEPTIONS

illegal_report_or_variant = 1

illegal_variantname = 2

not_authorized = 3

not_executed = 4

report_not_existent = 5

report_not_supplied = 6

variant_exists = 7

variant_locked = 8

OTHERS = 9.

Of course you need to change the program name and the variant name with your own.

Hope it can helps you.

Edited by: robcom69 on Mar 1, 2010 3:56 PM

Read only

Former Member
0 Likes
1,303

Hi,

Tables : VARID,RSVAR

The above are the TABLES to store the variant for reports . By using the above table and achieve your requirement.

Regards

Nehruu