服务分类 层数不限, 由上而下
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(PROCESS_TYPE) TYPE CRMT_PROCESS_TYPE_DB OPTIONAL
*" VALUE(CAT_ID) TYPE CRM_ERMS_CAT_CA_ID OPTIONAL
*" EXPORTING
*" REFERENCE(SUBJECT_PROFILE) TYPE CRMT_SUBJECT_PROFILE
*" REFERENCE(ASP_ID) TYPE CRM_ERMS_CAT_AS_ID
*" REFERENCE(CAT_GUID) TYPE CRM_ERMS_CAT_GUID
*" TABLES
*" T_DROP_DOWN STRUCTURE ZYCR_CAT_HIERARCHY_SH OPTIONAL
*"----------------------------------------------------------------------
DATA le_obj_guid TYPE crm_erms_cat_guid .
DATA le_cat_guid TYPE crm_erms_cat_guid .
DATA le_asp_guid TYPE crm_erms_cat_guid .
DATA lt_hierarchy LIKE crmc_erms_cat_hi OCCURS 0 WITH HEADER LINE .
DATA ge_timest TYPE crm_erms_cat_timestamp .
DATA ge_timezone TYPE systzonlo.
*************************************************************************
CLEAR: subject_profile,le_obj_guid,le_asp_guid,le_cat_guid.
SELECT SINGLE subject_profile INTO subject_profile
FROM crmc_service_h
WHERE process_type = process_type .
CHECK subject_profile IS NOT INITIAL .
SELECT SINGLE obj_guid INTO le_obj_guid
FROM crmc_erms_cat_ok
WHERE obj_extkey = subject_profile .
CHECK le_obj_guid IS NOT INITIAL .
* 获取当前用户的时区
CALL FUNCTION 'TZON_GET_USER_TIMEZONE'
EXPORTING
if_username = sy-uname
IMPORTING
ef_timezone = ge_timezone
EXCEPTIONS
no_timezone_customizing = 1
no_valid_user = 2
OTHERS = 3.
CONVERT DATE sy-datum TIME sy-uzeit
INTO TIME STAMP ge_timest TIME ZONE ge_timezone.
SELECT SINGLE a~asp_guid a~asp_id
INTO (le_asp_guid,asp_id)
FROM crmc_erms_cat_as AS a JOIN crmc_erms_cat_ln AS b
ON a~asp_guid = b~cat_guid
WHERE a~val_from <= ge_timest AND a~val_to >= ge_timest
AND b~obj_guid = le_obj_guid AND b~lnk_type = 'IS_SUPRF'.
CHECK le_asp_guid IS NOT INITIAL .
IF cat_id IS INITIAL .
le_cat_guid = le_asp_guid .
ELSE .
SELECT SINGLE cat_guid INTO le_cat_guid
FROM crmc_erms_cat_ca
WHERE cat_id = cat_id AND asp_guid = le_asp_guid .
cat_guid = le_cat_guid .
ENDIF.
CHECK le_cat_guid IS NOT INITIAL .
REFRESH lt_hierarchy . CLEAR lt_hierarchy .
SELECT * INTO TABLE lt_hierarchy
FROM crmc_erms_cat_hi
WHERE tree_type = 'CAT'
AND pare_guid = le_cat_guid .
LOOP AT lt_hierarchy.
SELECT SINGLE cat_id INTO t_drop_down-key
FROM crmc_erms_cat_ca
WHERE cat_guid = lt_hierarchy-node_guid .
SELECT SINGLE cat_label INTO t_drop_down-text
FROM crmc_erms_cat_cd
WHERE cat_guid = lt_hierarchy-node_guid .
APPEND t_drop_down . CLEAR t_drop_down .
ENDLOOP.
IF t_drop_down[] IS NOT INITIAL .
CLEAR t_drop_down .
INSERT t_drop_down INDEX 1 .
ENDIF.
阅读(868) | 评论(0) | 转发(0) |