‎2007 Oct 17 6:41 AM
Hi Friends,
In my requirement, I have to post the output of a report to an application server path.
In my selection screen I am doing the validation as follows:
TRY.
Catch the message
OPEN DATASET lv_path FOR OUTPUT MESSAGE lv_message
IN LEGACY TEXT MODE." ENCODING DEFAULT.
CATCH cx_sy_file_authority.
MESSAGE e204 WITH p_file. "#EC *
CATCH cx_sy_file_open .
MESSAGE e205 WITH lv_path. "#EC *
ENDTRY.
IF sy-subrc eq 0.
All is well - close dataset and delete
CLOSE DATASET lv_path.
DELETE DATASET lv_path.
ELSE.
MESSAGE e206 WITH p_file lv_message. "#EC *
ENDIF.
Basis guys have created the directory, I can see this in AL11.
I am entering the path correctly ( I mean considering case sensitive ) in the selection screen. But, When i am trying to open the directory I am getting sy-subrc value as '8' and generating an error message every time. Please help asap.
Thanks,
Phani.
‎2007 Oct 17 6:44 AM
TRY.
* Catch the message
OPEN DATASET lv_path FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
CATCH cx_sy_file_authority.
MESSAGE e204 WITH p_file. "#EC *
CATCH cx_sy_file_open .
MESSAGE e205 WITH lv_path. "#EC *
ENDTRY.
IF sy-subrc eq 0.
* All is well - close dataset and delete
CLOSE DATASET lv_path.
DELETE DATASET lv_path.
ELSE.
MESSAGE e206 WITH p_file lv_message. "#EC *
ENDIF.
I have modified the OPEN DATASET statment. Please check.
‎2007 Oct 17 6:46 AM
Still I am getting subrc as '8' only. I dont understand whats the problem here.
‎2007 Oct 17 6:48 AM
Hi,
1. Please ensure that lv_path has a proper path & file name
2. Ensure that you have the necessary authorztn to access the folder & to read or write in that folder.
If above two points have answer YES, then it should not give sy-subrc = 8.
Best regards,
Prashant
‎2007 Oct 17 7:00 AM
‎2007 Oct 17 7:10 AM
Hi Phani..
This may be bcoz of not having the Authorization for this file.
To Check for user Authorization on a App Server file :
CALL The Function module 'AUTHORITY_CHECK_DATASET'
Based on the status of this FM the use OPEN Dataset.
REWARD IF HELPFUL.
‎2014 May 05 3:45 PM
Hi ALL,
I was facing the same issue.
Then I converted parameter like this.
PARAMETERS: filename(200) TYPE c DEFAULT '/tmp/test1.xml' LOWER CASE.
So, open dataset was able to find the file.
Thank you.
Bing