2013 May 07 2:09 PM
Hi Expert,
I made a custom program and at the end of the program, I am writing the log in AL11 in text format.
OPEN DATASET p_ofile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT it_error_list INTO wa_error_list.
l_out_data = wa_error_list.
TRANSFER l_out_data TO p_ofile.
ENDLOOP.
CLOSE DATASET p_ofile.
This is simple, but sometime there is no file created in the AL11.
I do direct executed for the backgorund job.
Have someone ever faced this problem?
Regards,
Robert
2013 May 07 2:16 PM
add some error handling and create an error file when errors occurred and then place this on the AL11 directory. At least you will now that an error has occurred.
2013 May 07 2:17 PM
Capture the message (if any) from OPEN DATASET (addition MESSAGE - read the abap documentation for the syntax). Check the sy-subrc after OPEN DATASET. If it is non-zero, report that in some way, with the message.
You should also check sy-subrc after TRANSFER and CLOSE, and report any non-zero return codes.
If, when you run the program, all the sy-subrc are 0, then the problem is not with your program. Perhaps the directory is full, or your file is being overwritten by another process.
2013 May 07 2:21 PM
Maybe the job user hasn't authorizations to the path of variable p_ofile.
You can use this function "AUTHORITY_CHECK_DATASET" in your source code to identify the issue.
If SAP server is allocated in an operative system like LINUX or UNIX there are more authorizations
2013 May 07 2:25 PM
Hi,
Check if the file path location exists that is the folder directory exists and that the user with which the program s being executed has authorizations to create the file. Also check all the SY-SUBRC values after OPEN, TRANSFER and CLOSE operations.
Cheers,
Arindam
2013 May 07 2:26 PM
Hi
can you reproduce the case where there is no file exported (like: only at 1AM in the morning, or when the are no errors to report...)
Let us know
a
2013 May 07 2:28 PM
All good suggestions so far. All I can add is to check your server architecture, if your instance has batch processes running on multiple application servers the file could be getting written to different places for each batch run.
Point of terminology: AL11 is a transaction for viewing files on the operating system, not a place to write files to.
Regards,
Nick
2013 May 07 2:30 PM
Hi Nick,
Yes, there are 2 server running for production.
how can I check the server structure?
what should I do to check that?
Regards,
Robert
2013 May 07 3:54 PM
Ask your basis team. On most systems I've worked on there is on the file structure set up to cover all application servers.
2013 May 07 2:28 PM
Hi All,
I have tried to debug, but when I debug, the file is always created.
I don't check the sy-subrc everytime, because there is more transfer above that code.
The strange thing was I tried to run it several times, sometime the file is created and sometime the file is not created.
I checked in the development, the file is always created. (the first check is on Production)
is it possible that the cause is the system?
Regards,
Robert
2013 May 07 3:58 PM
Roberto says: "I don't check the sy-subrc everytime"
And that is where you go wrong
2013 May 07 5:49 PM
Return code? I don't need to check the ret... kzzz..s.....
---out-of-cheese-error---
---redo-from -start---
2016 Jul 11 5:45 PM
Hello,
After suffering a lot with this issue, we discovered that this random behaviour is due to the different server configurations, while scheduling the job in sm36, you can specify the ex. server, so try with the different options and see which one is working for you.
Then inform to your Basis team to investigate further.
At least you will be sure that the files are created always by forcing the correct server.
Enjoy!
2024 Feb 06 11:20 AM
Hi ,Iam also facing the issue.File is not created through background job in cqd but when I debug the background job file is creating.Not able to find the reason behind this.Can you suggest me the idea to proceed with this issue
2024 Jul 10 4:52 PM
Your system has more than one application server. When you run the process in debug mode, the system generates the file on the same app server, and you can see it in AL11. But, in the background, it's dynamic.
To check the file, open TCODE SM51, go to each app server, and check AL11. You will find the file in AL11 on one of the app servers.