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: 

Suggestion for coding problem.

Former Member
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

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.

Former Member
0 Kudos

Use GUI_UPLOAD/DOWNLOAD

background job will not work...

Former Member
0 Kudos

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

0 Kudos

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

kesavadas_thekkillath
Active Contributor
0 Kudos

This message was moderated.