10-14-2008 9:22 PM
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.
10-14-2008 9:28 PM
You are selecting a file on the presentation server and then trying to open it on the application server.
Rob
10-14-2008 9:28 PM
You are selecting a file on the presentation server and then trying to open it on the application server.
Rob
10-14-2008 9:31 PM
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.
10-14-2008 9:33 PM
10-14-2008 9:30 PM
did you check the permissions on the file as well as with the user id you are running this code