Edit variants

function y_jc_inb2out.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  TABLES
*"      JITCALLS TYPE  JITO_PRODN_TT
*"----------------------------------------------------------------------
types: begin of ts_data,
  spec_matnr type matnr,
  end of ts_data,
 
 tt_data type table of ts_data.
   data: lt_params type table of rsparams,
        ls_varid type varid.
 
  field-symbols:<wa_params> like line of lt_params.
                ", <wa_data>  like line of pt_data.
 
  define add_params.
    append initial line to lt_params assigning <wa_params>.
    <wa_params>-selname = &1.
    <wa_params>-kind = &2.
    <wa_params>-sign = &3.
    <wa_params>-option = &4.
    <wa_params>-low = &5.
  end-of-definition.
 
  ls_varid-report  = 'RJITMON001'.
  ls_varid-variant = '/Y_SCMORDERS'.
  ls_varid-ename   = 'YSD'.
  ls_varid-edat    = sy-datum.
  ls_varid-etime   = sy-uzeit.
 
  add_params: 'PRODN_PT' 'S' 'I' 'EQ' '6233'.
 
 CALL FUNCTION 'RS_CHANGE_CREATED_VARIANT'
    EXPORTING
      curr_report               = ls_varid-report
      curr_variant              = ls_varid-variant
      vari_desc                 = ls_varid
    TABLES
      vari_contents             = lt_params
    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 s020(Y_SAP) WITH p_var DISPLAY LIKE 'E'.
*  ELSE.
*    MESSAGE s021(Z_SAP) WITH p_var.
  ENDIF.
endfunction.

Schreibe einen Kommentar



All fields are required. Your email address will not be published.