
REPORT zsat_test_variant1.
DATA : gt_cat TYPE rsvcat,
gt_valutab TYPE TABLE OF rsparams,
gs_vari_desc TYPE varid.
***Read all variants for program ZSAT_TEST_VARIANT
CALL FUNCTION 'RS_ALL_VARIANTS_4_1_REPORT'
EXPORTING
program = 'ZSAT_TEST_VARIANT'
IMPORTING
cat = gt_cat
EXCEPTIONS
report_not_existent = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ELSE.
***DELETE 4th row of each variant value
LOOP AT gt_cat-cat INTO DATA(gw_cat).
WRITE : / gw_cat-variant.
REFRESH : gt_valutab.
CALL FUNCTION 'RS_VARIANT_CONTENTS'
EXPORTING
report = 'ZSAT_TEST_VARIANT'
variant = gw_cat-variant
move_or_write = 'M'
TABLES
valutab = gt_valutab
EXCEPTIONS
variant_non_existent = 1
variant_obsolete = 2
OTHERS = 3.
IF sy-subrc <> 0.
* Implement suitable error handling here
ELSE.
* LOOP AT gt_valutab ASSIGNING FIELD-SYMBOL(<fs_tab>).
*You can write your own logic here, for Demo purpose I'm just deleting 4th value from all variants
DELETE gt_valutab INDEX 4.
* ENDLOOP.
IF sy-subrc IS INITIAL.
***Update the variant
CALL FUNCTION 'RS_CHANGE_CREATED_VARIANT'
EXPORTING
curr_report = 'ZSAT_TEST_VARIANT'
curr_variant = gw_cat-variant
vari_desc = gs_vari_desc
TABLES
vari_contents = gt_valutab
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.
* Implement suitable error handling here
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
2 | |
2 | |
2 |