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 not working in ECC 5.0, returning 8

Former Member
0 Kudos

Gurus,

Open data set is returning 8. The file is there on application server as selected by KD4 function module when I try to do open dataset it retruns 08.

REPORT XXX message-id zdolfemsg.

----


  • Data Declaration

----


data: v_mfile type C,

v_ffile type C.

data: w_mpath type string,

w_fpath type string.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME

TITLE text-001.

PARAMETERS: p_master like rlgrap-filename obligatory,

p_func like rlgrap-filename obligatory,

SELECTION-SCREEN END OF BLOCK b1.

************************************************************************

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_master.

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

CHANGING

file_name = p_master.

w_mpath = p_master.

************************************************************************

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_func.

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

EXPORTING

static = 'X'

CHANGING

file_name = p_func.

w_fpath = p_func.

start-of-selection.

perform initilaization_for_master.

perform initialization_for_func.

if v_mfile ='X' and V_FFILE = 'X'.

message e001 with sy-repid.

ELSEIF V_mfile = 'X'.

message e000 with p_master sy-repid. "Error opening file

ELSEIF V_FFILE = 'X'.

message e000 with p_func sy-repid. "Error opening file

endif.

close dataset p_master.

close dataset p_func.

&----


*& Form initilaization

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM initilaization_for_master .

open dataset w_mpath for output in text mode encoding default.

if sy-subrc <> 0.

v_mfile = 'X'.

endif.

ENDFORM. " initilaization

&----


*& Form initialization_for_func

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM initialization_for_func .

open dataset w_fpath for input in text mode ENCODING DEFAULT.

if sy-subrc <> 0.

v_ffile = 'X'.

endif.

ENDFORM. " initialization_for_func

Please help.

Regards,

Rajsh.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You are selecting a file on the presentation server and then trying to open it on the application server.

Rob

4 REPLIES 4

Former Member
0 Kudos

You are selecting a file on the presentation server and then trying to open it on the application server.

Rob

0 Kudos

Thanks Rob. How can I open the file on presentation server. I have to read the data from the file and fill in internal table.

Regards,

Rajesh.

0 Kudos

You don't have to open it. Just use FM GUI_UPLOAD.

Rob

Former Member
0 Kudos

did you check the permissions on the file as well as with the user id you are running this code