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

How to use split command in upload program

Former Member
0 Likes
756

Thanks for all ...for their quick response for my previous query.

Iam continuing with the same upload program,now i have transfered the data from internal table to application server,now iam trying to upload this to database,while doing this iam using split command for spliting the records,but its not at all spliting,can u give me a solution for this.

7 REPLIES 7
Read only

Former Member
0 Likes
716

Hi,

If U know the exact structure of the record ,

declare an internal table with that structure and use

the following

SPLIT <record> AT <Split> INTO TABLE itab.

Regards,

GSR.

Read only

Former Member
0 Likes
716

Hi ,

When u uploaded to the application server, u wud have separated them by comma or # which is a hex character.

So all you need to say is split at '#' or ',' into wa_structure, after looping thru ur uploaded file..

Pls let me know if this is the problem or explain further.

Close this if the problem is resolved.

thanks,

Read only

Former Member
0 Likes
716
OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
  if sy-subrc <> 0.
    PERFORM messaging USING 'E' '001' text-e10 p_file space space.
  else.
    DO.
      READ DATASET P_file INTO WA .
      IF SY-SUBRC <> 0.
        EXIT.
      ENDIF.
      REPLACE ALL OCCURRENCES OF '"' IN WA WITH ''.
      CONDENSE WA NO-GAPS.
      SPLIT WA AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
      INTO wa_infile.
      append wa_infile to it_infile.
      clear wa_infile.
    ENDDO.
  endif.

try this...

vijay

Read only

0 Likes
716

suppose if your file is ',' or other delimited file

then

SPLIT WA AT ',' into wa_infile.

replace the delimiter.

thanks

vijay

Read only

0 Likes
716

I got it...

Thanks for all for quick response.

Especially special thanks to vijay.

Read only

0 Likes
716

please don't forget to reward.

regards

vijay

Read only

Former Member
0 Likes
716

Hi..

Just give it a try..

Loop at < INTERNAL TABLE>

.

.

.

SPLIT ' ' at <ITAB> into <feilds>

append <ITAB>.

ENDLOOP.

Thanks,

Maheshwari.V