Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
rameez_khan
Active Participant
90,149

Introduction:


While many of us would like to simulate/check our transport request for error before we import the changes into production system, it becomes almost a necessity during big Go-Live's / Release Management phase to sequence the transport request and check dependency between requests.

Although there are lot of solutions already been implemented like the followings

Home Made Transport Sequencer
Transport Checking Tool Object Level
Program to Simulate Transport Request

it is always best to use tools provided by SAP.

Solution:


With ST-PI component, SAP has delivered tcode /SDF/TRCHECK (program: /SDF/CMO_TR_CHECK) which makes sure errors of transport request gets detected before TR is imported to production system.

Refer to program documentation for details.

Lot more details can be found in

Note: 2475591
TR check tool

Idea:


Given that we have a solution doesn't mean we end up using it to the best of its value. Hence it will be great to integrate this with SE10. 😉

I implemented BADI: CTS_REQUEST_CHECK to execute report: /SDF/CMO_TR_CHECK before releasing the transport request (method: CHECK_BEFORE_RELEASE) and then giving a pop-up to decide if I wish to continue to release the transport request.

Also I created a custom SET/GET parameter to ensure BADI calls report only when the user parameter is set to X.

To conclude:


Results are good 🙂

Identifies if objects are missing in production system.



Catches missing transport request.



Can be a life saver 🙂

 

Update 31st July 2020.


Code as follows:
"----------------------------------------------------- Data Declaration

DATA:
lr_transports TYPE RANGE OF e070-trkorr,
lv_answer TYPE char1,
lf_perform_check TYPE xfeld.

CONSTANTS:
co_none TYPE rfcdes-rfcdest VALUE 'NONE',
co_production TYPE rfcdes-rfcdest VALUE 'RFC_FOR_PROD'.

"--------------------------------------------------------- Logical Code

CLEAR: lf_perform_check.
"---- Get parameter to check if TR check should be executed.
"---- This is done to control which users should be able to use this
"---- feature. Also helpful to switch off for certain transports where
"---- note or too many objects are being sent. Timeout can occur.
GET PARAMETER ID 'CHECK_TR' FIELD lf_perform_check.
IF lf_perform_check IS NOT INITIAL.

"----- Get main request
SELECT SINGLE strkorr
FROM e070
INTO @DATA(lv_main_transport)
WHERE trkorr EQ @request.
IF sy-subrc IS NOT INITIAL.
"--- No Main TR ???
"--- Impossible..
RAISE cancel.
ENDIF.

CLEAR: lr_transports[].
"---- Collect TR in range
APPEND VALUE #( sign = 'I' option = 'EQ' low = lv_main_transport )
TO lr_transports.

"--- Note: We have excluded/included certain options.
"--- This is done for our requirement, you can select
"--- any of the below based on your requirement.

"--- Call report to check transport request
SUBMIT /sdf/cmo_tr_check
WITH p_source = co_none "-- Source System
WITH p_target = co_production "-- Target System
WITH r_prj_co = abap_true "-- Check TR
WITH p_ori_tr IN lr_transports "-- Give TR number
WITH p_crsref = abap_true "-- Cross reference
"-- WITH p_dgp = abap_true "-- Sequence Check
WITH p_swcomp = abap_true "-- Cross release
"-- WITH p_imptim = abap_true "-- Import Time in source
"-- WITH p_oichck = abap_true "-- Online import check
AND RETURN.

CLEAR: lv_answer.
"---- Confirm from User if he wishes to release TR
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = TEXT-a01 "-- Release Transport Request
text_question = TEXT-a02 "-- Continue to release TR ?
display_cancel_button = abap_true
IMPORTING
answer = lv_answer
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
CLEAR: lv_answer.
ENDIF.

IF lv_answer EQ '1'.
"--- Release transport request
ELSE.
"--- Cancel release of TR
RAISE cancel.
ENDIF.
ENDIF.
26 Comments
Labels in this area