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: 

RS_VARIANT_CHANGE

Former Member
0 Kudos
1,231

hi

I see many suggesting this variant changing function module RS_VARIANT_CHANGE but I could not find any implementation or coding in any of the search threads

Please post this code for me..

My requirement is to change change the MATNR single values for a transaction programatically..

Points for all helpful answers

1 ACCEPTED SOLUTION

Former Member
0 Kudos
367

Hi Smith,

I suggest you to do a <b>Where-Used List</b> for this Function Module 'RS_VARIANT_CHANGE ' and I am sure that you will come up with few hits which will be useful for you...

Let the forum know if you didn't get any hits and some one can post the code...

Regards,

Vivek

6 REPLIES 6

Former Member
0 Kudos
368

Hi Smith,

I suggest you to do a <b>Where-Used List</b> for this Function Module 'RS_VARIANT_CHANGE ' and I am sure that you will come up with few hits which will be useful for you...

Let the forum know if you didn't get any hits and some one can post the code...

Regards,

Vivek

former_member194669
Active Contributor
0 Kudos
367

Hi,

Check for report

RS_CHANGE_VARIANT

0 Kudos
367

Well thats in the foreground mode

What about background mode, I mean to say when I want to change programatically

0 Kudos
367

Hi,

Then you need to

Call fm RS_VARIANT_CONTENTS and loop thru the VALUTAB and change the LOW value and save using fm RS_VARIANT_VALUE_SAVE

0 Kudos
367

Thanks dude

That solved my problem but not completely, there are some structure contents which vary when I use RS_VARIANT_VALUE_SAVE

When I use the second function module you have mentioned the tables which I need to pass to FM are completely different structure than the ones which are imported from RS_VARIANT_CONTENTS

parms LIKE rsparams OCCURS 0 WITH HEADER LINE,

objs LIKE vanz OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'RS_VARIANT_CONTENTS'

EXPORTING

report = 'RIMODGEN'

variant = p_var

TABLES

valutab = parms

OBJECTS = objs

EXCEPTIONS

variant_non_existent = 1

variant_obsolete = 2

OTHERS = 3.

CALL FUNCTION 'RS_CHANGE_CREATED_VARIANT'

EXPORTING

curr_report = 'RIMODGEN'

curr_variant = p_var

vari_desc = ''

  • ONLY_CONTENTS =

TABLES

vari_contents = parms

  • VARI_TEXT =

  • VARI_SEL_DESC =

  • OBJECTS =

EXCEPTIONS

illegal_report_or_variant = 1

illegal_variantname = 2

not_authorized = 3

not_executed = 4

report_not_existent = 5

report_not_supplied = 6

variant_doesnt_exist = 7

variant_locked = 8

selections_no_match = 9

OTHERS = 10

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

So I am trying with RS_CHANGE_CREATED_VARIANT and it worked

CALL FUNCTION 'RS_CHANGE_CREATED_VARIANT'

EXPORTING

curr_report = 'RIMODGEN'

curr_variant = p_var

vari_desc = ''

  • ONLY_CONTENTS =

TABLES

vari_contents = parms

  • VARI_TEXT =

  • VARI_SEL_DESC =

  • OBJECTS =

EXCEPTIONS

illegal_report_or_variant = 1

illegal_variantname = 2

not_authorized = 3

not_executed = 4

report_not_existent = 5

report_not_supplied = 6

variant_doesnt_exist = 7

variant_locked = 8

selections_no_match = 9

OTHERS = 10

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Former Member
0 Kudos
367

Try looking at the code for program RMCP6BCH and see if that helps.

- April King