‎2007 Jun 18 8:34 AM
Hi Friends,
I am getting very strange error while compliling my code. As I am reading a text file for input from Application server for further processing. But my system is giving me an error.
As the file and the path is not yet configured on the application server but i believe
it has to allow me to compile the program and when i execute it then it will give an error as I have tracked.
Kindly help.
I have pasted the code below for reference.
===============================
TYPES : BEGIN OF ty_file,
line(1055) TYPE c,
end of ty_file.
data : gs_file type ty_file.
data : g_file4 TYPE string VALUE '\usr\sap\CISCO\SP\CISCO_SP_CHG.TXT'.
OPEN DATASET g_file4 IN TEXT MODE FOR INPUT
ENCODING DEFAULT
WITH SMART LINEFEED.
IF sy-subrc NE 0.
MESSAGE e012.
LEAVE LIST-PROCESSING.
ENDIF.
CLEAR : gs_file.
DO.
READ g_file4 INTO gs_file.
IF sy-subrc NE 0.
EXIT.
ENDIF.
APPEND gs_file into gt_cust_tmp.
clear gs_file.
ENDDO.
CLOSE DATASET g_file4.
ERROR i am getting
Unable to interpret g_file4. Possible cause of error "Incorrect Spelling or Comma error".
=======================
Regards,
pradeep
‎2007 Jun 21 4:38 AM
TYPES : BEGIN OF ty_file,
line(1055) TYPE c,
end of ty_file.
data : gs_file type ty_file.
data gt_cust_tmp type table of ty_file.
data : g_file4 TYPE string VALUE '\usr\sap\CISCO\SP\CISCO_SP_CHG.TXT'.
OPEN DATASET g_file4 IN TEXT MODE FOR INPUT
ENCODING DEFAULT
WITH SMART LINEFEED.
IF sy-subrc NE 0.
MESSAGE e012.
LEAVE LIST-PROCESSING.
ENDIF.
CLEAR : gs_file.
DO.
READ dataset g_file4 INTO gs_file.
IF sy-subrc NE 0.
EXIT.
ENDIF.
APPEND gs_file to gt_cust_tmp.
clear gs_file.
ENDDO.
CLOSE DATASET g_file4.
check this coding. in the read statement dataset is missing.
with regards,
Vamsi
‎2007 Jun 21 4:38 AM
TYPES : BEGIN OF ty_file,
line(1055) TYPE c,
end of ty_file.
data : gs_file type ty_file.
data gt_cust_tmp type table of ty_file.
data : g_file4 TYPE string VALUE '\usr\sap\CISCO\SP\CISCO_SP_CHG.TXT'.
OPEN DATASET g_file4 IN TEXT MODE FOR INPUT
ENCODING DEFAULT
WITH SMART LINEFEED.
IF sy-subrc NE 0.
MESSAGE e012.
LEAVE LIST-PROCESSING.
ENDIF.
CLEAR : gs_file.
DO.
READ dataset g_file4 INTO gs_file.
IF sy-subrc NE 0.
EXIT.
ENDIF.
APPEND gs_file to gt_cust_tmp.
clear gs_file.
ENDDO.
CLOSE DATASET g_file4.
check this coding. in the read statement dataset is missing.
with regards,
Vamsi
‎2007 Jun 21 4:44 AM
Ensure that you are using the correct case and that it doesnt get converted automatically to uppercase since UNIX is case sensitive
Also, im not sure if \ or / is used in the filepath
Run transaction CG3Y to find out