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: 

buffering data

Former Member
0 Kudos
91

Hi ,

My problem is that i have scheduled my abap program in background and the program reads some files which are in sequence and after that when it runs again the program has to know the file name which it has last read.How can this be achieved?

Thanks and Regards,

C.A

1 ACCEPTED SOLUTION

Former Member
0 Kudos
69

one way of doing is create a Z table and when u run the program as soon as it runs the first file, update the file name in the Z table and so...on till the program completes.

Now, when you are running for second time, read this Z table and you can find the file name and when it runs refresh the Z table data and once again add the file names...

5 REPLIES 5

Former Member
0 Kudos
70

one way of doing is create a Z table and when u run the program as soon as it runs the first file, update the file name in the Z table and so...on till the program completes.

Now, when you are running for second time, read this Z table and you can find the file name and when it runs refresh the Z table data and once again add the file names...

SuhaSaha
Advisor
Advisor
0 Kudos
69

Hello,

Try IMPORT & EXPORT stmts for this. When you read the last file export the filename to the DB & before starting to read the files do an import.


  DATA:
    l_wa_indx    TYPE indx.

*   Before reading the files, export from DB
    EXPORT l_v_filenam = l_v_filenam
    TO DATABASE indx(xy)
    FROM l_wa_indx
    CLIENT sy-mandt ID 'test'.    

*   Reaf the files
*   Last file read, then Import to DB    
    IMPORT l_v_filenam = l_v_filenam
    FROM DATABASE indx(xy)
    TO l_wa_indx
    CLIENT sy-mandt ID 'test'.    

Hope this is ok.

BR,

Suhas

andreas_mann3
Active Contributor
0 Kudos
69

another solution is to rename

the filename.

example: from /home/file123 to /home/file123.fin

A.

Former Member
0 Kudos
69

Thanks for the replies guys.

But i mean my problem is evryday the sequence of files change, i mean they start afresh with 1 .So do i have any option to handle it directly just by buffering it somewhere in memory and retrieving it instead of craeting a db table.

Regards,

C.A

0 Kudos
69

Hello CA,

Did you see my bit of code? Thats what i have suggested. Store the last file read to the DB table INDX(cluster table) . You dont have to create any table if u use this soln.

BR,

Suhas