2012 Aug 16 1:55 PM
Hi,
Following is my ABAP code which I have written for downloading a file from application server.But somehow the SPLIT command is not working in my case.It jus gets the first value in the work area i.e lt_datd but the rest of the values in the string don't get updated.
TYPES : BEGIN OF ty_data ,
terid(2) TYPE c ,
cardi(8) TYPE c ,
pernr(8) TYPE c ,
ldate(8) TYPE c ,
ltime(6) TYPE c ,
satza(3) TYPE c ,
END OF ty_data.
DATA : t_datd TYPE TABLE OF ty_data,
lt_datd TYPE ty_data.
cl = sy-mandt.
v_date = sy-datum - 1.
CONCATENATE v_date+6(2) v_date+4(2) v_date+0(4) INTO v_date.
CONCATENATE '/tmp/' v_date '.log' INTO p_dir.
CONDENSE p_dir.
OPEN DATASET p_dir FOR INPUT IN TEXT MODE ENCODING DEFAULT.
DO.
READ DATASET p_dir INTO string.
IF sy-subrc EQ 0.
SPLIT string AT '#' INTO lt_datd-terid
lt_datd-cardi
lt_datd-pernr
lt_datd-ldate
lt_datd-ltime
lt_datd-satza.
APPEND lt_datd TO t_datd.
CLEAR lt_datd.
ENDIF.
ENDDO.
CLOSE DATASET p_dir.
Please help.
Hi,
Following is my ABAP code which I have written for downloading a file from application server.But somehow the SPLIT command is not working in my case.It jus gets the first value in the work area i.e lt_datd but the rest of the values in the string don't get updated.
TYPES : BEGIN OF ty_data ,
terid(2) TYPE c ,
cardi(8) TYPE c ,
pernr(8) TYPE c ,
ldate(8) TYPE c ,
ltime(6) TYPE c ,
satza(3) TYPE c ,
END OF ty_data.
DATA : t_datd TYPE TABLE OF ty_data,
lt_datd TYPE ty_data.
cl = sy-mandt.
v_date = sy-datum - 1.
CONCATENATE v_date+6(2) v_date+4(2) v_date+0(4) INTO v_date.
CONCATENATE '/tmp/' v_date '.log' INTO p_dir.
CONDENSE p_dir.
OPEN DATASET p_dir FOR INPUT IN TEXT MODE ENCODING DEFAULT.
DO.
READ DATASET p_dir INTO string.
IF sy-subrc EQ 0.
SPLIT string AT '#' INTO lt_datd-terid
lt_datd-cardi
lt_datd-pernr
lt_datd-ldate
lt_datd-ltime
lt_datd-satza.
APPEND lt_datd TO t_datd.
CLEAR lt_datd.
ENDIF.
ENDDO.
CLOSE DATASET p_dir.
Please help.
2012 Aug 16 2:08 PM
2012 Aug 16 2:19 PM
Hi,
use the debugger and switch to the hex-view of the string for checking, what kind of character will be hide through the '#'.
Kind regards,
Hendrik
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |