Code: Alles auswählen.
DATA: i_k1 type HASHED TABLE OF z_dl_001 WITH UNIQUE key kunnr.
select * INTO CORRESPONDING FIELDS OF TABLE i_k1
from kna1 inner join knvk
on kna1~kunnr = knvk~kunnr
where kna1~KTOKD in kKTOKd
and kna1~kunnr in rkunnr.
perform download using kunde
CHANGING i_k1[].
*&---------------------------------------------------------------------*
*& Form download
*&---------------------------------------------------------------------*
FORM download USING pfad TYPE rlgrap-filename
CHANGING tab type any table .
filename = pfad.
*-hier gehts nicht weiter??????
* descr_ref ?= cl_abap_typedescr=>describe_by_data( tab ).
* CREATE DATA inttab TYPE TABLE OF (tab1).
* ASSIGN inttab->* TO <fstable>.
*-hier gehts nicht weiter??????
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
* BIN_FILESIZE =
filename = filename
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
changing
data_tab = <fstable>
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
NOT_SUPPORTED_BY_GUI = 22
ERROR_NO_GUI = 23
others = 24
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
ENDFORM. " download