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

dataset

Former Member
0 Likes
577

i want to upload the data from the application server to database using dataset

but read dataset will read a line how to split this or is there is another way to get the data in work area in corresponding fields

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
558

HI,

you can use Opendataset then read data set into an internal table..

Now loop at internal table into work area ( lets say you have separater comma)

Let suppose you have three filed values with comma separator..

split workarea AT ',' into wa-f1 wa-f2 wa-f3.

Append that WA to ITAB2. (ITAB2 with same structure of work area)

Your ITAB 2 contains the application file values, you can upload to database now..

Feel free to post if any issues;

rewards if useful,

regards,

nazeer

Message was edited by:

nazeer shaik

Hi,

You will have to use Read Dataset and Use SPLIT Statement to read it into the fields of the workarea.

Regards,

Shruthi

3 REPLIES 3
Read only

Former Member
0 Likes
559

HI,

you can use Opendataset then read data set into an internal table..

Now loop at internal table into work area ( lets say you have separater comma)

Let suppose you have three filed values with comma separator..

split workarea AT ',' into wa-f1 wa-f2 wa-f3.

Append that WA to ITAB2. (ITAB2 with same structure of work area)

Your ITAB 2 contains the application file values, you can upload to database now..

Feel free to post if any issues;

rewards if useful,

regards,

nazeer

Message was edited by:

nazeer shaik

Read only

Former Member
0 Likes
558

Hi,

You will have to use Read Dataset and Use SPLIT Statement to read it into the fields of the workarea.

Regards,

Shruthi

Read only

Former Member
0 Likes
558

use below logic to split the data and upload the corresponding fields

DATA:

dsn TYPE STRING value `text.txt`,

fld TYPE STRING,

pos TYPE i.

....

OPEN DATASET dsn IN TEXT MODE ENCODING DEFAULT FOR INPUT.

....

GET DATASET dsn POSITION pos.

READ DATASET dsn INTO fld.

WRITE / fld.

SET DATASET dsn POSITION pos.

READ DATASET dsn INTO fld.

WRITE / fld.

....

CLOSE DATASET dsn.