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 Variant mantaining some values

Former Member
0 Likes
375

Hi,

I want to modify some fields of a variant used in a submit while keeping the rest of the fields unchanged. I've tried to use the FM SUBST_WRITE_UPGRADE_VARIANT but I only can indicate the fields that I want to change because the program calls different programs, each with a variant of their own.

Basically, I want to loop 12 times (one for each month of the year) and for each loop, set the variant with the corresponding month.

DO 12 TIMES.

...

t_parametros-selname = itab-period.

t_parametros-kind = itab-tipo_perio.

t_parametros-sign = 'I'.

t_parametros-option = 'EQ'.

t_parametros-low = v_month.

t_parametros-high = v_month.

APPEND t_parametros.

CLEAR t_parametros.

...

CALL FUNCTION 'SUBST_WRITE_UPGRADE_VARIANT'

EXPORTING

iv_reportname = itab-program_name

iv_variantname = itab-var_name

iv_varianttext = var_string

  • IMPORTING

  • EV_FUNCRC =

TABLES

tt_reportparam = t_parametros

...

SUBMIT (itab-program_name) TO SAP-SPOOL

SPOOL PARAMETERS params

WITHOUT SPOOL DYNPRO

VIA JOB jobname NUMBER jobcount

USING SELECTION-SET itab-var_name

AND RETURN.

...

Thanks!

1 REPLY 1
Read only

andreas_mann3
Active Contributor
0 Likes
323

hi,

look to function grouo svar

fm RS_VARIANT_CHANGE

Message was edited by:

Andreas Mann