Google Search - Blog...........

ABAP - Display All Requests Under A User With Status.

REPORT ztest line-size 160.

tables: e070.

types: begin of ty_final,
TRKORR type e070-TRKORR,
desc type char35,
status type char35,
type type char35,
AS4USER type e070-AS4USER,
AS4DATE type sy-datum,
AS4TIME type sy-uzeit,
end of ty_final.

types: begin of ty_request.
include structure e070.
types: end of ty_request.


data: it_request type standard table of ty_request with header line,
it_final type standard table of ty_final with header line.



select-options: s_req for e070-TRKORR.
parameters:p_user type sy-uname.

start-of-selection.

select * from e070
into table it_request
where TRKORR in s_req
and AS4USER = p_user.

if not it_request[] is initial.

loop at it_request.
it_final-TRKORR = it_request-TRKORR.
case: it_request-TRFUNCTION.
when 'K'.
it_final-desc = 'Workbench Request'.
when 'W'.
it_final-desc = 'Customizing Request'.
when 'C' .
it_final-desc = 'Relocation of Objects Without Package Change'.
when 'O' .
it_final-desc = 'Relocation of Objects with Package Change'.
when 'E' .
it_final-desc = 'Relocation of Complete Package'.
when 'T' .
it_final-desc = 'Transport of Copies'.
when 'S' .
it_final-desc = 'Development/Correction'.
when 'R' .
it_final-desc = 'Repair'.
when 'X' .
it_final-desc = 'Unclassified Task'.
when 'Q' .
it_final-desc = 'Customizing Task'.
when 'G' .
it_final-desc = 'Piece List for CTS Project'.
when 'M' .
it_final-desc = 'Client Transport Request'.
when 'P' .
it_final-desc = 'Piece List for Upgrade'.
when 'D' .
it_final-desc = 'Piece List for Support Package'.
when 'F' .
it_final-desc = 'Piece List'.
endcase.

case it_request-TRSTATUS.
when 'D'.
it_final-status = 'Modifiable'.
when 'L'.
it_final-status = 'Modifiable, Protected'.
when 'O'.
it_final-status = 'Release Started'.
when 'R'.
it_final-status = 'Released'.
when 'N'.
it_final-status = 'Released (with Import Protection for Repaired Objects)'.
endcase.

case: it_request-KORRDEV.
when 'CUST'.
it_final-type = 'Client-specific Customizing'.
when 'SYST'.
it_final-type = 'Repository, cross-client objects'.
endcase.
it_final-AS4USER = it_request-AS4USER.
it_final-AS4DATE = it_request-AS4DATE.
it_final-AS4TIME = it_request-AS4TIME .

if not it_final-TRKORR is initial.
append it_final.
clear it_final.
endif.
endloop.
endif.

sort it_final by desc.

format color 7.
write:/1 'Request/Tas',
20 'Description of Req/Task',
50 'Status',
63 'Type of Request',
100 'User name',
120 'Changed Date',
140 'Changed Time' .
format color off.

loop at it_final.
write:/1 it_final-TRKORR,
20 it_final-desc,
50 it_final-status,
63 it_final-type,
100 it_final-AS4USER,
120 it_final-AS4DATE,
140 it_final-AS4TIME.
endloop.

the selection screen is like this :




and the output is like this :

No comments:

Post a Comment