cancel
Showing results for 
Search instead for 
Did you mean: 

Check in process chain if flat file is available

Former Member
0 Kudos

Hello,

i'd like to upload in a given time period data which are contained in a flat file during executing a process chain.

Before I load the data from the flat file I want to check if the file is available.

(Later I want to move the file to another folder - but this is not the point)

How can I check if the file is available?

Note: I saw that this is possible at help.sap.com (http://help.sap.com/saphelp_nw70/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm) --> Including Operating System Commands as Processes in Process Chains.

But there is no description how to do that. (The BI server is a windows machine)

Has anyone an idea?

Manuel

Accepted Solutions (1)

Accepted Solutions (1)

former_member184494
Active Contributor
0 Kudos

you would have to write a .BAT file which will basically check if the file exists and then if the file does not exist - it continues waiting for it before completion....

http://www.aumha.org/a/batches.php might be of help....

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you - your answer were very helpfull!

I tried the solution of Vikram Srivastava, because it was pretty easy to implement and works fine.

Former Member
0 Kudos

Hi,

Use SM49 to create a system command. for analysis, make sure the check mark is on for 'evaluate output of command'.

next put the name of the file in your 'if the output contains' text box. For my example, put 'filedone'.

for 'the process is', pick 'ended successfully'.

next create a System Command by clicking the pencil.

enter the command to be executed in the 'Operating system command' line. e.g

'cmd /c dir D:\usr\sap\interface\file\filedone'

Put the OS Command in my process chain. If 'filedone' was returned (meaning it found it), it gave a success. Then evaluated the OS Command as successful or failed. If it failed, the file was not found.

-Vikram

former_member181964
Active Contributor
0 Kudos

Hi,

1. Create Three Floders in AL11 i.e. in Apllication Server. Eg Name it F1, F2 and F3.

2. First dump the .csv files into F1. (Name xyz.csv).

3. Then using UNIX/WINDOWS (depends on your OS) script , first check the file is there are not in F1, if yes then rename the file with date and time or date and transfer the files from F1 to F2 i.e xyz06032010.csv.

4. Then Create a small ABAP program to check the file in F2, if it is there then Trigger the Event, and using that event you execute teh PC.

5. Then using UNIX/WINDOWS (depends on your OS) script , transfer the files from F2 to F3 i.e xyz06032010.csv.

6. Next day morning F1 and F2 are empty and F3 is having the backup files.

So use this method, I used the similar logic and it is working fine.

Timinings are importent i.e what time you need to dump the fule in F1 and what time you need to run UNIX/WINDOWS (depends on your OS) script , transfer the files from F1 to F2 and what time UNIX/WINDOWS (depends on your OS) script , transfer the files from F2 to F3.

Or

1. Create Two Floders in AL11 i.e. in Apllication Server. Eg Name it F1 and F2

2. First dump the .csv files into F1. (Name xyz.csv)

3. Then load the data using InfoPackage, through PC.

4. At the end of the load Attach a simple Program to Move the xyz.csv file from F1 to F2.

5. So next day the file will come to F1 and the it will load and at the end it will move to F2.

Else you can use simple one or two lines of UNIX/WINDOWS (depends on your OS) script to move the file from F1 to F2 , once you load is over.

While moving the file from F1 to F2 you can append the date at the end of the file and then move to F2, it is use full for future reference.

See Blogs and Article, similar logic...

https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy

How to transfer the Data from SAP-System to Non-SAP system without additional Cost/License

/people/surendrakumarreddy.koduru/blog/2009/03/11/how-to-transfer-the-data-from-sap-system-to-non-sap-system-without-additional-costlicense

To Check the Files/Reports in Application Server and Trigger Mail Alerts.

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/4096bf2d-bcea-2b10-4ab4-e0683830d9b2&override...

Thanks

Reddy