DATA:
BEGIN OF str_cr,
requestid TYPE trkorr,
END OF str_cr.
DATA:
l_cr TYPE trkorr.
DATA:
i_requestlist LIKE TABLE OF str_cr WITH HEADER LINE.
DATA:
BEGIN OF str_object,
requestid TYPE trkorr , " 請求/任務
taskid TYPE trkorr , " 請求/任務
as4pos TYPE ddposition , " 字典:行項
pgmid TYPE pgmid , " 請求和任務中的程序標識
object TYPE trobjtype , " 對象類型
obj_name TYPE trobj_name , " 對象清單中的對象名
objfunc TYPE objfunc , " 對象功能
lockflag TYPE lockflag , " 對象條目的鎖定狀態或輸入狀態
gennum TYPE trgennum , " 傳輸組織器中對象條目的語種信息
lang TYPE spras , " 語言代碼
activity TYPE tractivity , "
as4text TYPE as4text , " 描述 R/3 資源庫對象的短文本
text TYPE ddtext , " 說明簡要文字
END OF str_object.
DATA:
o_devobjlist LIKE TABLE OF str_object WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:
s_cr FOR l_cr NO INTERVALS. "CR號
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
LOOP AT s_cr.
i_requestlist-requestid = s_cr-low.
APPEND i_requestlist.
ENDLOOP.
DATA: li_e070 TYPE STANDARD TABLE OF e070 WITH KEY trkorr WITH HEADER LINE,
li_e071 TYPE STANDARD TABLE OF e071 WITH KEY trkorr as4pos WITH HEADER LINE,
li_e07t TYPE STANDARD TABLE OF e07t WITH KEY trkorr WITH HEADER LINE,
lt_object_table TYPE STANDARD TABLE OF ko100 WITH KEY pgmid object WITH HEADER LINE.
DATA: li_requestlist_rec TYPE STANDARD TABLE OF zbs00s_requestlist WITH HEADER LINE,
li_devobjlist TYPE STANDARD TABLE OF zbs00s_devobjlist WITH KEY requestid taskid as4pos WITH HEADER LINE,
li_devobjlist_rec TYPE STANDARD TABLE OF zbs00s_devobjlist WITH KEY requestid taskid as4pos.
DATA: l_trkorr_rec TYPE trkorr,
l_tempstr TYPE string.
CHECK i_requestlist[] IS NOT INITIAL.
SORT i_requestlist BY requestid ASCENDING.
DELETE ADJACENT DUPLICATES FROM i_requestlist COMPARING ALL FIELDS.
CALL FUNCTION 'TR_OBJECT_TABLE'
TABLES
wt_object_text = lt_object_table.
SELECT *
FROM e070
INTO TABLE li_e070
WHERE trkorr IN s_cr OR strkorr IN s_cr.
SELECT *
FROM e07t
INTO TABLE li_e07t
WHERE trkorr IN s_cr AND langu = '1'.
IF li_e070[] IS NOT INITIAL.
SELECT *
FROM e071
INTO TABLE li_e071
FOR ALL ENTRIES IN li_e070
WHERE trkorr = li_e070-trkorr.
ENDIF.
DELETE li_e071 WHERE objfunc = 'D'.
**
LOOP AT li_e071.
CLEAR li_devobjlist.
MOVE-CORRESPONDING li_e071 TO li_devobjlist.
READ TABLE i_requestlist WITH KEY requestid = li_e071-trkorr TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
li_devobjlist-requestid = li_e071-trkorr.
ELSE.
li_devobjlist-taskid = li_e071-trkorr.
READ TABLE li_e070 WITH KEY trkorr = li_e071-trkorr.
IF sy-subrc = 0.
li_devobjlist-requestid = li_e070-strkorr.
ENDIF.
ENDIF.
READ TABLE li_e07t WITH KEY trkorr = li_devobjlist-requestid.
IF sy-subrc = 0.
li_devobjlist-as4text = li_e07t-as4text.
ENDIF.
READ TABLE lt_object_table WITH KEY pgmid = li_e071-pgmid object = li_e071-object.
IF sy-subrc = 0.
li_devobjlist-text = lt_object_table-text.
ENDIF.
APPEND li_devobjlist.
ENDLOOP.
**
LOOP AT li_e071 WHERE pgmid = 'CORR' AND object = 'MERG'.
CLEAR l_trkorr_rec.
SPLIT li_e071-obj_name AT space INTO l_trkorr_rec l_tempstr.
li_requestlist_rec-requestid = l_trkorr_rec.
APPEND li_requestlist_rec.
ENDLOOP.
IF li_requestlist_rec[] IS NOT INITIAL.
SORT li_requestlist_rec BY requestid ASCENDING.
DELETE ADJACENT DUPLICATES FROM li_requestlist_rec COMPARING ALL FIELDS.
CALL FUNCTION 'ZBS00_FM_GETDEVOBJ'
TABLES
i_requestlist = li_requestlist_rec[]
o_devobjlist = li_devobjlist_rec[].
APPEND LINES OF li_devobjlist_rec[] TO li_devobjlist[].
ENDIF.
SORT li_devobjlist[] BY requestid ASCENDING taskid ASCENDING as4pos ASCENDING.
DELETE ADJACENT DUPLICATES FROM li_devobjlist[] COMPARING requestid taskid as4pos.
o_devobjlist[] = li_devobjlist[].
"展示
CALL SCREEN 8001.html
最後對象信息保存在 內表o_devobjlist[],用table control進行了展示url