Application Development and Automation 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: 
Read only

Upload CSV file from Application server

Former Member
0 Likes
970

Hi folks,

I am trying to upload a CSV file from the application server (SAP PRd server) in the background. How can I set this process in the background. Suppose if I have the file name as newfilemmddyyyy. and mmddyyyy being the sy-datum.

Any thoughts? Because I shall have new file dumped into the SAP server 2 to 3 times in a week, that needs to be uploaded into the system and I am looking to automate this process

Thanks in advance,

VG

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
735

Hi,

You can schedule your program in the background processing using the following tcodes.

SM36 - for creating sessions

SM37 : for executing or processing the sessions.

SM35: for session overview.

You can directly run the session or schedule using programs RSBDCSUB / RSBDCBTC from within the program.

AL11 is the tcode for the SAP directories where we can get the application server path.

The LOGIC is as follows:

If the name of the program i.e. newfilemmddyyyy where 'newfile' is constant then there is no problem.

eg: filename is 'myfile02282008'.

in the program take variables like

path1 path2 and filepath are string variables.

path1 = filename+0(6).

path2 = sydatum.

*date format must be adjusted.

concatenate path1 path2 into filepath .

Use 'OPEN DATASET ..................'

Now the dataset is ready.

We have to take into consideration the day of processing the program.

Reward points if helpful.

Thanks and Rewards.

Edited by: Ammavajjala Narayana on Mar 28, 2008 12:28 AM

4 REPLIES 4
Read only

Former Member
0 Likes
735

hi go to sm 37 tcode then u can see the options for the job selection like immidiate and at a particular time ...

go to sm37> choose extended job selection-->

reward points if useful,

venkat.

Read only

Sm1tje
Active Contributor
0 Likes
735

You can concatenate the filename and the system date into a variable and do an OPEN DATASET lv_filename.

lv_dataset type string (or char100).

You can then schedule a job which will run every day for example. The program will then check if a file with the current name is available. If so, upload and process the file otherwise, STOP processing.

To schedule a job you can use transaction SM36 (SM37).

regards,

Micky.

Read only

Former Member
0 Likes
736

Hi,

You can schedule your program in the background processing using the following tcodes.

SM36 - for creating sessions

SM37 : for executing or processing the sessions.

SM35: for session overview.

You can directly run the session or schedule using programs RSBDCSUB / RSBDCBTC from within the program.

AL11 is the tcode for the SAP directories where we can get the application server path.

The LOGIC is as follows:

If the name of the program i.e. newfilemmddyyyy where 'newfile' is constant then there is no problem.

eg: filename is 'myfile02282008'.

in the program take variables like

path1 path2 and filepath are string variables.

path1 = filename+0(6).

path2 = sydatum.

*date format must be adjusted.

concatenate path1 path2 into filepath .

Use 'OPEN DATASET ..................'

Now the dataset is ready.

We have to take into consideration the day of processing the program.

Reward points if helpful.

Thanks and Rewards.

Edited by: Ammavajjala Narayana on Mar 28, 2008 12:28 AM

Read only

0 Likes
735

thanks guys. I knew how to schedule the job. I needed some help to get the filepath info to run the process in the backgorund.

Got it. Shall reward the points accordingly.

VG