12-18-2008 3:56 PM
Hi All,
1) Is it possible to download integer/float data into application server ?
2) I want to download any table data to application server . but the problem is that i am passing table name at run time.
So, if table contains integer/float values, then i will have to convert it into character first and then will have to write to application server .
How can i do this...since the structure of file to be written is changing each time..
Thanks.
12-18-2008 3:58 PM
hi there..
In this scenario I would suggest you to use field-symbols.
Snippet:
DATA : lf_buf TYPE string,
lf_line TYPE string,
co_line_feed TYPE c VALUE cl_abap_char_utilities=>cr_lf.
FIELD-SYMBOLS : <fs_record> TYPE ANY,<fs_comp> TYPE ANY.
LOOP AT p_final_table ASSIGNING <fs_record>.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE <fs_record> TO <fs_comp>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
lf_buf = <fs_comp>.
IF sy-index = 1.
lf_line = lf_buf.
ELSE.
CONCATENATE lf_line lf_buf INTO lf_line SEPARATED BY c_sep.
ENDIF.
CLEAR lf_buf.
ENDDO.
CONCATENATE lf_line co_line_feed INTO lf_line.
APPEND lf_line TO p_output_file.
CLEAR lf_line.
ENDLOOP.
12-18-2008 3:58 PM
hi there..
In this scenario I would suggest you to use field-symbols.
Snippet:
DATA : lf_buf TYPE string,
lf_line TYPE string,
co_line_feed TYPE c VALUE cl_abap_char_utilities=>cr_lf.
FIELD-SYMBOLS : <fs_record> TYPE ANY,<fs_comp> TYPE ANY.
LOOP AT p_final_table ASSIGNING <fs_record>.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE <fs_record> TO <fs_comp>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
lf_buf = <fs_comp>.
IF sy-index = 1.
lf_line = lf_buf.
ELSE.
CONCATENATE lf_line lf_buf INTO lf_line SEPARATED BY c_sep.
ENDIF.
CLEAR lf_buf.
ENDDO.
CONCATENATE lf_line co_line_feed INTO lf_line.
APPEND lf_line TO p_output_file.
CLEAR lf_line.
ENDLOOP.
12-18-2008 4:13 PM