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

Getting Subrc = 8 when trying to open Appln server path..

Former Member
0 Likes
5,758

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.

6 REPLIES 6
Read only

Former Member
0 Likes
893
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.

Read only

0 Likes
893

Still I am getting subrc as '8' only. I dont understand whats the problem here.

Read only

Former Member
0 Likes
893

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

Read only

Former Member
0 Likes
893

Thanks for the suggestions....

Read only

0 Likes
893

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.

Read only

Former Member
0 Likes
893

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