Datenstrom analysieren
Der RDI-Datenstrom kann in der Spoolverwaltung angeschaut werden. Diese Ansicht ist jedoch – da normaler Text unformatiert angezeigt wird – nicht sehr übersichtlich…
Das folgende Programm zeigt einen RDI-Datenstrom einigermaßen strukturiert an. Es werden die Fensternamen, Variablennamen und Variablenwerte farbig dargestellt.
REPORT z_anzeige_rdi_datenstrom LINE-SIZE 255 LINE-COUNT 65.
DATA:
tbuffer LIKE soli OCCURS 0 WITH HEADER LINE,
BEGIN OF s1,
window(9),
new_stream(1),
new_block(1),
element(30),
variable(131),
length(3),
value(200),
END OF s1,
m LIKE s1,
v VALUE ‘|’,
datum LIKE sy-datum,
zeit like sy-uzeit,
t_tsp01 LIKE tsp01sys OCCURS 0 WITH HEADER LINE.
SELECT-OPTIONS:
s_rqown FOR t_tsp01-rqowner DEFAULT sy-uname OBLIGATORY,
s_datum FOR sy-datum DEFAULT sy-datum.
PARAMETERS:
p_last AS CHECKBOX DEFAULT ‘X’.
START-OF-SELECTION.
CALL FUNCTION ‘RSPO_ISELECT_SPOOLREQS’
EXPORTING
rfcsystem = ‘NONE’
TABLES
s_rqowne = s_rqown
s_rqcred = s_datum
result_tsp01 = t_tsp01
EXCEPTIONS
error = 1
OTHERS = 2.
CHECK sy-subrc = 0.
ULINE.
sort t_tsp01 by RQCRETIME descending.
LOOP AT t_tsp01.
FORMAT HOTSPOT ON.
datum = t_tsp01-rqcretime(8).
ZEIT = T_TSP01-rqcretime+8(6).
WRITE: / v, t_tsp01-rq0name,
v, t_tsp01-rq1name,
v, t_tsp01-rq2name,
v, t_tsp01-rqtitle,
v, datum, zeit, v.
HIDE t_tsp01.
ENDLOOP.
CLEAR t_tsp01.
ULINE.
IF p_last = ‘X’.
CLEAR p_last.
SET CURSOR LINE 4.
SET USER-COMMAND ‘PICK’.
ENDIF.
AT LINE-SELECTION.
REFRESH tbuffer.
CALL FUNCTION ‘RSPO_RETURN_SPOOLJOB’
EXPORTING
rqident = t_tsp01-rqident
desired_type = ‘RAW’
TABLES
buffer = tbuffer
EXCEPTIONS
no_such_job = 1
job_contains_no_data = 2
selection_empty = 3
no_permission = 4
can_not_access = 5
read_error = 6
type_no_match = 7
OTHERS = 8.
IF sy-subrc > 0.
CASE sy-subrc.
WHEN 1. WRITE: / ‘no such job’.
WHEN 2. WRITE: / ‘job contains no data’.
WHEN 3. WRITE: / ‘selection empty’.
WHEN 4. WRITE: / ‘no permission’.
WHEN 5. WRITE: / ‘can not access’.
WHEN 6. WRITE: / ‘read error’.
WHEN 7. WRITE: / ‘type does not match’.
WHEN 8. WRITE: / ‘others’.
ENDCASE.
ELSE.
LOOP AT tbuffer FROM 4.
NEW-LINE.
s1 = tbuffer.
CHECK s1(4) <> ‘CRDI’.
CHECK s1-new_block = ‘X’ OR
( s1-variable <> space OR s1-value <> space ).
WRITE AT 1 s1-new_block.
IF m-element <> s1-element or s1-new_block = ‘X’.
m-element = s1-element.
WRITE AT 3 s1-element(20) COLOR 3.
ENDIF.
IF m-variable <> s1-variable.
m-variable = s1-variable.
WRITE AT 25 s1-variable(30) COLOR 4.
ENDIF.
WRITE AT 57 s1-value(80).
ENDLOOP.
ENDIF.
- Interview mit Björn Schulz (Software-Heroes.com) - 3. September 2024
- Daten aus ALV ermitteln - 3. September 2024
- So lange es den SAPGUI noch gibt… - 27. Juni 2024