Shared Top Border

Enterprise Resource
Planning Portal

 

Advertise | Founder BLOG

ERPGenie.COM ABAP Tips and Tricks Database

THE ultimate
ERP website

 

Forums | Vote for us |

Google    Other Search Options

Login

Login to view more content!!!





Lost Password?
No account yet? Register

Registered Access

Poll

What area of ABAP are you interested in?
 
Home arrow Utilities arrow ABAP Utilities arrow Report on transport import errors across systems
Report on transport import errors across systems PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Pavan Rachamalla   
Thursday, 26 July 2007
Useful report that lists transports and whether they were successfully imported into the target system.

*&---------------------------------------------------------------------*
*& Report  ZCAR_CR_REV_DET
*&---------------------------------------------------------------------*

report  zcar_cr_rev_det.
type-pools : ctslg.
tables : e070.
selection-
screen begin of block bl1.
  
select-options: s_trkorr for  e070-trkorr.
  
select-options  s_date   for  e070-as4date.
  
select-options  s_user   for  e070-as4user.
selection-
screen end of block bl1.

selection-
screen begin of block bl2.
  
parameters p_sys    type tmscroute-sysnam obligatory.
  
parameters p_sys1   type tmscroute-sysnam.
selection-
screen end of block bl2.

data: ls_request  type  ctslg_request_info,
      lv_username 
type  e070-as4user,
      ls_settings 
type ctslg_settings.
data : wa_systems   type ctslg_system,
       it_steps     
type ctslg_steps,
       wa_step      
type ctslg_step.
data : l_rc  type ctslg_step-rc.
data : it_e070 type standard table of e070,
       wa_e070 
type e070.
data : begin of it_result occurs 0,
         trkorr 
type e070-trkorr,
         rc   
type ctslg_step-rc,
         rc1  
type ctslg_step-rc,
         sys  
type tmscroute-sysnam,
         as4text 
type ctslg_request_info-header-as4text,
         as4date 
type ctslg_request_info-header-as4date,
         as4time 
type ctslg_request_info-header-as4time,
       
end of it_result.

select *
  
from e070
  
into table it_e070
 
where trkorr in s_trkorr
   
and as4user in s_user
   
and as4date in s_date.
if sy-subrc = 0.
  
loop at it_e070 into wa_e070.
    ls_request-
header-trkorr = wa_e070-trkorr.
    
call function 'TRINT_READ_REQUEST_HEADER'
      
exporting
        iv_read_e070   = 
'X'
        iv_read_e07t   = 
'X'
      
changing
        cs_request     = ls_request-
header
      
exceptions
        empty_trkorr   = 
1
        not_exist_e070 = 
2
        
others         = 3.
    
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    
endif.
    ls_settings-point_to_missing_steps = 
'X'.
    ls_settings-detailed_depiction     = 
'X'.
    
call function 'TR_READ_GLOBAL_INFO_OF_REQUEST'
      
exporting
        iv_trkorr   = wa_e070-trkorr
        iv_dir_type = 
'T'
        is_settings = ls_settings
      
importing
        es_cofile   = ls_request-cofile
        ev_user     = lv_username
        ev_project  = ls_request-project.
    
read table ls_request-cofile-systems into wa_systems with key systemid = p_sys.
    
if sy-subrc = 0.
      it_steps[] = wa_systems-steps.
      
sort it_steps by actions descending.
      
delete adjacent duplicates from it_steps comparing clientid stepid.
      
delete it_steps where stepid cn sy-abcde.
      
loop at it_steps into wa_step.
        
if sy-tabix = 1.
          l_rc = wa_step-rc.
        
elseif wa_step-rc > l_rc.
          l_rc = wa_step-rc.
        
endif.
      
endloop.
      
if sy-subrc = 0.
        it_result-trkorr = wa_e070-trkorr.
        it_result-as4text = ls_request-
header-as4text.
        it_result-as4date = ls_request-
header-as4date.
        it_result-as4time = ls_request-
header-as4time.
        it_result-sys = ls_request-
header-tarsystem.
        it_result-rc  = l_rc.
        l_rc = 
'999'.
        
refresh it_steps.
        
read table ls_request-cofile-systems into wa_systems with key systemid = p_sys1.
        
if sy-subrc = 0.
          it_steps[] = wa_systems-steps.
          
sort it_steps by actions descending.
          
delete adjacent duplicates from it_steps comparing clientid stepid.
          
delete it_steps where stepid cn sy-abcde.
        
endif.
        
loop at it_steps into wa_step.
          
if sy-tabix = 1.
            l_rc = wa_step-rc.
          
elseif wa_step-rc > l_rc.
            l_rc = wa_step-rc.
          
endif.
        
endloop.
        it_result-rc1 = l_rc.
        
append it_result.
        
clear  it_result.
      
endif.
    
endif.
  
endloop.
endif.
if not it_result[] is initial.
  
data : l_text(10type c.
  
data : l_text1(10type c.
  
if p_sys = space.
    l_text = 
'N/A'.
  
else.
    
concatenate 'RC in ' p_sys
           
into l_text
      
separated by space.
  
endif.
  
if p_sys1 = space.
    l_text1 = 
'N/A'.
  
else<