Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Open dataset not working in ECC 5.0, returning 8

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.

Tags:
Former Member
Former Member replied

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

Rob

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question