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

flat file upload to internal table

Former Member
0 Likes
895

Hi folks,

Please tell me how to upload flat file (txt format or application server) internal table...the data in flat file is inform of header and item data.

any sample codes will be really helpfull.

thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
864

Hi kartikey,

By using the OPEN DATASET AND GUI_UPLOAD you can upload data from flat file.

You can search SCN you can definitely find the Entire coding.

Regards

Ranga

7 REPLIES 7
Read only

Former Member
0 Likes
864

hint

open dataset

read dataset

gui_upload

search on the above terms, and dont expect sample code for your work

Read only

Former Member
0 Likes
865

Hi kartikey,

By using the OPEN DATASET AND GUI_UPLOAD you can upload data from flat file.

You can search SCN you can definitely find the Entire coding.

Regards

Ranga

Read only

0 Likes
864

HI Ranga,

I have header data and item level data in my file, How can i upload both level data at the same time in my internal tables, Please tell me the method how to do it

thanks in advance

Read only

0 Likes
864

hi Ranga,

I am trying the following code,please tel me where am I getting wrong:

opendataset p_file for input in text mode encoding default.

data: wa_file type string.

read dataset p_file into wa_file.

if sy-subrc = 0.

split wa_file at CL_ABAP_CHAR_UTILITIES=>horizontal_tab into wa_itab.

append wa_area to itab.

close dataset p_file.

Read only

0 Likes
864

change your code like this.

data: wa_file type rlgrap-filename.

opendataset p_file for input in text mode encoding default.

if sy-subrc = 0.

do.

read dataset p_file into wa_file.

if sy-subrc = 0.

append wa to itab.

else.

exit.

endif.

enddo.

close dataset p_file.

endif.

Read only

Former Member
0 Likes
864

sorry i given wrong answering.

Edited by: Ranga Swamy on Nov 1, 2008 9:54 PM

Read only

Former Member
0 Likes
864

Hi,

You can Take Header file and Line items as separate files in selection screen and you can process.

Regards,

Sudhakar.