Code: Alles auswählen.
REPORT ABAPSTAT LINE-SIZE 1000.
DATA: T_SOURCE TYPE STANDARD TABLE OF ABAPSOURCE
WITH NON-UNIQUE DEFAULT KEY,
WA_LINE LIKE LINE OF T_SOURCE,
LONGROW(8000) TYPE C,
TMP LIKE LONGROW,
T_STATEMENTS LIKE STANDARD TABLE OF LONGROW
WITH NON-UNIQUE DEFAULT KEY,
STATEMENT LIKE LINE OF T_STATEMENTS,
T_DOPPELPUNKT LIKE T_STATEMENTS.
DATA: BUCHSTABEN TYPE I,
WOERTER TYPE I,
ANWEISUNGEN TYPE I,
ZEILEN TYPE SYTABIX.
PARAMETERS P_PROG LIKE D010SINF-PROG OBLIGATORY DEFAULT SY-REPID.
END-OF-SELECTION.
READ REPORT P_PROG INTO T_SOURCE.
LOOP AT T_SOURCE INTO WA_LINE.
CONCATENATE LONGROW WA_LINE INTO LONGROW SEPARATED BY SPACE.
ENDLOOP.
* Erstze Komma durch Komma+ Leerzeichen
DO.
REPLACE ',' WITH '^ ' INTO LONGROW.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
ENDDO.
DO.
REPLACE '^' WITH ',' INTO LONGROW.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
ENDDO.
CONDENSE LONGROW.
TMP = LONGROW.
CONDENSE TMP NO-GAPS.
BUCHSTABEN = STRLEN( TMP ).
WRITE:/ 'Buchstaben - ',AT 30 BUCHSTABEN.
SPLIT LONGROW AT ' ' INTO TABLE T_STATEMENTS.
DESCRIBE TABLE T_STATEMENTS LINES WOERTER.
WRITE:/ 'Wörter -',WOERTER UNDER BUCHSTABEN.
SPLIT LONGROW AT '.' INTO TABLE T_STATEMENTS.
LOOP AT T_STATEMENTS INTO STATEMENT.
IF STATEMENT NA ':'.
ADD 1 TO ANWEISUNGEN.
CONTINUE.
ENDIF.
SPLIT STATEMENT AT ',' INTO TABLE T_DOPPELPUNKT.
DESCRIBE TABLE T_DOPPELPUNKT LINES ZEILEN.
ANWEISUNGEN = ANWEISUNGEN + ZEILEN.
ENDLOOP.
WRITE:/ 'Anweisungen -',ANWEISUNGEN UNDER BUCHSTABEN.
Code: Alles auswählen.
*&---------------------------------------------------------------------*
*& Modulpool Z_ACHTELIK_TEST *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
INCLUDE z_achtelik_test_top . "
SELECT DISTINCT report INTO CORRESPONDING FIELDS OF TABLE t_v FROM
varit where report >= 'Z%' order by report.
LOOP AT t_v.
SELECT langu FROM varit INTO t_v-l
WHERE report = t_v-report.
ENDSELECT.
SELECT variant FROM varit INTO t_v-v1
WHERE report = t_v-report AND
langu = t_v-l.
ENDSELECT.
SELECT variant FROM varit INTO t_v-v2
WHERE report = t_v-report AND
langu = t_v-l AND
variant <> t_v-v1.
ENDSELECT.
SELECT variant FROM varit INTO t_v-v3
WHERE report = t_v-report AND
langu = t_v-l AND
variant <> t_v-v1 AND
variant <> t_v-v2.
ENDSELECT.
MODIFY t_v.
ENDLOOP.
LOOP AT t_v.
if t_v-v1 <> '' and t_v-v2 <> '' and t_v-v3 <> ''.
WRITE: / t_v-report,
'|',
t_v-l,
'|',
t_v-v1,
'|',
t_v-v2,
'|',
t_v-v3.
endif.
ENDLOOP.
Code: Alles auswählen.
PROGRAM z_achtelik_test.
TABLES: varit.
DATA:
BEGIN OF t_v OCCURS 0,
report LIKE varit-report,
l LIKE varit-langu,
v1 LIKE varit-variant,
v2 LIKE varit-variant,
v3 LIKE varit-variant,
END OF t_v.
Ich hab deine Lösung ausprobiert.Grey_M hat geschrieben: ALso bei mir hats funktioniert. Der Zähler ist übrigens spitze!
Buchstaben 861
Wörter 133
Anweisungen 26
Code: Alles auswählen.
REPORT ztest.
DATA: gv_report(40).
SELECT DISTINCT report
FROM varit
INTO gv_report
WHERE report LIKE 'Z%'
GROUP BY report
HAVING COUNT( DISTINCT variant ) >= 3.
WRITE: / gv_report.
ENDSELECT.
Code: Alles auswählen.
Buchstaben - 127
Wörter - 24
Anweisungen - 4