I have created dynamic internal table in my program in which i fetch records from different database tables. I write these records to a file using open dataset as :
OPEN DATASET ld_fullpath FOR OUTPUT IN TEXT MODE .
LOOP AT <l_t_table> INTO <l_line>.
assign component sy-index of structure <l_line> to <fs>.
if sy-subrc <> 0.
l_string = <fs>.
concatenate l_record l_string into l_record separated by l_sep.
TRANSFER l_record TO ld_fullpath.
the problem is that the date fiels are read from table as YYYYMMDD format and we have to write these in file as MM/DD/YYYY format.
The variables are declared as :
FIELD-SYMBOLS: <l_t_table> TYPE table,
<l_line> TYPE ANY,
<FS> TYPE ANY.
so at run time i need to find the data type of field symbol <fs> and if it is 'D' i need to change the format.
Please suggest how to do this?
Points assured for helpful answers.