‎2007 Sep 24 8:39 AM
hi! i use the read dataset statement and i hope to take this as result:
3000000001,PROTON A.E,,094442268, 10420.00-
3000000016,DIMOS ATHINEON,,090025537, 0.00
then i want to 'break' these lines into 5 fields. the first field is 3000000001 then the second should be this one after comma , that is PROTON A.E . how can i implement this?
i 've heard something about <b>split </b>but i dont know how to use it.
Thank You!
‎2007 Sep 24 8:42 AM
Hi
see the sample code and do similarly
OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
ELSE.
DO.
CLEAR: wa_string, wa_uploadtxt.
READ DATASET ld_file INTO wa_string.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
wa_uploadtxt-name2
wa_uploadtxt-age.
MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
APPEND wa_upload TO it_record.
ENDIF.
ENDDO.
CLOSE DATASET ld_file.
ENDIF.
Regards
Anji
‎2007 Sep 24 8:45 AM
Use Open dataset and read statement to read the whole line in internal table, say itab-record.
then, use split statement
split itab-record at ',' into lv_part1 lv_part2 lv_part3 lv_part4.
‎2007 Sep 24 8:45 AM
thanks
i ll try to use this
DELIMITER(2) VALUE ','.
SPLIT NAMES2 AT DELIMITER INTO ONE TWO THREE FOUR.
and if it's not working then yours.