Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Upload/Download in application server

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

former_member156446
Active Contributor
0 Kudos

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.

2 REPLIES 2

former_member156446
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Hi,

Thanks for the code..

I will try this logic...