‎2008 Jan 31 9:51 AM
I want to download a file that is saved in an application server to my local server. I cannot us e Download function to save the file as my output is oin file format and not table format.
Can any one suggest me, how to convert the file into an internal table or is there any way to transfer the file from application server to local server.
‎2008 Jan 31 9:54 AM
please check this updated information:
You can use the Function module ALSM_EXCEL_TO_INTERNAL_TABLE to read the Excel file into the internal table of type alsmex_tabline.
From this internal table you can fill the target internal table.
TYPES:
BEGIN OF ty_upload,
field1 TYPE c length 12,
field2 TYPE c length 12,
field3 TYPE c length 12,
END OF ty_upload.
DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH DEFAULT KEY.
DATA wa_upload TYPE ty_upload.
DATA itab TYPE STANDARD TABLE OF alsmex_tabline WITH DEFAULT KEY.
FIELD-SYMBOLS: <wa> type alsmex_tabline.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = filename
i_begin_col = 1
i_begin_row = 1
i_end_col = 3
i_end_row = 65535
TABLES
intern = itab.
LOOP AT itab ASSIGNING <wa>.
CASE <wa>-col.
WHEN '0001'.
wa_upload-field1 = <wa>-value.
WHEN '0002'.
wa_upload-field2 = <wa>-value.
WHEN '0003'.
wa_upload-field3 = <wa>-value.
ENDCASE.
APPEND wa_upload TO it_upload.
CLEAR wa_upload.
ENDLOOP.
Edited by: Abap-fresher on Jan 31, 2008 11:00 AM
‎2008 Jan 31 4:48 PM
HI
Checkout T-code CG3Y & CG3Z might be helpful to you
Reward if helpful
Thanks and Regards
Chaitanya
‎2008 Feb 01 3:51 AM
Harsad,
See the below simple code ...
DATA FNAME(60) VALUE 'myfile'.
DATA: FNAME(12) VALUE 'abcdefghijkl',
TEXT2(50),
LENG TYPE I.
OPEN DATASET FNAME FOR INPUT IN TEXT
MODE.
DO.
READ DATASET FNAME INTO TEXT2 LENGTH
LENG.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
WRITE: / SY-SUBRC, TEXT2, LENG.
ENDDO.
CLOSE DATASET FNAME.
Don't forget to reward if useful...
‎2008 Feb 01 11:16 AM
hai ,
plz Refer to the Function Module
Just Run The following FModule In SE37
Then Give respective File Paths