Code: Alles auswählen.
SELECT * FROM (p_tab)
INTO <wa>.
IF sy-subrc NE 0.
CLOSE DATASET p_datei.
EXIT.
ELSE.
TRANSFER <wa> TO p_datei.
ENDIF.
ENDSELECT.
Code: Alles auswählen.
RANGES: r_not FOR dd03l-fieldname .
r_not = 'INP.INCLU*' . APPEND r_not .
SELECT tabname fieldname position leng
INTO TABLE i_struktur
FROM dd03l
WHERE tabname EQ r_tab-low AND
fieldname IN r_not .
CREATE DATA dref TYPE (r_tab-low).
ASSIGN dref->* TO <fs_ein>.
SELECT *
INTO <fs_ein>
FROM (r_tab-low)
WHERE (i_where) .
CLEAR z_cnt . CLEAR z_cnt2 .
CLEAR i_ausgabe.
LOOP AT i_struktur ASSIGNING <fs_struk>
WHERE tabname EQ r_tab-low .
z_cnt2 = <fs_struk>-leng .
ASSIGN COMPONENT <fs_struk>-fieldname OF STRUCTURE <fs_ein>
TO <fs_aus> .
i_ausgabe-out+z_cnt(z_cnt2) = <fs_aus> .
z_cnt = z_cnt + <fs_struk>-leng .
ENDLOOP.
TRANSFER i_ausgabe-out TO z_pfad .