Hi ABAPers,
I would like to have the opportunity to share a useful development warning system.
Many of us have experienced problems when transporting objects from DEV- > QMS -> PRD. When more than one user starts working on a single object it becomes a problem to keep the transports in sync. The idea focuses in warning developers when he/she is about to make changes to an object that has been released from development server but is now in quality. This means the last development on the object will get overlapped if we make additional changes and transport them. The warning will help us know easily if anybody else is working on the same object.
To give warnings to developers when last change to an object is not in production
PROBLEM DESCRIPTION
It has often been observed that multiple developers are working on common objects, be it an ABAP report, a function module, or a change in a table structure. Such changes have a lot of dependency and often are the cause of conflicts during acceptance phase due to overwriting of changes.
PRELIMINARY DIAGNOSIS
For example, a user had added a lot of objects in a transport for PROJECTX and is in quality. Now a small change comes up and that change needs to be done to an object that is already included among the list of objects to be transported in PROJECTX transport. The developer makes the changes unaware of the dependency and moves his fix to production. Now the customer is happy, but when the PROJECTX transport goes to production, it overwrites the changes are restores it. The customer complains that the changes are not working after PROJECTX rollout to production.
DETAILED DIAGNOSIS
Suppose we consider a ticket IMXXXX001 in which a developer DEV01 is supposed to make some changes to REPORT ZREPORT_01. The developer opens the report, makes the desired changes to the report to meet the current requirements, creates a new transport request for the change and releases it and the updates the etracker for the changes to be transported to quality. Meanwhile, another developer, DEV02 is assigned a ticket IMXXXX002 for which he too has to make some changes to REPORT ZREPORT_01 to fix some issues. So he makes the changes and transports the changes to quality as well. Now that both their changes are in quality, they assign their etrackers to their respective Acceptance testers UAT01 and UAT02. Now UAT02 is quick and prompt and performs the acceptance test successfully. Both DEV02 and UAT02 are not aware that changes made by DEV01 are not yet acceptance tested and they decide to move their transports to production. Soon approvals are in place and the changes made by DEV02 alongwith the changes for DEV01 reach production. This means, the changes of DEV01 are in production without being acceptance tested. To complicate the issue further, UAT01 performs the acceptance test and finds the changes made by DEV01 are not working. Also, the customer starts complaining that the report is not working as expected (due to changes by DEV01). Such situations need to be avoided.
TEMPORARY WORKAROUND
The temporary workaround is to go to SE10, open the transports and check transport logs manually.
PERMANENT FIX
The permanent fix to this problem is to provide a warning to the developer in case the last change done (i.e. the transport number for the last version) is not yet in production. This means, the change is either in queue of being transported or currently in UAT phase. In case it is in UAT and it fails, there could be rework and make the changes further dependent.
The goal of the document is to make necessary adjustments in the development system in such a way that in case some developer is in the process of making changes to a dependent object, he/she will encounter a warning message, post to which the developer can identify and inform about the dependency to the respective IT manager and seek permission whether to continue with the changes ignoring the warning.
Here is an example of a table ZMSPOCEMAIL, the recent version of which is still in quality (as you can see below that the changes are still not in C0C and C05 which are the production systems). Though the solution works for any table whose recent changes are not in production, I will use this table as an example for the time being.
Suppose a user goes to SE11 and opens the table ZMSPOCEMAIL, checks the fields and decides to add a new field to it as per the latest requirement.
Now when he presses the change button a new screen pops up warning the developer that the last transport, though released from development, is not yet in production similar to the one shown below.
This message would warn the developer that some other developer might be working on the same table he wants to make changes on. However the developer may select Yes and continue to make the changes at this point which will help him continue making changes being aware of the risks or select No if he wishes to notify ITAM about the dependency and seek approval to continue making changes.
TECHNICAL DETAILS
There are 3 customer exit function modules that need to be activated. They are:
EXIT_SAPLSEDD_001 - For data dictionary objects
EXIT_SAPMS38L_001 - For function modules
EXIT_SAPLS38E_001 - For reports, includes etc. through the ABAP Editor
For this we have to go to SMOD and search for the enhancements.
These are:
SEDD0001 Customer exits in ABAP/4 Dictionary
SEU00004 Customer exits in the Function Library
SEUED001 ABAP Editor
We have to create a new project in CMOD and assign these enhancements, and activate the project.
After activation of project the necessary programming logic has to be written into the function modules mentioned. This would include using the function module GET_VERSION_LIST to fetch version information for the object to be edited, read the transport log for the highest version of the object using function module TR_READ_GLOBAL_INFO_OF_REQUEST, and finally using a popup message box which will prompt the developer that the last transport has not reached production.
This change needs to be implemented in the Development systems only.
POSSIBLE IMPROVEMENTS POST IMPLEMENTATION
- Reduction in dependency
- Efficient logging of dependent changes if any
- Reduction in rework
- Reduction in number of tickets reopened
- Increased compliance to quality processes and development standards
Given below is a working sample code for one of the exits which you can use with minor adjustments depending upon you system landscape.
Here is an example code for EXIT_SAPLSEDD_001 - Include ZXSEUU19
*&---------------------------------------------------------------------*
*& Include ZXSEUU19
*&---------------------------------------------------------------------*
DATA:
i_verslist TYPE TABLE OF vrsd_old,
i_systems TYPE ctslg_systems.
DATA:
wa_verslist TYPE vrsd_old,
wa_log TYPE ctslg_cofile,
wa_system TYPE LINE OF ctslg_systems,
wa_step TYPE LINE OF ctslg_steps,
wa_action TYPE LINE OF ctslg_actions.
DATA:
h_objname LIKE vrsd_old-objname,
h_objtype LIKE vrsd_old-objtype,
h_answer TYPE c,
h_trans LIKE e070-trkorr,
h_message TYPE char128.
CHECK operation = 'MODIFY'.
MOVE objectname TO h_objname.
MOVE objtype TO h_objtype.
*************
Please note that most of the times the last character of the
object type needs to be changed to D. e.g. TABS should be TABD, etc.
This should be verified in-situ and adjusted accordingly
*************
CALL FUNCTION 'GET_VERSION_LIST'
EXPORTING
objname = h_objname
objtype = h_objtype
TABLES
version_list = i_verslist.
SORT i_verslist BY versno DESCENDING.
CHECK i_verslist[] IS NOT INITIAL.
READ TABLE i_verslist INTO wa_verslist INDEX 1.
CHECK wa_verslist-korrnum IS NOT INITIAL.
MOVE wa_verslist-korrnum TO h_trans.
* read the transport log for the particular transport
CLEAR wa_log.
CALL FUNCTION 'TR_READ_GLOBAL_INFO_OF_REQUEST'
EXPORTING
iv_trkorr = h_trans
* IV_DIR_TYPE = 'T'
* IS_SETTINGS =
* IV_SUPPRESS_DELETED_STEPS = ' '
* IT_COMM_SYSTEMS =
IMPORTING
es_cofile = wa_log
* EV_USER =
* EV_PROJECT =
.
i_systems[] = wa_log-systems[].
CHECK i_systems[] IS NOT INITIAL.
*When C05 /C0C are the production systems
READ TABLE i_systems INTO wa_system WITH KEY systemid = 'C05'.
IF sy-subrc NE 0.
*not in c05
READ TABLE i_systems INTO wa_system WITH KEY systemid = 'C0C'.
CHECK sy-subrc NE 0.
ELSE.
*in c05
RETURN.
ENDIF.
h_message = 'The last transport & has not yet gone to production. Do you still want to edit the current object?'.
REPLACE ALL OCCURRENCES OF '&' IN h_message WITH wa_verslist-korrnum.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
* TITLEBAR = ' '
* DIAGNOSE_OBJECT = ' '
text_question = h_message
text_button_1 = 'Yes'(001)
* ICON_BUTTON_1 = ' '
text_button_2 = 'No'(002)
* ICON_BUTTON_2 = ' '
* DEFAULT_BUTTON = '1'
display_cancel_button = ''
* USERDEFINED_F1_HELP = ' '
* START_COLUMN = 25
* START_ROW = 6
* POPUP_TYPE =
* IV_QUICKINFO_BUTTON_1 = ' '
* IV_QUICKINFO_BUTTON_2 = ' '
IMPORTING
answer = h_answer
* TABLES
* PARAMETER =
EXCEPTIONS
text_not_found = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
IF h_answer NE '1'.
sy-msgid = 'E2'.
sy-msgno = '004'.
sy-msgv1 = 'Action Cancelled'.
RAISE cancelled.
ENDIF.