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!