Code: Alles auswählen.
SELECT * FROM mhnk INTO CORRESPONDING FIELDS OF TABLE i_mahn
WHERE bukrs EQ p_bukrs
AND laufd EQ p_laufd
AND laufi EQ p_laufi
LOOP AT i_mahn TRANSPORTING NO FIELDS WHERE
( mahna EQ 'MAH3' AND mahns >= '4' )
OR ( mahna EQ 'MAH2' AND mahns >= '3' )
OR ( mahna EQ 'IHW' AND mahns >= '3' )
OR ( mahna EQ 'OMNI' AND mahns >= '4' ).
SELECT * FROM mhnd INTO CORRESPONDING FIELDS OF TABLE itab_mahn
FOR ALL ENTRIES IN itab_mahn
WHERE bukrs EQ i_mahn-bukrs
Code: Alles auswählen.
SELECT * FROM mhnk INTO CORRESPONDING FIELDS OF TABLE i_mahn
WHERE bukrs EQ p_bukrs
AND laufd EQ p_laufd
AND laufi EQ p_laufi.
SELECT * FROM mhnd INTO CORRESPONDING FIELDS OF TABLE i_mahn
FOR ALL ENTRIES IN i_mahn
WHERE bukrs EQ i_mahn-bukrs.
DELETE i_mahn WHERE NOT
( mahna EQ 'MAH3' AND mahns >= '4' )
OR ( mahna EQ 'MAH2' AND mahns >= '3' )
OR ( mahna EQ 'IHW' AND mahns >= '3' )
OR ( mahna EQ 'OMNI' AND mahns >= '4' ).
Code: Alles auswählen.
SELECT * FROM mhnd
INNER JOIN MAHNK ON MHND~BUKRS = MHNK~BUKRS
AND alle_anderen_schlüsselfelder der MHNK
INTO CORRESPONDING FIELDS OF TABLE i_mahn
where MHND~bukrs = p_...
AND haste_nicht_gesehen
AND ( ( MHNK~MAHNA = '...' AND MHND~MAHNS >= ...) OR
( nochmal_was_anderes ) ).