Application Development and Automation 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: 
Read only

urgent

Former Member
0 Likes
636

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!

3 REPLIES 3
Read only

Former Member
0 Likes
608

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

Read only

abdulazeez12
Active Contributor
0 Likes
608

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.

Read only

Former Member
0 Likes
608

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.