Application Development 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: 

OPEN DATASET p_opath FOR OUTPUT

Former Member
0 Kudos

OPEN DATASET p_opath FOR OUTPUT IN TEXT MODE MESSAGE gv_msg ENCODING DEFAULT.

IF sy-subrc <> 0.

1). How can I error here gv_msg with file path ( p_opath ) here ?

as gv_msg contians ' No such file or directory' in case of above sy-subrc = 8.

2 ). here, is always sy-subrc zero or eight ?

Thanks in adv

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

> OPEN DATASET p_opath FOR OUTPUT IN TEXT MODE MESSAGE gv_msg ENCODING DEFAULT.

>

> IF sy-subrc <> 0.

> 1). How can I error here gv_msg with file path ( p_opath ) here ?

> as gv_msg contians ' No such file or directory' in case of above sy-subrc = 8.

>

you can give your own meessage also, some meaningful one.

if sy-subrc eq 8.

message e000 with 'your own message'.

endif.

>

> 2 ). here, is always sy-subrc zero or eight ?

yes sy-subrc 0 or 8

2 REPLIES 2

Former Member
0 Kudos

Hi,

You can use message statement..

If sy-subrc <> 0.

message e398(00) with gv_msg p_opath.

endif.

OR concatenate the variables and display the message

OR You can prepare your own message.

Thanks

Naren

former_member188685
Active Contributor
0 Kudos

> OPEN DATASET p_opath FOR OUTPUT IN TEXT MODE MESSAGE gv_msg ENCODING DEFAULT.

>

> IF sy-subrc <> 0.

> 1). How can I error here gv_msg with file path ( p_opath ) here ?

> as gv_msg contians ' No such file or directory' in case of above sy-subrc = 8.

>

you can give your own meessage also, some meaningful one.

if sy-subrc eq 8.

message e000 with 'your own message'.

endif.

>

> 2 ). here, is always sy-subrc zero or eight ?

yes sy-subrc 0 or 8