‎2008 Jul 14 5:18 PM
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.
‎2008 Jul 14 5:33 PM
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
‎2008 Jul 14 5:33 PM
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
‎2008 Jul 15 8:36 AM
We cant have fixed number of file structure.. as it would be changing dynamically.... Then how can i do that... any soluiton .....
‎2008 Jul 15 8:44 AM
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
‎2008 Jul 15 9:56 AM
‎2009 Mar 04 2:51 PM
‎2009 Mar 04 2:53 PM
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.