02-16-2010 10:04 AM
I need to write a program which does the following:
Runs in background
Reads all files for a particular directory on the presentation server (Drive Z:\, for example). What FM?
Upload each of the files from the list given above and process them. What FM to use for uploading?
Once processed, I need to move each processed file to an archived directory, again on the presentation server. What FM's can I use?
I have done this before but all files were held on application server (Unix), read from there and also archioved to there as well. That was easy, but the presentation server gives more challenges.
When running an ABAP program in background can the presentation server be accessed in this manner?. When I say presentation server I mean a local Network drive.
Can anyone be of help?.
Jas
Edited by: Jason Stratham on Feb 16, 2010 11:09 AM
02-16-2010 10:15 AM
You can use FM - GUI_UPLOAD/DOWNLOAD to upload /download from Presentation server.
But you cannot access Presentation server while executing program in background mode.
02-16-2010 10:17 AM
02-16-2010 10:32 AM
Thinking about this, I may have to stick with processing within the application server and have just run FTP type commands to connect to the network drive to access the files.
I should be able to do this using standard FTP commands, using the method demostrated by program RSFTP002.
Regards
Jason
Edited by: Jason Stratham on Feb 16, 2010 12:32 PM
02-16-2010 11:56 AM
Hi Jason
You can get the list of files by using the following:
CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
EXPORTING
directory = p_fldr
filter = '*.xls'
IMPORTING
FILE_COUNT =
DIR_COUNT =
TABLES
file_table = it_file
dir_table = it_dir_chk
EXCEPTIONS
CNTL_ERROR = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Loop at it_file.
endloop.
I'm currently uploading multiple excel sheets of multiple excel files
and using classes
but if it is only one sheet you could use FM 'ALSM_EXCEL_TO_INTERNAL_TABLE'
Else use the gui upload/download route
Edited by: Vic Delport on Feb 16, 2010 12:57 PM
02-16-2010 11:56 AM