09-08-2009 7:25 AM
hello all
i am trying to download a flat file and trying to upload it in another program.
for this i am using gui_upload and gui_download function modules.
if i download the file as ASC and upload with ASC there is no problem.
if i download the file as DAT and upload with DAT its giving an exception invalid file type
if i download the file as DAT and upload with ASC its giving an exception bad data format.
but in real senario my customer is sending a flat file with DAT type and i am unable to upload it.
how to solve this problem?
09-08-2009 7:49 AM
In addition to providing
file_type = 'X';
you may also try passing
DAT_MODE = 'X'.
Regards,
Mohaiyuddin
09-08-2009 7:41 AM
Hi,
when uploading DAT pass file type as 'ASC' and give HAS_FIELD_SEPARATOR = 'X'.
For other types see the code below.
CASE P_RECTYP.
WHEN 'DAT'.
MOVE 'X' TO L_FLDSEP.
MOVE 'ASC' TO L_TYPE.
WHEN 'ASC'.
MOVE ' ' TO L_FLDSEP.
MOVE P_RECTYP TO L_TYPE.
WHEN 'BIN'.
CLEAR L_TYPE.
MOVE P_RECTYP TO L_TYPE.
MOVE ' ' TO L_FLDSEP.
WHEN OTHERS.
MOVE 'X' TO L_FLDSEP.
MOVE 'ASC' TO L_TYPE.
ENDCASE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = LV_FILENAME
FILETYPE = l_type
HAS_FIELD_SEPARATOR = l_fldsep
Regards,
Vasanth
09-08-2009 7:49 AM
In addition to providing
file_type = 'X';
you may also try passing
DAT_MODE = 'X'.
Regards,
Mohaiyuddin
09-08-2009 8:32 AM
Thanks Mohaiyuddin
its working with DAT_MODE = 'X'.
i have given you 10 points