rplantiko

List values of many variants / reports

Jan 25th, 2021 (edited)
758
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. *&---------------------------------------------------------------------*
  2. *& Report ZUT_LIST_VARIANT_VALUES
  3. *&---------------------------------------------------------------------*
  4. *& Selektionen und Parameter mehrerer Varianten / Reports auflisten
  5. *&---------------------------------------------------------------------*
  6. report zut_list_variant_values.
  7.  
  8. tables: varid.
  9.  
  10. select-options:
  11.   s_report  for varid-report,
  12.   s_varid   for varid-variant.
  13.  
  14. start-of-selection.
  15.   perform start.
  16.  
  17. form start.
  18.  
  19.   if s_report[] is initial and
  20.      s_varid[] is initial.
  21.     message 'Bitte die Selektion einschr√§nken' type 'I'.
  22.     return.
  23.   endif.
  24.  
  25.   data: lt_params type zsparams_tab.
  26.   perform select changing lt_params.
  27.   perform display changing lt_params.
  28.  
  29. endform.
  30.  
  31. form select changing ct_params type zsparams_tab.
  32.  
  33.   data: lt_values  type rsparams_tt,
  34.         ls_variant type zsparams.
  35.  
  36.   select report, variant from varid into @ls_variant
  37.            where report in @s_report
  38.              and variant in @s_varid.
  39.  
  40.     call function 'RS_VARIANT_VALUES_TECH_DATA'
  41.       exporting
  42.         report               = ls_variant-report
  43.         variant              = ls_variant-variant
  44.       tables
  45.         variant_values       = lt_values
  46.       exceptions
  47.         variant_non_existent = 1
  48.         variant_obsolete     = 2
  49.         others               = 3.
  50.     check sy-subrc eq 0.
  51.  
  52.     loop at lt_values into ls_variant-params.
  53.       append ls_variant to ct_params.
  54.     endloop.
  55.  
  56.   endselect.
  57.  
  58. endform.
  59.  
  60. form display changing ct_params type zsparams_tab.
  61.  
  62.   call function 'REUSE_ALV_GRID_DISPLAY'
  63.     exporting
  64.       i_structure_name = 'ZSPARAMS'
  65.     tables
  66.       t_outtab         = ct_params
  67.     exceptions
  68.       program_error    = 1
  69.       others           = 2.
  70.  
  71.   if sy-subrc <> 0.
  72.     message 'Fehler beim Aufruf des ALV Grid' type 'I'.
  73.   endif.
  74.  
  75. endform.
RAW Paste Data