SAP的请求传输系统是一个用于将开发、测试、生产环境中的SAP对象(如ABAP程序、数据表等)从一个环境传输到另一个环境的工具。通过使用请求传输系统,用户可以在不同的SAP系统中进行协作,确保所有的环境都具有相同的开发状态和功能。
该系统的核心概念是“请求(Request)”,一个请求是包含一个或多个SAP对象的逻辑单元。用户可以在开发系统中创建请求,并通过传输工具将请求传输到其他系统。请求可以被用于许多不同的目的,例如将开发完成的代码传输到测试系统进行测试,或者将测试过的代码传输到生产系统中进行生产。
请求传输系统的使用需要一定的技术知识和经验,因此通常由专业的SAP管理员或开发人员来管理和维护。它是SAP系统中重要的组成部分,帮助企业保持高效的开发和协作。
(以上文字是AI生成的,AI果然很牛。本来吭哧瘪肚的憋不出来几句话,用AI生成就爽多了哈)
SAP的请求传输相比其他系统的版本更新机制是个很爽的存在,在不停机,不耽误应用的情况下就把版本更新了,比Java的发版不知道高级到哪儿去了。
但是SAP的请求传输管理不是太人性化,批量查看有点费劲,如果你是一个有追求的BASIS或者ABAPer,下面这个程序可能会很适合你。
选择界面:
结果展示:
挨个列双击一下,还有这些功能:
如果去掉选择界面的勾,也可以显示未释放的请求:
是不是用起来挺爽的?
代码如下:
*&---------------------------------------------------------------------*
Report ZTRTRACE
*&
*&---------------------------------------------------------------------*
Baitianzhen
传输请求状态跟踪
*&---------------------------------------------------------------------*
REPORT ztrtrace NO STANDARD PAGE HEADING .
slis,ctslg. :
TABLES: e070,e07t,e070c.
DATA: fldct TYPE slis_t_fieldcat_alv,
slayt TYPE slis_layout_alv,
varnt LIKE disvariant,
repid LIKE sy-repid,
datum LIKE sy-datum,
tabix LIKE sy-tabix,
maxrc LIKE sy-subrc.
DATA: led_gray(4) VALUE '@BZ@',
VALUE '@5C@',
VALUE '@5D@',
VALUE '@5B@'.
DATA: BEGIN OF it_out OCCURS 0,
trkorr LIKE e070-trkorr,
trfunction LIKE e070-trfunction,
trstatus LIKE e070-trstatus,
srcsystem LIKE e070-tarsystem,
srclient LIKE e070c-client,
tarsystem LIKE e070-tarsystem,
as4user LIKE e070-as4user,
as4date LIKE e070-as4date,
as4text LIKE e07t-as4text,
typetext TYPE seu_name,
ledrel(4),
ledqas(4),
ledpre(4),
ledsys(4),
ledprd(4),
viewobj(4),
viewlog(4),
END OF it_out.
DATA: BEGIN OF it_dd07t OCCURS 0,
trfunction LIKE e070-trfunction,
ddtext LIKE dd07t-ddtext,
END OF it_dd07t.
DATA: ctsystem TYPE ctslg_system.
DATA: it_comm TYPE tmscsyslst_typ WITH HEADER LINE.
RANGES r_status FOR e070-trstatus.
BEGIN OF BLOCK b1 WITH FRAME TITLE t1.
s_reqst FOR e070-trkorr. :
s_rtext FOR e07t-as4text. :
s_ruser FOR e070-as4user DEFAULT sy-uname. :
s_srsys FOR e070-tarsystem DEFAULT sy-sysid. :
s_rdate FOR e070-as4date DEFAULT datum TO sy-datum. :
PARAMETERS: p_reled AS CHECKBOX DEFAULT 'X'.
END OF BLOCK b1.
BEGIN OF BLOCK b2 WITH FRAME TITLE t2.
PARAMETERS: p_dev TYPE sysysid DEFAULT sy-sysid OBLIGATORY.
PARAMETERS: p_qas TYPE sysysid DEFAULT 'HSQ' .
PARAMETERS: p_pre TYPE sysysid DEFAULT ''.
PARAMETERS: p_sys TYPE sysysid DEFAULT ''.
PARAMETERS: p_prd TYPE sysysid DEFAULT 'HSP' OBLIGATORY.
END OF BLOCK b2.
LOAD-OF-PROGRAM.
datum = sy-datum - 120.
AT SELECTION-SCREEN OUTPUT.
t1 = '请求选择'.
t2 = '传输系统'.
'请求号'. =
'请求描述'. =
'所有者'. =
'源系统'. =
'最后更改日期'. =
'只选择已释放的请求'. =
'DEV系统'. =
'QAS系统'. =
'Pre.PRD'. =
'其他系统'. =
'PRD系统'. =
START-OF-SELECTION.
PERFORM getdata.
PERFORM outdata.
*&---------------------------------------------------------------------*
Form getdata
*&---------------------------------------------------------------------*
FORM getdata.
CLEAR it_comm[].
p_dev. =
APPEND it_comm.
p_qas. =
APPEND it_comm.
p_pre. =
APPEND it_comm.
p_sys. =
APPEND it_comm.
p_prd. =
APPEND it_comm.
DELETE it_comm WHERE sysnam IS INITIAL.
SELECT domvalue_l ddtext INTO TABLE it_dd07t
FROM dd07t
WHERE domname = 'TRFUNCTION' AND
ddlanguage = sy-langu AND
as4local = 'A'.
CLEAR: r_status,r_status[].
IF p_reled = 'X'.
'I'. =
'EQ'. =
'R'. =
APPEND r_status.
'N'. =
APPEND r_status.
ENDIF.
SELECT trkorr
trfunction
trstatus
tarsystem
as4user
as4date
INTO CORRESPONDING FIELDS OF TABLE it_out
FROM e070
WHERE trkorr IN s_reqst AND
as4user IN s_ruser AND
as4date IN s_rdate AND
trstatus IN r_status AND
strkorr = ''.
LOOP AT it_out.
READ TABLE it_dd07t WITH KEY trfunction = it_out-trfunction.
IF sy-subrc = 0.
it_dd07t-ddtext. =
ENDIF.
SELECT SINGLE as4text INTO it_out-as4text
FROM e07t
WHERE trkorr = it_out-trkorr AND
langu = sy-langu.
IF sy-subrc <> 0.
SELECT SINGLE as4text INTO it_out-as4text
FROM e07t
WHERE trkorr = it_out-trkorr .
ENDIF.
SELECT SINGLE client INTO it_out-srclient
FROM e070c
WHERE trkorr = it_out-trkorr.
it_out-trkorr(3). =
IF s_srsys[] IS NOT INITIAL AND it_out-srcsystem NOT IN s_srsys.
DELETE it_out.
CONTINUE.
ENDIF.
IF s_rtext[] IS NOT INITIAL AND it_out-as4text NOT IN s_rtext.
DELETE it_out.
CONTINUE.
ENDIF.
CASE it_out-trstatus.
WHEN 'R' OR 'N'.
led_green. =
'@0P@'. =
'@10@'. =
WHEN 'O'.
led_yellow. =
WHEN OTHERS.
led_gray. =
ENDCASE.
PERFORM gettrlog CHANGING it_out.
MODIFY it_out.
ENDLOOP.
SORT it_out DESCENDING BY ledqas ledpre ledsys ledprd trkorr ASCENDING.
"getdata
*&---------------------------------------------------------------------*
Form gettrlog
*&---------------------------------------------------------------------*
FORM gettrlog CHANGING wa STRUCTURE it_out .
DATA is_settings TYPE ctslg_settings.
DATA es_cofile TYPE ctslg_cofile.
DATA lt_systems TYPE ctslg_systems WITH HEADER LINE.
'X'. =
'X'. =
CALL FUNCTION 'TR_READ_GLOBAL_INFO_OF_REQUEST'
EXPORTING
iv_trkorr = wa-trkorr
is_settings = is_settings
it_comm_systems = it_comm[]
IMPORTING
es_cofile = es_cofile.
es_cofile-systems[]. =
PERFORM getimportrc TABLES lt_systems
USING: p_qas CHANGING wa-ledqas,
p_pre CHANGING wa-ledpre,
p_sys CHANGING wa-ledsys,
p_prd CHANGING wa-ledprd.
"gettrlog
*&---------------------------------------------------------------------*
Form getrc
*&---------------------------------------------------------------------*
FORM getimportrc TABLES intab STRUCTURE ctsystem USING target CHANGING rc.
DATA wa_step TYPE ctslg_step.
DATA maxrc TYPE sy-subrc.
CHECK target IS NOT INITIAL.
READ TABLE intab WITH KEY systemid = target.
IF sy-subrc = 0.
READ TABLE intab-steps INTO wa_step WITH KEY stepid = 'E'.
IF sy-subrc <> 0.
LOOP AT intab-steps INTO wa_step WHERE stepid = 'I'.
tabix = sy-tabix.
ENDLOOP.
IF sy-subrc = 0.
CLEAR maxrc.
LOOP AT intab-steps INTO wa_step FROM tabix.
IF wa_step-rc > maxrc.
maxrc = wa_step-rc.
ENDIF.
ENDLOOP.
CASE maxrc.
WHEN 0.
rc = led_green.
WHEN 4 OR 6.
rc = led_yellow.
WHEN 8 OR 16.
rc = led_red.
ENDCASE.
ELSE.
rc = led_gray.
ENDIF.
ENDIF.
ENDIF.
"getrc
*&---------------------------------------------------------------------*
Form outdata
*&---------------------------------------------------------------------*
FORM outdata.
DATA: str(40).
'X'. =
'X'. =
repid = sy-repid.
PERFORM catlg_set USING: 'TRKORR ' '' '' '请求',
' '' '' '请求描述',
' '' '' '请求类型',
' '' '' '释放状态',
'' '' '源系统',
' '' '' '源Client',
' '' '' '目标系统',
' '' '' '所有者',
' '' '' '最后更改日期' .
IF p_qas IS NOT INITIAL.
CONCATENATE p_qas '状态' INTO str.
PERFORM catlg_set USING: 'LEDQAS' '' '' str.
ENDIF.
IF p_pre IS NOT INITIAL.
CONCATENATE p_pre '状态' INTO str.
PERFORM catlg_set USING: 'LEDPRE' '' '' str.
ENDIF.
IF p_sys IS NOT INITIAL.
CONCATENATE p_sys '状态' INTO str.
PERFORM catlg_set USING: 'LEDSYS' '' '' str.
ENDIF.
IF p_prd IS NOT INITIAL.
CONCATENATE p_prd '状态' INTO str.
PERFORM catlg_set USING: 'LEDPRD' '' '' str.
ENDIF.
PERFORM catlg_set USING: 'VIEWOBJ' '' '' '对象列表'.
PERFORM catlg_set USING: 'VIEWLOG' '' '' '传输日志'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = repid
it_fieldcat = fldct[]
i_save = 'A'
is_layout = slayt
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = it_out
EXCEPTIONS
program_error = 1
OTHERS = 2.
" outdata
*---------------------------------------------------------------------*
FORM frm_catlg_set *
*---------------------------------------------------------------------*
FORM catlg_set USING p_field p_reftab p_reffld p_text.
DATA: ls_fldct TYPE slis_fieldcat_alv.
p_field. =
p_text. =
'L'. =
p_reffld. =
p_reftab. =
IF ls_fldct-fieldname(3) = 'LED'.
'X'. =
'C'. =
ENDIF.
IF ls_fldct-fieldname(4) = 'VIEW'.
'X'. =
'C'. =
ENDIF.
APPEND ls_fldct TO fldct .
CLEAR ls_fldct .
"catlg_set
*&--------------------------------------------------------------------*
Form user_command
*&--------------------------------------------------------------------*
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'. "双击
CHECK rs_selfield-tabindex <> 0 . "小计行总计行什么的忽略
READ TABLE it_out INDEX rs_selfield-tabindex.
CASE rs_selfield-fieldname.
WHEN 'TRKORR' OR 'AS4TEXT'.
CALL FUNCTION 'TR_PRESENT_REQUEST'
EXPORTING
iv_trkorr = it_out-trkorr.
WHEN 'VIEWLOG'.
CHECK rs_selfield-value IS NOT INITIAL.
CALL FUNCTION 'TMS_UI_SHOW_TRANSPORT_LOGS'
EXPORTING
iv_request = it_out-trkorr
EXCEPTIONS
OTHERS = 1.
WHEN 'VIEWOBJ'.
CHECK rs_selfield-value IS NOT INITIAL.
CALL FUNCTION 'TMS_UI_SHOW_TRANSPORT_REQUEST'
EXPORTING
iv_request = it_out-trkorr
EXCEPTIONS
OTHERS = 1.
WHEN OTHERS.
ENDCASE.
ENDCASE.
"user_com