2007 Aug 03 5:36 AM
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
2007 Aug 03 5:49 AM
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
2007 Aug 03 5:49 AM
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
2007 Aug 03 5:55 AM
Hi,
You will have to use Read Dataset and Use SPLIT Statement to read it into the fields of the workarea.
Regards,
Shruthi
2007 Aug 03 6:07 AM
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.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |