SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS:p_land TYPE kna1-land1,
p_file TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK b1.
TYPES:
BEGIN OF ty_kna1,
kunnr TYPE kunnr,
name1 TYPE name1,
land1 TYPE land1,
ort01 TYPE ort01,
END OF ty_kna1.
DATA:
it_kna1 TYPE TABLE OF ty_kna1,
wa_kna1 TYPE ty_kna1.
DATA: g_str1 TYPE string VALUE '.xls',
g_str TYPE string,
g_str2 TYPE string.
DATA : BEGIN OF it_header OCCURS 0,
line(50) TYPE c,
END OF it_header.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
static = 'X'
CHANGING
file_name = P_file.
START-OF-SELECTION.
it_header-line = 'Customer Number'.
APPEND it_header.
it_header-line = 'Customer Name'.
APPEND it_header.
it_header-line = 'Country'.
APPEND it_header.
it_header-line = 'City'.
APPEND it_header.
IF p_file NS '.xls'.
g_str = p_file.
CONCATENATE g_str g_str1 INTO g_str2.
ELSE.
g_str2 = p_file.
ENDIF.
SELECT
kunnr
name1
land1
ort01
FROM kna1
INTO TABLE it_kna1
WHERE land1 = p_land.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = g_str2
filetype = 'ASC'
write_field_separator = 'X'
TABLES
data_tab = it_kna1
fieldnames = it_header
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |