SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Overview transport requests for all systems



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Transport and Upgrade | Транспорт и Обновления
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sun Jan 20, 2008 12:26 am    Post subject: Overview transport requests for all systems Reply with quote

Overview transport requests for all systems
Hans Senden

In the R/3 transport management system you can find a lot of information about transports, but a list with the status (import date/time) of transports for the development system, quality system and production is hard to build from standard SAP. So i have created a Z-program for it.

The basic part of the program is the data retrieval from the relevant tables and using the relevant function modules :

Tables:
E070 : Change & Transport System: Header of Requests/Tasks
E07T : Change & Transport System: Short Texts for Requests/Tasks

Function modules:
STRF_READ_COFILE : Read and interpret contents of the COFILE

The select-options for my report are :
S_TRKORR (type E070-TRKORR) : transport request or task id
S_AS4TXT (type E07T-AS4TEXT) : transport request or task description (transports description belonging to project starts with project relevant prefix, so we can select easily all project related transports)

The following systems are uses :
DEV for development
QAS for quality
PRD for production

The code for the data retrieval is :
Code:
FORM get_data CHANGING pi_output TYPE tt_output.
*
 DATA: li_output2 TYPE tt_output,
 lwa_output LIKE LINE OF li_output2,
 li_cofi_lines TYPE TABLE OF tstrfcofil,
 lwa_cofi LIKE LINE OF li_cofi_lines.
* 1. get all relevant transport request/task based on select-options
 FREE: pi_output, li_output2.
 SELECT * INTO CORRESPONDING FIELDS OF TABLE pi_output
 FROM e07t INNER JOIN e070 ON e070~trkorr = e07t~trkorr
 WHERE e07t~trkorr IN s_trkorr
 AND e07t~as4text IN s_as4txt
 AND e07t~langu EQ g_language.
 CHECK sy-subrc EQ 0.
* 2. only data concerning transport requests are part of the overview*     so we have to determined the request id's belonging to the task
 APPEND LINES OF pi_output TO li_output2.
 DELETE li_output2 WHERE strkorr EQ ''.    "delete requests from help table
 IF li_output2 IS NOT INITIAL.
* li_output2 contains all tasks for given condition
 SELECT * APPENDING CORRESPONDING FIELDS OF TABLE pi_output
 FROM e07t INNER JOIN e070 ON e070~trkorr = e07t~trkorr
 FOR ALL entries IN li_output2
 WHERE e07t~trkorr EQ li_output2-strkorr
 AND e07t~as4text IN s_as4txt
 AND e07t~langu EQ g_language.
 ENDIF.
 SORT pi_output BY trkorr.
 DELETE ADJACENT DUPLICATES FROM pi_output COMPARING trkorr.

* 3. delete all tasks
 DELETE pi_output WHERE strkorr NE ''.

* 4. get additional info
 LOOP AT pi_output ASSIGNING <fs_output>.

 IF <fs_output>-trkorr IS INITIAL.
 DELETE pi_output.
 CONTINUE.
 ENDIF.
 FREE: li_cofi_lines.

 IF <fs_output>-trstatus EQ c_trstatus_modifiable.      "D
* transport request is modifiable, no further info can be found
* by function STRF_READ_COFILE
 <fs_output>-dev_as4date = <fs_output>-as4date.
 <fs_output>-dev_as4time = <fs_output>-as4time.
 CONTINUE.
 ENDIF.

* 4a. get transport log info
 CALL FUNCTION 'STRF_READ_COFILE'
 EXPORTING
 iv_dirtype = 'T'
 iv_trkorr = <fs_output>-trkorr
* IV_READ_HEADER = 'X'
* IV_TRANSPORT_DIRECTORY = ' '
* IMPORTING
* EV_COFI_HEADER =
* EV_PROJECT =
* ET_PREDECESSORS =
 TABLES
 tt_cofi_lines = li_cofi_lines
 EXCEPTIONS
 wrong_call = 1
 no_info_found = 2
 OTHERS = 3.
 IF sy-subrc NE 0.
* transport request is released, but cannot be found in transport log
* so probably it's an older one, that is deleted from the log files
* Fill all dates/times with the only known one
 <fs_output>-dev_as4date = <fs_output>-as4date.
 <fs_output>-dev_as4time = <fs_output>-as4time.
 <fs_output>-qas_as4date = <fs_output>-as4date.
 <fs_output>-qas_as4time = <fs_output>-as4time.
 <fs_output>-prd_as4date = <fs_output>-as4date.
 <fs_output>-prd_as4time = <fs_output>-as4time.
 CONTINUE.
 ENDIF.
*
 SORT li_cofi_lines BY tarsystem trdate trtime.
* get first DEV date/time in the log
 READ TABLE li_cofi_lines INTO lwa_cofi
 WITH KEY tarsystem = 'DEV'.
 IF sy-subrc EQ 0.
 <fs_output>-dev_as4date = lwa_cofi-trdate.
 <fs_output>-dev_as4time = lwa_cofi-trtime.
 ENDIF.
* get first QAS Import date/time
 READ TABLE li_cofi_lines INTO lwa_cofi
 WITH KEY tarsystem = 'QAS'
 function = 'I'. "import
 IF sy-subrc EQ 0.
 <fs_output>-qas_as4date = lwa_cofi-trdate.
 <fs_output>-qas_as4time = lwa_cofi-trtime.
 ENDIF.
* get first PRD Import date/time
 READ TABLE li_cofi_lines INTO lwa_cofi
 WITH KEY tarsystem = 'PRD'
 function = 'I'. "import
 IF sy-subrc EQ 0.
 <fs_output>-prd_as4date = lwa_cofi-trdate.
 <fs_output>-prd_as4time = lwa_cofi-trtime.
 ENDIF.

 ENDLOOP.

 SORT pi_output BY trkorr.
*
ENDFORM. " get_data
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Transport and Upgrade | Транспорт и Обновления All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.