Code: Alles auswählen.
select city from addresstab where upper(stadt) = 'KÖLN';
Code: Alles auswählen.
REPORT zz_exec_sql.
DATA:
itab like t005t OCCURS 0 WITH HEADER LINE.
BEGIN OF i_exec OCCURS 0,
spras LIKE t005t-spras,
landx LIKE t005t-landx,
END OF i_exec.
*** Zu suchender Text in der Länderbezeichnung
PARAMETERS: p1 LIKE t005t-landx DEFAULT '*SCH*'.
START-OF-SELECTION.
*** Umsetzung der Wildcards für SELECT
TRANSLATE p1 USING '*%+_'.
TRANSLATE p1 TO UPPER CASE.
*** EXEC SQL
EXEC SQL PERFORMING WRITE_INTO_TABLE.
SELECT SPRAS, LANDX, NATIO
INTO :ITAB-SPRAS,
:ITAB-LANDX,
:ITAB-NATIO
FROM T005T
WHERE MANDT = :SY-MANDT
AND UPPER(LANDX) LIKE :P1
ENDEXEC.
*** Ausgabe der selektierten Länder
LOOP AT i_exec.
WRITE:/ i_exec.
ENDLOOP.
**************************************************
* FORM write_into_table
**************************************************
FORM write_into_table.
MOVE-CORRESPONDING itab TO i_exec.
APPEND i_exec.
ENDFORM.