2007 Jun 22 6:49 AM
Hi !!
Iam using FM ''DDIF_FIELDINFO_GET' to get field names and short txt. after that iam moving all the short txt into an internal table (As aim interested only in the txt ). but whn i pass the itab to FM ''GUI_DOWNLOAD' in field names param, i get a dump. I have pasted my code below. Kindly help me.
DATA:
lt_dfies TYPE TABLE OF dfies,
lwa_dfies TYPE dfies,
lt_txt TYPE tttabname,
lwa_txt TYPE tabname.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = 'TRLS_POSITION_VALUE'
langu = sy-langu TABLES
dfies_tab = lt_dfies
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.
prepare Col Headers
LOOP AT lt_dfies INTO lwa_dfies.
lwa_txt = lwa_dfies-scrtext_s.
APPEND lwa_txt TO lt_txt.
ENDLOOP.
Download to excel
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = l_fullpath
filename = l_fullpath
filetype = 'DAT'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
wk1_n_format = 'X'
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
SHOW_TRANSFER_STATUS = ABAP_TRUE
IMPORTING
FILELENGTH =
TABLES
data_tab = l_tab_scrn
fieldnames = lt_txt.
Thanks,
Sri
2007 Jun 22 7:01 AM
Hi
You can download a single file, not multiple files in one go.
Also, check the File type...guess 'ASC' is better option..
Regards
Raj
2007 Jun 22 7:01 AM
Hi
You can download a single file, not multiple files in one go.
Also, check the File type...guess 'ASC' is better option..
Regards
Raj
2007 Jun 22 7:08 AM
hi.
please try file type as .ASC.it will avaid your DUMP.
rewards all help full asnswers.
regards.
jay
2007 Jun 22 7:13 AM
2007 Jun 22 7:22 AM
I tried with 'ASC' but no use. I have replaced the 'fieldnames' param with lt_dfies
instead of lt_txt and it doesn't give a dump. What kind of values can i pass for 'fieldnames' ??
I have pasted a part of dump analysis below:
Information on where terminated
Termination occurred in the ABAP program "SAPLSFES" - in "GUI_CHAR_DOWNLOAD".
The main program was "RTPM_TRIG_IGT_WORKLIST ".
In the source code you have the termination point in line 613
of the (Include) program "LSFESF02".
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"GETWA_NOT_ASSIGNED" " "
"SAPLSFES" or "LSFESF02"
"GUI_CHAR_DOWNLOAD"
Thanks,
Sri
2007 Jun 22 7:16 AM
Can you please post the dump analysis so that we can help you in effective manner
2007 Jun 22 7:18 AM
Hi,
Try changing the type of file to be used for Download like ASC.
Find the following sample code for GUI_DOWNLOAD.
* File name
DATA LV_FLNAME TYPE STRING.
* Get the error file name for method
LV_FLNAME = P_ERRFL.
* Download the error file
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
EXPORTING
FILENAME = LV_FLNAME
FILETYPE = 'ASC'
WRITE_FIELD_SEPARATOR = 'X'
CONFIRM_OVERWRITE = 'X'
CHANGING
DATA_TAB = PT_ERRFL
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.
* Error in downloading the error file
MESSAGE S009(Z001).
RETURN.
ENDIF.Hope this helps.
PS If the answer solves your query, plz reward all the replies and mark the thread Solved.
Regards
2007 Jun 22 9:58 PM
Hi,
The file type should be 'DBF', if you pass the field names.
Thanks.