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

reading data from dynamically from different file.

Former Member
0 Likes
752

Is there any function moudle or class to read data from a file in application layer, whoes structure is changing dynamically.

Urgent....... Can any one help me out in this......

Thanks in advance....

Thanks,

feroz.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
708

Hello,

Even if the structure of the file changes dynamically, you can still read the file the same way as any other file.

I think the structure of the file will change depending on the business scenario.

So you need to find out the following things :

1. How many combinations of business scenario exists

2. Find out the possible file structure for each of the business scenario

3. Depending on the scenario, you know what the structure of file would be and read the file into an internal table accordingly.

4. Carry out further processing like any other file upload functionality.

cheers,

Sushil Joshi

6 REPLIES 6
Read only

Former Member
0 Likes
709

Hello,

Even if the structure of the file changes dynamically, you can still read the file the same way as any other file.

I think the structure of the file will change depending on the business scenario.

So you need to find out the following things :

1. How many combinations of business scenario exists

2. Find out the possible file structure for each of the business scenario

3. Depending on the scenario, you know what the structure of file would be and read the file into an internal table accordingly.

4. Carry out further processing like any other file upload functionality.

cheers,

Sushil Joshi

Read only

0 Likes
708

We cant have fixed number of file structure.. as it would be changing dynamically.... Then how can i do that... any soluiton .....

Read only

Former Member
0 Likes
708

Hi Feroz,

Do u mean that structure of the file on the application server is changing dynamically.

The following is the FM to read data from a file on Application Server.

OPEN DATASET FNAME FOR INPUT in text mode encoding default.

LOOP AT TAB INTO WA.

READ DATASET FNAME INTO WA.

IF SY-SUBRC 0.

EXIT.

ENDIF.

WRITE: / WA-COLUMN1, WA-COLUMN2.

ENDLOOP.

This is the FM to search the file on Application Server.

F4_DXFILENAME_TOPRECURSION

Regards,

Sai

Edited by: Sai Krishna Kowluri on Jul 15, 2008 9:45 AM

Read only

0 Likes
708

WEhat would be the structure of wa ?????

Read only

0 Likes
708

Solved by My self...

Read only

Former Member
0 Likes
708

Solved by my self, At the input file at the starting i will be getting the technical fields name.

These are SAP standard table fields, So i am creating the structure dynamically with the help of this fields.

Thanks,

Feroz.