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

File open error from Application Server

Former Member
0 Likes
7,744

Hello friends,

I am able to open a file from the foreground mode.

However when i run the program in background am unable to open it.


    OPEN DATASET fp_asfile FOR INPUT IN TEXT MODE ENCODING DEFAULT.

I have alos tried to change the user with the back groung user ID. but it again failed.

Can any one tell me why.

Ster

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,533

Hi,

Ok..go to SM51 in your system...and then check how many application servers are there..

if there are more than one..do the following..

In the background mode...the program might be running in a different application server....than the one which you used in the your foreground session..

check this..

1)

In your foreground session...go to system -> status...get the application server..

2)

when you define the job in SM36...there is a field in the initial screen.."Exec. Target"...which says in which application server you want to run this job...Give the application server that you got from step 1...Then release the job...now your program should work fine..

Thanks,

Naren

14 REPLIES 14
Read only

Former Member
0 Likes
3,533

Hi,

Make sure the file is there in all the application servers of your system...as there might be more than one application server.

Thanks

Naren

Read only

0 Likes
3,533

Thanks Naren. I really didnt understand what you meant as it might not be there in all the application servers.

However I am able to open it in foreground mode.

Thanks,

Ster

Read only

0 Likes
3,533

What do you mean by foreground mode?

Are you running the same program with the same user in foreground and you are saying it work ok?

OR

do you mean you are able to access the file through AL11 in foreground?

Read only

0 Likes
3,533

You should check file permissions for read and modify in application server system. If you have a read-only, you can't open it for modifying.

Read only

Former Member
0 Likes
3,534

Hi,

Ok..go to SM51 in your system...and then check how many application servers are there..

if there are more than one..do the following..

In the background mode...the program might be running in a different application server....than the one which you used in the your foreground session..

check this..

1)

In your foreground session...go to system -> status...get the application server..

2)

when you define the job in SM36...there is a field in the initial screen.."Exec. Target"...which says in which application server you want to run this job...Give the application server that you got from step 1...Then release the job...now your program should work fine..

Thanks,

Naren

Read only

0 Likes
3,533

Thanks Naren.

When I check in SM51 I see 3 active servers. I am using ECC 6.0.

tsdux07_TS6_03

tsdux09_TS6_03

tsdux09_TS6_04

System - Status - Server anem - tsdux09_TS6_03

But in SM36 when I do the F4 help down for EXEC target I see only tsdux07_TS6_03.

However when I try with tsdux09_TS6_03 it pops with error message

Target server tsdux09_TS6_03 is not configured for background processing

Thanks,

Ster.

Read only

0 Likes
3,533

If you are specifying the full path...and if all the app servers are mounted properly....i personally dont think foreground and background should make any difference...are you using the same user id in both case?..also how are u specifying the file path in both cases.

Read only

0 Likes
3,533

Thanks Aparna,

Everything is same in both the cases however I run.

I guess I have to look more in what Naren saaid. Multiple Application Servers.

Naren,

However when I wrote this files on the APP server i did it in foregroung mode

I will rewrite in the back ground mode and see if I can open those with a different program in Background.

Shreekant...

Read only

0 Likes
3,533

Any More Suggestions.

Ster

Read only

0 Likes
3,533

Can you add the MESSAGE addition in your open dataset statement and find out what is the error message. This will help you analyze the problem.

DATA mess TYPE STRING.

OPEN DATASET fp_asfile FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE mess.

if sy-subrc ne 0.
 WRITE: / mess.
endif.

Read only

0 Likes
3,533

GO to SM51,

Look into the message. Double Click on the server that has a message to run in background.

Once you are in the server, Upload the files that you need to use them for background processing.

If UPloading from Local server run in foreground.

Once the files are there in this Application server, use them for your back ground mode.

Hope this will take care.

Shreekant....

Read only

former_member156446
Active Contributor
0 Likes
3,533

hi the path you mention in fp_asfile is case sensitive.. make sure you are using the exact case for all the folders and the file names.

Read only

Former Member
0 Likes
3,533

Hi,

do one thing...for the existing job that failed to open the file..check which application server it ran..you will get this information in the job details..

Now..go to SM51...double click on the application server which ran the job..create another session from that screen...now you will on that application server...you can check this by system -> status..

here in that new session run the program in foreground mode...check if you were to run the program..

Thanks

Naren

Read only

Former Member
0 Likes
3,533

Hi,

check with your basis if the folder is there in all the application servers..and the application servers mounted..

Thanks,

Naren