Application Development 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: 

Managing variants with ABAP program

Former Member
0 Kudos

Hi!

I'm having some trouble creating a program which does the following:

1. The variant of a program is uploaded in an internal table

2. The internal table is modified (to change the parameters in the variant content)

3. The variant has to be saved

I used function RS_VARIANT_VALUES_TECH_DATA to upload the variant data in an internal table. The problem is when I want to save those values I modified, I cannot find any function to save it.

I took a look at this post:

but I still cannot figure out a way to save them

Do you know a way to solve this problem? Thanks!

Edited by: Pablo Oscar Felitti on Feb 12, 2009 6:31 PM

1 ACCEPTED SOLUTION

former_member194669
Active Contributor
0 Kudos

Try this way


  data : v_field like dd03l-fieldname.
  move sy-sysid to v_sysid.
  call function 'RS_VARIANT_CONTENTS'
    exporting
      report               = 'YST3009'
      variant              = v_sysid
    tables
      valutab              = i_params
    exceptions
      variant_non_existent = 1
      variant_obsolete     = 2
      others               = 3.
  if sy-subrc eq 0.
    loop at i_params.
      assign (i_params-selname) to <fs>.
      <fs> = i_params-low.
                  " <<< Modify here with new values
    endloop.
  endif.

Then



CALL FUNCTION 'RS_CHANGE_CREATED_VARIANT'
EXPORTING
     curr_report = varid_tab-report
     curr_variant = varid_tab-variant
     vari_desc = varid_tab
TABLES
     vari_contents = i_params
     vari_text = varit_tab

2 REPLIES 2

former_member194669
Active Contributor
0 Kudos

Try this way


  data : v_field like dd03l-fieldname.
  move sy-sysid to v_sysid.
  call function 'RS_VARIANT_CONTENTS'
    exporting
      report               = 'YST3009'
      variant              = v_sysid
    tables
      valutab              = i_params
    exceptions
      variant_non_existent = 1
      variant_obsolete     = 2
      others               = 3.
  if sy-subrc eq 0.
    loop at i_params.
      assign (i_params-selname) to <fs>.
      <fs> = i_params-low.
                  " <<< Modify here with new values
    endloop.
  endif.

Then



CALL FUNCTION 'RS_CHANGE_CREATED_VARIANT'
EXPORTING
     curr_report = varid_tab-report
     curr_variant = varid_tab-variant
     vari_desc = varid_tab
TABLES
     vari_contents = i_params
     vari_text = varit_tab

Former Member
0 Kudos

.

Edited by: Pablo Oscar Felitti on Jun 12, 2009 10:25 PM