Application Development 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: 

Can we create internal table from txt file seperated by space?

Former Member
0 Kudos

Hi all,

I have text file abc.txt :

BP1 SAP1

BP123 SAP2

Now I can read this file GUI_UPLOAD FM

But I want to return this as table with two columns and two rows.

First row with two columns: BP1 SAP1

Scond row with two column: BP2 SAP2

I tried using

TYPES:

BEGIN OF i_po_data,

BP(3) TYPE c, " lmax length of the line of the text file

BP_name(10) TYPE c,

END OF i_po_data.

but in this case

First 3 characters will be filled in first column.

But in the second row BP123 , BP1 will be in first column but

'23' will not fit in first column.

How to insert the data in the first column just by space?

so that BP123 can also fit in the second column.

Thanks,

SUSHANT

2 REPLIES 2

GauthamV
Active Contributor
0 Kudos

hi,

if you have declared a variable of length 3 ,then how can you store data in that varaible which is more then 3 in length?

change your varaible length to get required result.

madan_ullasa
Contributor
0 Kudos

Hi,

make this

BP(3) TYPE c = BP TYPE strings or BP(100) TYPE c... Be reasonable in the length of the variable...

regds,

Madan,,,