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: 

URGENT:How to get values from a tab-delimited file into an internal table?

Former Member
0 Kudos

Hi all,

I am currently working on workflows. I have an urgent requirement.

I have workflow container values in a field called "value" in an internal table.

This field has the values of multiple fields in it.

(e.g.) the values of 'matnr' ,'matdesc' & 'qty' are concatenated in the field name "value". I currently assume that the field names are tab-delimited.

I need to obtain these values in an internal table.

I could not get a solution by using SPLIT command because it expects the field names to be specified. I cannot use it because my current functionality has about 10 work areas each consisting of over 100 fields.

I would be very grateful if you could help me find out how these values can be split into these work areas/tables.

Thanks a million in advance,

Vinod.V

5 REPLIES 5

Former Member
0 Kudos

Hi..

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'C:\ram\file1.txt'

FILETYPE = 'ASC'

<b>HAS_FIELD_SEPARATOR = 'X'</b>

TABLES

DATA_TAB = ITAB.

Now useing this itab data u can do whatever u want..

If it is in a single field..

data:

f1 ,f2, f3.

condense w_string.

split w_string into f1 f2 f3.

itab-f1 = f1.

itab-f2 = f2.

itab-f3 = f3.

append itab.

0 Kudos

Hi Rammohan,

Thanks for the effort!

But I don't need to use GUI upload because my functionality does not require to fetch data from presentation server.

Moreover, the split command advised by you contains separate fields...f1, f2, f3... and I cannot use it because I have 164 fields. I will have to split into 164 fields and assign the values back to 164 fields in the work area/header line.

Moreover I have about 10 such work areas. so the effort would be ten times the above effort! I want to avoid this! Please help!

I would be very grateful if you could provide an alternative solution.

Thanks once again,

Best Regards,

Vinod.V

0 Kudos

use:

SPLIT WA AT ';' INTO TABLE SPTAB.

LOOP AT SPTAB.

ASSIGN COMPONENT sy-tabix OF STRUCTURE ITAB TO <FS1>.

<FS1> = SPTAB-field.

..

A.

Message was edited by:

Andreas Mann

0 Kudos

Thank You Andreas,

I had already tried this...

Can you please suggest how sptab would be declared? Could you also tell me which field are you referring to in the statement <FS1> = SPTAB-field?

I would also require your help about how to (or in which part of your code) would these values would finally be passed to the 164 fields mentioned in the work area.

Warm Regards,

VV

0 Kudos

Any updates on this please?