‎2006 Oct 18 2:46 PM
Hi all,
I have a scenario where in i get access to a file from application server. This file is sent every 30 min to the application server from a Non-SAP server.
The further processing with that file is done in background which again happens every 15 min in SAP.
I have the following question:-
1. How do i make sure that all the contents of the file have been downloaded in the Application Server,before taking it for further processing.
Regards,
Neo.
‎2006 Oct 18 2:50 PM
For processing the application server, i assume that some program is in place.
It must be opening the file for reading.
So, if the file is still not downloaded fully, the opening of the file would result in a sy-subrc <> 0.
So, you need to process only if sy-subrc = 0.
Regards,
Ravi
‎2006 Oct 18 2:50 PM
For processing the application server, i assume that some program is in place.
It must be opening the file for reading.
So, if the file is still not downloaded fully, the opening of the file would result in a sy-subrc <> 0.
So, you need to process only if sy-subrc = 0.
Regards,
Ravi
‎2006 Oct 18 3:25 PM
Thanks for your reply.
I am using Open Dataset for opening of the file.
But are you sure that if the file is not downloaded fully. Open Dataset will result in sy-subrc <> 0.
Regards,
Neo.
‎2006 Oct 18 3:32 PM
The open dataset statement will be successful unless the external application has a way to prevent opening by SAP. In UNIX this can be done by only allowing read access to the file owner (chmod command). The external system could then open up the access once the download is complete.
Another option is to have the external system generate an empty file after creating the data file. The presence of this file would indicate to SAP that the data file is ready for loading.
‎2006 Oct 18 3:20 PM
Hi,
use below logic
open dataset filein for input in text mode.
if sy-subrc eq 0.
DO.
READ DATASET FILEIN INTO ITAB.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
APPEND ITAB.
CLEAR ITAB.
ENDDO.
else.
message e000 'Error opening file'.
ENDIF.
Regards
amole