Skip to end of metadata
Go to start of metadata
REPORT ztests.
*----------------------------------------------------*
*     types for internal table
*----------------------------------------------------*
TYPES: BEGIN OF t_varinfo,
  flag TYPE c,
  olength TYPE x,
  line LIKE raldb-infoline,
END OF t_varinfo.
*----------------------------------------------------*
*   internal table declaration
*----------------------------------------------------*
DATA: tables TYPE trdir-name OCCURS 0 WITH HEADER LINE ,
      infotab TYPE t_varinfo OCCURS 0 WITH HEADER LINE,
      variant_info TYPE rsvaradmin OCCURS 0 WITH HEADER LINE ,
      variant_names TYPE rsvarrange OCCURS 0 WITH HEADER LINE .
*----------------------------------------------------*
*   selection screen design
*----------------------------------------------------*
PARAMETERS: p_test(20) TYPE c ,
            p_test1 TYPE i,
            p_test2 TYPE i .
*----------------------------------------------------*
*   start of selection
*----------------------------------------------------*
START-OF-SELECTION .
  CALL FUNCTION 'RS_VARIANT_ADMIN_DATA'
    EXPORTING
      curr_report   = sy-repid
    TABLES
      variant_info  = variant_info
      variant_names = variant_names
    EXCEPTIONS
      no_variants   = 1
      OTHERS        = 2.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
  CALL FUNCTION 'PRINT_SELECTIONS'
    EXPORTING
      mode      = tables
      rname     = sy-repid "program name
      rvariante = variant_info-variant "varient name
    TABLES
      infotab   = infotab.
*----------------------------------------------------*
*      display output
*----------------------------------------------------*
  LOOP AT infotab.
    WRITE / infotab-line.
  ENDLOOP.
  SKIP 4.
  WRITE:/ 'the report output along with selection screen :'.
  WRITE:/ p_test ,
          p_test1,
          p_test2 .