cancel
Showing results for 
Search instead for 
Did you mean: 

Download

Former Member
0 Kudos

Hi,

I want to download fields (Only Structure) of a table in text format. For that I used download function whith one blank record in internal table of same structure and used other internal table for header purpose (Which contains) all the fields of a table, I used download function. my problem is DATE format in SAP is dd.mm.yyyy and when client converted that date format to text file 00.00.0000 will come in date fields ( Because it contains one blank record. I asked them to enter dates in yyyymmdd format. I want to change date format while using download function.

How can I do that. Please let me know.

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi vikram,

1. in the fm, GUI_DOWNLOAD,

2. there is one parameter

DAT_MODE

3. pass this as 'X'.

4. then the date will be downloaded

as 30.03.2006

(instead of 20060330.

5. just copy paste in new program

(to get a taste of it)

report abc.

data : begin of itab occurs 0,

mydate type sy-datum,

end of itab.

break-point.

itab-mydate = sy-datum.

append itab.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = 'd:\mydate.txt'

  • FILETYPE = 'ASC'

  • APPEND = ' '

  • WRITE_FIELD_SEPARATOR = ' '

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

DAT_MODE = 'X'

  • CONFIRM_OVERWRITE = ' '

  • NO_AUTH_CHECK = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • IMPORTING

  • FILELENGTH =

tables

data_tab = itab.

  • FIELDNAMES =

  • 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

  • OTHERS = 22

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

regards,

amit m.

ferry_lianto
Active Contributor
0 Kudos

Hi Vikram,

You can select Print option from Table/Structure menu, then select print preview after specifying the printer.

From Print Preview you have an option to see it in the list. Once you are in the list you can download it as html page, spread sheet, notepad etc from System->List menu.

or you can code like something like this and use ALV to download.


PARAMETERS: TABNAME TYPE DDOBJNAME.

DATA T_DFIES LIKE STANDARD TABLE OF DFIES.

CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
TABNAME = TABNAME
TABLES
DFIES_TAB = T_DFIES
* FIXED_VALUES =
EXCEPTIONS
NOT_FOUND = 1
INTERNAL_ERROR = 2
OTHERS = 3
.
IF SY-SUBRC = 0.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_STRUCTURE_NAME = 'DFIES'
TABLES
T_OUTTAB = T_DFIES
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Hope this will help.

Regards,

Ferry Lianto

Former Member
0 Kudos

Why don´t you use FM DDIF_TABL_GET? This FM gives you the structure of the table, as well as the according internal types of the fields.