DATA: lv_time TYPE TVARV_VAL,
lv_tvarvc(25) .
CONSTANTS lv_prefix(25) VALUE 'ZZXXS_'.
CONCATENATE lv_prefix p_werks INTO lv_tvarvc.
SELECT SINGLE low INTO lv_time
FROM tvarvc
WHERE name = lv_tvarvc
AND type = 'P'.
IF sy-subrc eq 0.
g_time = lv_time.
ELSE.
g_time = '000000'.
ENDIF.
CLEAR:lv_time,lv_tvarvc.
data: lt_tvarvc type table of tvarvc,
ls_tvarvc type tvarvc,
ls_mtrgrp type gds_selrange_matkl,
ls_subct_mtrgrp type gds_selrange_matkl,
ls_vendors type range_lifnr.
refresh lt_tvarvc.
select * into corresponding fields of table lt_tvarvc
from tvarvc
where name eq 'ZXXX'
and type eq 'S'.
if sy-subrc eq 0.
loop at lt_tvarvc into ls_tvarvc.
ls_mtrgrp-sign = ls_tvarvc-sign.
ls_mtrgrp-option = ls_tvarvc-opti.
ls_mtrgrp-low = ls_tvarvc-low.
ls_mtrgrp-high = ls_tvarvc-high.
append ls_mtrgrp to it_mtrgrp.
endloop.
clear ls_tvarvc.
endif.
TYPES:
BEGIN OF STRUC_MAILADR,
MAIL_ADR TYPE ADR6-SMTP_ADDR,
END OF STRUC_MAILADR.
DATA:G_WA_MAILADR TYPE STRUC_MAILADR,
G_IT_MAILADR LIKE TABLE OF G_WA_MAILADR.
FORM GET_RECIPENT .
RANGES LR_RECIPENT FOR ADR6-SMTP_ADDR.
DATA: LW_RECIPENT LIKE LINE OF LR_RECIPENT,
LV_RECIPENT TYPE TVARV_VAL.
DATA:L_IT_MAILADR LIKE TABLE OF G_WA_MAILADR.
SELECT LOW INTO TABLE L_IT_MAILADR
FROM TVARVC
WHERE NAME = 'ZXXXXXX'
AND TYPE = 'S'.
IF SY-SUBRC EQ 0.
SORT L_IT_MAILADR.
DELETE ADJACENT DUPLICATES FROM L_IT_MAILADR.
APPEND LINES OF L_IT_MAILADR TO G_IT_MAILADR.
REFRESH L_IT_MAILADR.
ENDIF.
ENDFORM.
"one common FM
FUNCTION Z_GET_STVARV_VARIANTS .
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(I_TVARVC_TYPE) TYPE RSSCR_KIND
*" REFERENCE(I_TVARVC_NAME) TYPE RVARI_VNAM
*" CHANGING
*" REFERENCE(CT_TVARVC_VAL) TYPE ZSTVARV_TAB
*"----------------------------------------------------------------------
DATA: LT_TVARVC TYPE TABLE OF TVARVC..
REFRESH LT_TVARVC.
SELECT * INTO CORRESPONDING FIELDS OF TABLE LT_TVARVC
FROM TVARVC
WHERE NAME EQ I_TVARVC_NAME
AND TYPE EQ I_TVARVC_TYPE.
IF SY-SUBRC EQ 0.
APPEND LINES OF LT_TVARVC TO CT_TVARVC_VAL.
ENDIF.
FREE LT_TVARVC.
ENDFUNCTION.