2010 Dec 23 6:15 AM
Dear all,
i need to create a variant dynamically from the program . i know that we can use FM RS_CREATE_VARIANT to create a variant. but my problem is i am unable to create variant with free selections . can any one help me out how to create a variant with free selections dynamically.
Thanks & regards
sreehari.p
Dear all,
i need to create a variant dynamically from the program . i know that we can use FM RS_CREATE_VARIANT to create a variant. but my problem is i am unable to create variant with free selections . can any one help me out how to create a variant with free selections dynamically.
Thanks & regards
sreehari.p
2010 Dec 28 10:59 AM
2010 Dec 28 11:10 AM
Hi,
Try this way...
First try to create a test variant for all selections and next call fm 'RS_VARIANT_VALUES_TECH_DATA' and modify the existing variant with your selection and use in the run time....
Or
In variant you can specify dates dynamically.
When you save a variant, system ask you enter variant name and Meaning. On the same screen you can specify these dynamic values.
For the parameter/select-option where you want to specify dynamic value, press F4 on 'Selection Variable' column.
Choose type of variable as 'D' (Dynamic date calculation).
Press F4 on 'Name of Variable(Input only using F4) column and select 'Current date +/- ??? days' on next screen.
On input screen enter -1.
Repeat same for To Date' field.
REPORT ztest.
TABLES: rsvar.
DATA: t_irsparams TYPE STANDARD TABLE OF rsparams WITH HEADER LINE,
t_varid TYPE varid.
rsvar-report = 'RKAEP000'.
rsvar-variant = 'ZTEST'.
CALL FUNCTION 'RS_VARIANT_VALUES_TECH_DATA'
EXPORTING
report = rsvar-report
variant = rsvar-variant
IMPORTING
techn_data = t_varid
TABLES
variant_values = t_irsparams
EXCEPTIONS
variant_non_existent = 1
variant_obsolete = 2
OTHERS = 3.
*** perform any changes, add new records etc ...
CALL FUNCTION 'RS_CHANGE_CREATED_VARIANT'
EXPORTING
curr_report = rsvar-report
curr_variant = rsvar-variant
vari_desc = t_varid
TABLES
vari_contents = t_irsparams
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.
Prabhudas
2011 Oct 06 5:02 PM
Sreehari, have you managed to solve this problem? Or anybody else?
With RS_CREATE_VARIANT, you can create variants for fields on the selection screen, but you can't use dynamic selections with it. I have tried so hard but couldn't find a way.
Anybody??
2012 Oct 18 9:13 AM
Hi,
FM to create new dynamic variant?
i tried RS_CREATE_VARIANT for creating varint..for new variant creation its working but i need to assign the attributes from TVARV table..
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |